aboutsummaryrefslogtreecommitdiffstats
path: root/main/frame.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-18 23:47:01 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-18 23:47:01 +0000
commitd9d1ed38227d0646eed979a8f12139ae517e5b5f (patch)
treeb5f0bd047d53611a89ec0394a3c4efec497c9365 /main/frame.c
parent8ed70c9fdef986fdc7ff63cc03df87aa1ade4cc1 (diff)
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: http://svn.digium.com/svn/asterisk/trunk@103799 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/frame.c')
-rw-r--r--main/frame.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/main/frame.c b/main/frame.c
index ff182cc05..304bd2716 100644
--- a/main/frame.c
+++ b/main/frame.c
@@ -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;