aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-12-06 16:14:26 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-12-06 16:14:26 +0000
commit643ba32cb79c2645fde8a50dc665df96cf6c9a0f (patch)
tree05cdf1ac103878ee3139192d97a262f4f4a67676 /channels
parent143bc3f5c3591f6f4bc00d0a505212eb40405cfd (diff)
Add support for accepting and sending T.38 in the initial INVITE.
(closes issue #9402) Reported by: thdei git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@91439 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 31d1e3266..0407b2771 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -4052,6 +4052,10 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit
if (i->rtp)
ast_jb_configure(tmp, &global_jbconf);
+ /* If the INVITE contains T.38 SDP information set the proper channel variable so a created outgoing call will also have T.38 */
+ if (i->udptl && i->t38.state == T38_PEER_DIRECT)
+ pbx_builtin_setvar_helper(tmp, "_T38CALL", "1");
+
/* Set channel variables for this call from configuration */
for (v = i->chanvars ; v ; v = v->next)
pbx_builtin_setvar_helper(tmp, v->name, v->value);
@@ -12175,6 +12179,20 @@ static void handle_response_invite(struct sip_pvt *p, int resp, char *rest, stru
if (p->owner && !ast_test_flag(req, SIP_PKT_IGNORE))
ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
+ } else if (p->udptl && p->t38.state == T38_LOCAL_DIRECT) {
+ /* We tried to send T.38 out in an initial INVITE and the remote side rejected it,
+ right now we can't fall back to audio so totally abort.
+ */
+ p->t38.state = T38_DISABLED;
+ /* Try to reset RTP timers */
+ ast_rtp_set_rtptimers_onhold(p->rtp);
+ ast_log(LOG_ERROR, "Got error on T.38 initial invite. Bailing out.\n");
+
+ /* The dialog is now terminated */
+ if (p->owner && !ast_test_flag(req, SIP_PKT_IGNORE))
+ ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
+ ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
+ sip_alreadygone(p);
} else {
/* We can't set up this call, so give up */
if (p->owner && !ast_test_flag(req, SIP_PKT_IGNORE))