[asterisk-commits] file: branch file/t38fun r89183 - /team/file/t38fun/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Nov 12 11:24:45 CST 2007


Author: file
Date: Mon Nov 12 11:24:45 2007
New Revision: 89183

URL: http://svn.digium.com/view/asterisk?view=rev&rev=89183
Log:
Add support for receiving and sending T.38 in the initial invite.

Modified:
    team/file/t38fun/channels/chan_sip.c

Modified: team/file/t38fun/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/file/t38fun/channels/chan_sip.c?view=diff&rev=89183&r1=89182&r2=89183
==============================================================================
--- team/file/t38fun/channels/chan_sip.c (original)
+++ team/file/t38fun/channels/chan_sip.c Mon Nov 12 11:24:45 2007
@@ -4044,6 +4044,10 @@
 	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);
@@ -12126,6 +12130,20 @@
 			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))




More information about the asterisk-commits mailing list