diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-06-26 19:27:24 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-06-26 19:27:24 +0000 |
commit | c26b86e763ee6beb11653c871e356ce7f200a406 (patch) | |
tree | 7d14c88d204bd105f7d39b32a5bf704bb486d3d6 /main | |
parent | 19bee1ce7f4ae0ad04bdb301fa3b042ddf187836 (diff) |
Improve T.38 negotiation by exchanging session parameters between application and channel.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@203699 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/channel.c | 2 | ||||
-rw-r--r-- | main/frame.c | 19 | ||||
-rw-r--r-- | main/rtp_engine.c | 6 |
3 files changed, 25 insertions, 2 deletions
diff --git a/main/channel.c b/main/channel.c index 62377f897..f33de43ea 100644 --- a/main/channel.c +++ b/main/channel.c @@ -3483,6 +3483,7 @@ static int attribute_const is_visible_indication(enum ast_control_frame_type con case AST_CONTROL_CONNECTED_LINE: case AST_CONTROL_REDIRECTING: case AST_CONTROL_TRANSFER: + case AST_CONTROL_T38_PARAMETERS: break; case AST_CONTROL_CONGESTION: @@ -3613,6 +3614,7 @@ int ast_indicate_data(struct ast_channel *chan, int _condition, case AST_CONTROL_TRANSFER: case AST_CONTROL_CONNECTED_LINE: case AST_CONTROL_REDIRECTING: + case AST_CONTROL_T38_PARAMETERS: /* Nothing left to do for these. */ res = 0; break; diff --git a/main/frame.c b/main/frame.c index e305580ac..09c11dbda 100644 --- a/main/frame.c +++ b/main/frame.c @@ -857,6 +857,25 @@ void ast_frame_dump(const char *name, struct ast_frame *f, char *prefix) } snprintf(subclass, sizeof(subclass), "T38/%s", message); break; + case AST_CONTROL_T38_PARAMETERS: + if (f->datalen != sizeof(struct ast_control_t38_parameters *)) { + message = "Invalid"; + } else { + struct ast_control_t38_parameters *parameters = f->data.ptr; + enum ast_control_t38 state = parameters->request_response; + 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_Parameters/%s", message); + break; case -1: strcpy(subclass, "Stop generators"); break; diff --git a/main/rtp_engine.c b/main/rtp_engine.c index ad8544c9a..138b7c03c 100644 --- a/main/rtp_engine.c +++ b/main/rtp_engine.c @@ -854,7 +854,8 @@ static enum ast_bridge_result local_bridge_loop(struct ast_channel *c0, struct a (fr->subclass == AST_CONTROL_UNHOLD) || (fr->subclass == AST_CONTROL_VIDUPDATE) || (fr->subclass == AST_CONTROL_T38) || - (fr->subclass == AST_CONTROL_SRCUPDATE)) { + (fr->subclass == AST_CONTROL_SRCUPDATE) || + (fr->subclass == AST_CONTROL_T38_PARAMETERS)) { /* If we are going on hold, then break callback mode and P2P bridging */ if (fr->subclass == AST_CONTROL_HOLD) { if (instance0->engine->local_bridge) { @@ -1073,7 +1074,8 @@ static enum ast_bridge_result remote_bridge_loop(struct ast_channel *c0, struct (fr->subclass == AST_CONTROL_UNHOLD) || (fr->subclass == AST_CONTROL_VIDUPDATE) || (fr->subclass == AST_CONTROL_T38) || - (fr->subclass == AST_CONTROL_SRCUPDATE)) { + (fr->subclass == AST_CONTROL_SRCUPDATE) || + (fr->subclass == AST_CONTROL_T38_PARAMETERS)) { if (fr->subclass == AST_CONTROL_HOLD) { /* If we someone went on hold we want the other side to reinvite back to us */ if (who == c0) { |