Add a non-invasive API for application level manipulation of T38 on a channel. This uses control frames (so they can even pass across IAX2) to negotiate T38 and provided a way of getting the current status of T38 using queryoption. This should by no means cause any issues and if it does I will take responsibility for it.

(closes issue #11873)
Reported by: dimas
Patches:
      v4-t38-api.patch uploaded by dimas (license 88)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103799 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Joshua Colp
2008-02-18 23:47:01 +00:00
parent 6c3a7a3e51
commit e54da94808
5 changed files with 194 additions and 46 deletions

View File

@@ -710,6 +710,7 @@ void ast_frame_dump(const char *name, struct ast_frame *f, char *prefix)
char cn[60];
char cp[40];
char cmn[40];
const char *message = "Unknown";
if (!name)
name = noname;
@@ -786,6 +787,24 @@ void ast_frame_dump(const char *name, struct ast_frame *f, char *prefix)
case AST_CONTROL_UNHOLD:
strcpy(subclass, "Unhold");
break;
case AST_CONTROL_T38:
if (f->datalen != sizeof(enum ast_control_t38)) {
message = "Invalid";
} else {
enum ast_control_t38 state = *((enum ast_control_t38 *) f->data);
if (state == AST_T38_REQUEST_NEGOTIATE)
message = "Negotiation Requested";
else if (state == AST_T38_REQUEST_TERMINATE)
message = "Negotiation Request Terminated";
else if (state == AST_T38_NEGOTIATED)
message = "Negotiated";
else if (state == AST_T38_TERMINATED)
message = "Terminated";
else if (state == AST_T38_REFUSED)
message = "Refused";
}
snprintf(subclass, sizeof(subclass), "T38/%s", message);
break;
case -1:
strcpy(subclass, "Stop generators");
break;