[asterisk-commits] branch oej/t38passthrough r11816 - in /team/oej/t38passthrough: ./ channels/ ...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat Mar 4 08:18:13 MST 2006


Author: oej
Date: Sat Mar  4 09:18:09 2006
New Revision: 11816

URL: http://svn.digium.com/view/asterisk?rev=11816&view=rev
Log:
- Adding options to sip.conf, need explanation
- Adding a README file
- Changing variable names to reflect that they're global settings
- Small formatting changes

Added:
    team/oej/t38passthrough/doc/sipt38support.txt   (with props)
Modified:
    team/oej/t38passthrough/Makefile
    team/oej/t38passthrough/channels/chan_sip.c
    team/oej/t38passthrough/configs/sip.conf.sample

Modified: team/oej/t38passthrough/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/t38passthrough/Makefile?rev=11816&r1=11815&r2=11816&view=diff
==============================================================================
--- team/oej/t38passthrough/Makefile (original)
+++ team/oej/t38passthrough/Makefile Sat Mar  4 09:18:09 2006
@@ -431,6 +431,7 @@
 
 INSTALL=install
 
+#Add T38_SUPPORT by default. Disable by commenting out next line
 CFLAGS+=-DT38_SUPPORT
 
 _all: all

Modified: team/oej/t38passthrough/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/t38passthrough/channels/chan_sip.c?rev=11816&r1=11815&r2=11816&view=diff
==============================================================================
--- team/oej/t38passthrough/channels/chan_sip.c (original)
+++ team/oej/t38passthrough/channels/chan_sip.c Sat Mar  4 09:18:09 2006
@@ -36,7 +36,6 @@
  * \ingroup channel_drivers
  *
  */
-
 
 #include <stdio.h>
 #include <ctype.h>
@@ -481,9 +480,9 @@
 #endif
 
 #if defined(T38_SUPPORT)
-static int t38udptlsupport = 0;
-static int t38rtpsupport = 0;
-static int t38tcpsupport = 0;
+static int global_t38udptl_support = 0;
+static int global_t38rtp_support = 0;
+static int global_t38tcp_support = 0;
 #endif
 
 #define DEC_CALL_LIMIT	0
@@ -2967,11 +2966,11 @@
 	t38 support is enabled - not good, but working. 
 	XXX: It would be better to have user/peer configuration flag for t38support. :XXX
      */
-     if (!t38udptlsupport) {
-	    return ast_rtp_bridge(c0,c1,flags,fo,rc,timeoutms);
-     } else {
-	    ast_log(LOG_NOTICE, "T38 UDPTL support enabled native RTP bridging disabled\n");
-	    return AST_BRIDGE_FAILED_NOWARN;
+	if (!global_t38udptl_support) {
+		return ast_rtp_bridge(c0,c1,flags,fo,rc,timeoutms);
+	} else {
+		ast_log(LOG_NOTICE, "T38 UDPTL support enabled, native RTP bridging disabled\n");
+		return AST_BRIDGE_FAILED_NOWARN;
      }
 }
 #endif
@@ -3255,7 +3254,7 @@
 				f = ast_dsp_process(p->owner, p->vad, f);
 				if (f && (f->frametype == AST_FRAME_DTMF)) { 
 #if defined(T38_SUPPORT)
-					if (t38udptlsupport && f->subclass == 'f')  {
+					if (global_t38udptl_support && f->subclass == 'f')  {
 						/* Fax tone */
 						if (option_debug)
 							ast_log(LOG_DEBUG, "Fax CNG detected on %s\n", ast->name);
@@ -3291,7 +3290,7 @@
 #if defined(T38_SUPPORT)
 	/* If we are NOT bridged to another channel, and we have detected fax tone we issue T38 re-invite to a peer */
 	/* If we are bridged than it is responsibility of the SIP device to issue T38 re-invite if it detects CNG or fax preabmle */
-	if (faxdetected  && t38udptlsupport && (p->t38state == 0) && !(ast_bridged_channel(ast))) {
+	if (faxdetected  && global_t38udptl_support && (p->t38state == 0) && !(ast_bridged_channel(ast))) {
 		if (!ast_test_flag(p, SIP_GOTREFER)) {
 			if (!p->pendinginvite) {
 				if (option_debug > 2)
@@ -3400,7 +3399,7 @@
 		if (global_videosupport)
 			p->vrtp = ast_rtp_new_with_bindaddr(sched, io, 1, 0, bindaddr.sin_addr);
 #if defined(T38_SUPPORT)
-		if (t38udptlsupport)
+		if (global_t38udptl_support)
 			p->udptl = ast_udptl_new_with_bindaddr(sched, io, 0, bindaddr.sin_addr);
 #endif
 		if (!p->rtp || (global_videosupport && !p->vrtp)) {
@@ -3833,7 +3832,7 @@
 			}
 		}
 #if defined(T38_SUPPORT)
-		if (p->udptl && t38udptlsupport && (sscanf(m, "image %d udptl t38 %n", &x, &len) == 1)) {
+		if (p->udptl && global_t38udptl_support && (sscanf(m, "image %d udptl t38 %n", &x, &len) == 1)) {
 			if (debug)
 				ast_verbose("Got T.38 offer in SDP\n");
 			found = 1;
@@ -3932,7 +3931,7 @@
 #if defined(T38_SUPPORT)
 	/* Setup UDPTL port number */
 	sin.sin_port = htons(udptlportno);
-	if (p->udptl && t38udptlsupport && sin.sin_port) {
+	if (p->udptl && global_t38udptl_support && sin.sin_port) {
 		ast_udptl_set_peer(p->udptl, &sin);
 		if (debug) {
 			ast_verbose("Peer T.38 UDPTL is at port %s:%d\n", ast_inet_ntoa(iabuf,sizeof(iabuf), sin.sin_addr), ntohs(sin.sin_port));
@@ -5053,7 +5052,7 @@
 		alreadysent |= p->prefcodec;
 	}
 #if defined(T38_SUPPORT)
-	if (t38rtpsupport) {
+	if (global_t38rtp_support) {
     		/* TODO: Improve this */
 		len = snprintf(a_audio_next, a_audio_left, " %d", 191);
     		a_audio_next += len;
@@ -13094,9 +13093,9 @@
 	ast_copy_string(global_realm, DEFAULT_REALM, sizeof(global_realm));
 	ast_copy_string(default_callerid, DEFAULT_CALLERID, sizeof(default_callerid));
 #if defined(T38_SUPPORT)
-	t38udptlsupport = 0;
-	t38rtpsupport = 0;
-	t38tcpsupport = 0;
+	global_t38udptl_support = 0;
+	global_t38rtp_support = 0;
+	global_t38tcp_support = 0;
 #endif
 	global_videosupport = DEFAULT_VIDEOSUPPORT;
 	compactheaders = DEFAULT_COMPACTHEADERS;
@@ -13190,12 +13189,12 @@
 		} else if (!strcasecmp(v->name, "videosupport")) {
 			global_videosupport = ast_true(v->value);
 #if defined(T38_SUPPORT)
-		} else if (!strcasecmp(v->name, "t38udptlsupport")) {
-			t38udptlsupport = ast_true(v->value);
-		} else if (!strcasecmp(v->name, "t38rtpsupport")) {
-			t38rtpsupport = ast_true(v->value);
-		} else if (!strcasecmp(v->name, "t38tcpsupport")) {
-			t38tcpsupport = ast_true(v->value);
+		} else if (!strcasecmp(v->name, "global_t38udptl_support")) {
+			global_t38udptl_support = ast_true(v->value);
+		} else if (!strcasecmp(v->name, "global_t38rtp_support")) {
+			global_t38rtp_support = ast_true(v->value);
+		} else if (!strcasecmp(v->name, "global_t38tcp_support")) {
+			global_t38tcp_support = ast_true(v->value);
 #endif
 		} else if (!strcasecmp(v->name, "compactheaders")) {
 			compactheaders = ast_true(v->value);
@@ -14068,6 +14067,11 @@
 	ast_unregister_application(app_dtmfmode);
 	ast_unregister_application(app_sipaddheader);
 
+#if defined(T38_SUPPORT)
+	/* Tell the UDPTL subdriver that we're gone */
+	ast_udptl_proto_unregister(&sip_udptl);
+#endif
+
 	ast_cli_unregister_multiple(my_clis, sizeof(my_clis) / sizeof(my_clis[0]));
 
 	ast_rtp_proto_unregister(&sip_rtp);

Modified: team/oej/t38passthrough/configs/sip.conf.sample
URL: http://svn.digium.com/view/asterisk/team/oej/t38passthrough/configs/sip.conf.sample?rev=11816&r1=11815&r2=11816&view=diff
==============================================================================
--- team/oej/t38passthrough/configs/sip.conf.sample (original)
+++ team/oej/t38passthrough/configs/sip.conf.sample Sat Mar  4 09:18:09 2006
@@ -120,6 +120,10 @@
 ;
 ;regcontext=sipregistrations
 ;
+;---------------------------- T.38 FAX PASSTHROUGH SUPPORT ------------------------------------
+; t38udptlsupport = yes		; Default false
+; t38rtpsupport = yes		; Default false
+; t38tcpsupport = yes		; Default false
 ;----------------------------------------- OUTBOUND SIP REGISTRATIONS  ------------------------
 ; Asterisk can register as a SIP user agent to a SIP proxy (provider)
 ; Format for the register statement is:

Added: team/oej/t38passthrough/doc/sipt38support.txt
URL: http://svn.digium.com/view/asterisk/team/oej/t38passthrough/doc/sipt38support.txt?rev=11816&view=auto
==============================================================================
--- team/oej/t38passthrough/doc/sipt38support.txt (added)
+++ team/oej/t38passthrough/doc/sipt38support.txt Sat Mar  4 09:18:09 2006
@@ -1,0 +1,10 @@
+T38 Fax passthrough support in SIP
+----------------------------------
+
+By default there is now T.38 Fax over IP support for fax passthrough
+in the SIP channel. There are a number of devices in the market that
+supports T.38 faxing.
+
+Contributors
+-------------
+The T.38 support in Asterisk was developed by Steve Underwood

Propchange: team/oej/t38passthrough/doc/sipt38support.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/oej/t38passthrough/doc/sipt38support.txt
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/oej/t38passthrough/doc/sipt38support.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain



More information about the asterisk-commits mailing list