[asterisk-commits] irroot: branch irroot/t38gateway-1.8 r341073 - in /team/irroot/t38gateway-1.8...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Oct 16 11:53:07 CDT 2011


Author: irroot
Date: Sun Oct 16 11:52:59 2011
New Revision: 341073

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=341073
Log:
Multiple revisions 340970,341022

........
  r340970 | kmoore | 2011-10-14 22:49:39 +0200 (Fri, 14 Oct 2011) | 8 lines
  
  Quiet RTCP Receiver Reports during fax transmission
  
  RTCP is now disabled for "inactive" RTP audio streams during SIP T.38 sessions.
  The ability to disable RTCP streams in res_rtp_asterisk was missing, so this
  code was added to support the bug fix.
  
  (closes issue ASTERISK-18400)
........
  r341022 | kpfleming | 2011-10-14 23:36:06 +0200 (Fri, 14 Oct 2011) | 10 lines
  
  Change the internal name of the menuselect options that are used to control
  whether modules are embedded or not; using just the bare category name led to
  accidentally enabling these options when users used the wrong "--enable"
  operation on the menuselect command line.
  
  Now the internal option names are prefixed with "EMBED_", so they won't be
  the same as the name of the category containing the modules they control
  the embedding of.
........

Merged revisions 340970,341022 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    team/irroot/t38gateway-1.8/   (props changed)
    team/irroot/t38gateway-1.8/Makefile.moddir_rules
    team/irroot/t38gateway-1.8/build_tools/embed_modules.xml
    team/irroot/t38gateway-1.8/channels/chan_sip.c
    team/irroot/t38gateway-1.8/res/res_rtp_asterisk.c

Propchange: team/irroot/t38gateway-1.8/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/irroot/t38gateway-1.8/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sun Oct 16 11:52:59 2011
@@ -1,1 +1,1 @@
-/branches/1.8:1-340879
+/branches/1.8:1-341072

Modified: team/irroot/t38gateway-1.8/Makefile.moddir_rules
URL: http://svnview.digium.com/svn/asterisk/team/irroot/t38gateway-1.8/Makefile.moddir_rules?view=diff&rev=341073&r1=341072&r2=341073
==============================================================================
--- team/irroot/t38gateway-1.8/Makefile.moddir_rules (original)
+++ team/irroot/t38gateway-1.8/Makefile.moddir_rules Sun Oct 16 11:52:59 2011
@@ -1,6 +1,6 @@
 #
 # Asterisk -- A telephony toolkit for Linux.
-# 
+#
 # Makefile rules for subdirectories containing modules
 #
 # Copyright (C) 2006, Digium, Inc.
@@ -46,7 +46,7 @@
 C_MODS:=$(filter-out $(MENUSELECT_$(MENUSELECT_CATEGORY)),$(ALL_C_MODS))
 CC_MODS:=$(filter-out $(MENUSELECT_$(MENUSELECT_CATEGORY)),$(ALL_CC_MODS))
 
-ifneq ($(findstring $(MENUSELECT_CATEGORY),$(MENUSELECT_EMBED)),)
+ifneq ($(findstring EMBED_$(MENUSELECT_CATEGORY),$(MENUSELECT_EMBED)),)
     EMBEDDED_MODS:=$(C_MODS) $(CC_MODS)
 else
     LOADABLE_MODS:=$(C_MODS) $(CC_MODS)

Modified: team/irroot/t38gateway-1.8/build_tools/embed_modules.xml
URL: http://svnview.digium.com/svn/asterisk/team/irroot/t38gateway-1.8/build_tools/embed_modules.xml?view=diff&rev=341073&r1=341072&r2=341073
==============================================================================
--- team/irroot/t38gateway-1.8/build_tools/embed_modules.xml (original)
+++ team/irroot/t38gateway-1.8/build_tools/embed_modules.xml Sun Oct 16 11:52:59 2011
@@ -1,45 +1,45 @@
 	<category name="MENUSELECT_EMBED" displayname="Module Embedding" positive_output="yes" remove_on_change="main/asterisk">
-		<member name="ADDONS" displayname="Add-ons" remove_on_change="addons/*.o addons/*.oo">
+		<member name="EMBED_ADDONS" displayname="Add-ons" remove_on_change="addons/*.o addons/*.oo">
 			<depend>gnu_ld</depend>
 			<support_level>extended</support_level>
 		</member>
-		<member name="APPS" displayname="Applications" remove_on_change="apps/*.o apps/*.oo">
+		<member name="EMBED_APPS" displayname="Applications" remove_on_change="apps/*.o apps/*.oo">
 			<depend>gnu_ld</depend>
 			<support_level>extended</support_level>
 		</member>
-		<member name="BRIDGES" displayname="Bridging Technologies" remove_on_change="bridges/*.o bridges/*.oo">
+		<member name="EMBED_BRIDGES" displayname="Bridging Technologies" remove_on_change="bridges/*.o bridges/*.oo">
 			<depend>gnu_ld</depend>
 			<support_level>extended</support_level>
 		</member>
-		<member name="CDR" displayname="Call Detail Recording" remove_on_change="cdr/*.o cdr/*.oo">
+		<member name="EMBED_CDR" displayname="Call Detail Recording" remove_on_change="cdr/*.o cdr/*.oo">
 			<depend>gnu_ld</depend>
 			<support_level>extended</support_level>
 		</member>
-		<member name="CHANNELS" displayname="Channels" remove_on_change="channels/*.o channels/*/*.o channels/*.oo channels/*/*.oo">
+		<member name="EMBED_CHANNELS" displayname="Channels" remove_on_change="channels/*.o channels/*/*.o channels/*.oo channels/*/*.oo">
 			<depend>gnu_ld</depend>
 			<support_level>extended</support_level>
 		</member>
-		<member name="CODECS" displayname="Coders/Decoders" remove_on_change="codecs/*.o codecs/*/*.o codecs/*/*/*.o codecs/*/*.a codecs/*/*/*.a codecs/*.oo codecs/*/*.oo">
+		<member name="EMBED_CODECS" displayname="Coders/Decoders" remove_on_change="codecs/*.o codecs/*/*.o codecs/*/*/*.o codecs/*/*.a codecs/*/*/*.a codecs/*.oo codecs/*/*.oo">
 			<depend>gnu_ld</depend>
 			<support_level>extended</support_level>
 		</member>
-		<member name="FORMATS" displayname="File Formats" remove_on_change="formats/*.o formats/*.oo">
+		<member name="EMBED_FORMATS" displayname="File Formats" remove_on_change="formats/*.o formats/*.oo">
 			<depend>gnu_ld</depend>
 			<support_level>extended</support_level>
 		</member>
-		<member name="FUNCS" displayname="Dialplan Functions" remove_on_change="funcs/*.o funcs/*.oo">
+		<member name="EMBED_FUNCS" displayname="Dialplan Functions" remove_on_change="funcs/*.o funcs/*.oo">
 			<depend>gnu_ld</depend>
 			<support_level>extended</support_level>
 		</member>
-		<member name="PBX" displayname="PBX Functionality" remove_on_change="pbx/*.o pbx/*/*.o pbx/*.oo pbx/*/*.oo">
+		<member name="EMBED_PBX" displayname="PBX Functionality" remove_on_change="pbx/*.o pbx/*/*.o pbx/*.oo pbx/*/*.oo">
 			<depend>gnu_ld</depend>
 			<support_level>extended</support_level>
 		</member>
-		<member name="RES" displayname="Resource Modules" remove_on_change="res/*.o res/*/*.o res/*.oo res/*/*.oo">
+		<member name="EMBED_RES" displayname="Resource Modules" remove_on_change="res/*.o res/*/*.o res/*.oo res/*/*.oo">
 			<depend>gnu_ld</depend>
 			<support_level>extended</support_level>
 		</member>
-		<member name="TEST" displayname="Test Modules" remove_on_change="tests/*.o tests/*.oo">
+		<member name="EMBED_TEST" displayname="Test Modules" remove_on_change="tests/*.o tests/*.oo">
 			<depend>gnu_ld</depend>
 			<support_level>extended</support_level>
 		</member>

Modified: team/irroot/t38gateway-1.8/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/t38gateway-1.8/channels/chan_sip.c?view=diff&rev=341073&r1=341072&r2=341073
==============================================================================
--- team/irroot/t38gateway-1.8/channels/chan_sip.c (original)
+++ team/irroot/t38gateway-1.8/channels/chan_sip.c Sun Oct 16 11:52:59 2011
@@ -8932,6 +8932,9 @@
 			}
 
 			ast_rtp_codecs_payloads_copy(&newaudiortp, ast_rtp_instance_get_codecs(p->rtp), p->rtp);
+			/* Ensure RTCP is enabled since it may be inactive
+			   if we're coming back from a T.38 session */
+			ast_rtp_instance_set_prop(p->rtp, AST_RTP_PROPERTY_RTCP, 1);
 
 			if (ast_test_flag(&p->flags[0], SIP_DTMF) == SIP_DTMF_AUTO) {
 				ast_clear_flag(&p->flags[0], SIP_DTMF);
@@ -8948,6 +8951,8 @@
 		} else if (udptlportno > 0) {
 			if (debug)
 				ast_verbose("Got T.38 Re-invite without audio. Keeping RTP active during T.38 session.\n");
+			/* Silence RTCP while audio RTP is inactive */
+			ast_rtp_instance_set_prop(p->rtp, AST_RTP_PROPERTY_RTCP, 0);
 		} else {
 			ast_rtp_instance_stop(p->rtp);
 			if (debug)

Modified: team/irroot/t38gateway-1.8/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/t38gateway-1.8/res/res_rtp_asterisk.c?view=diff&rev=341073&r1=341072&r2=341073
==============================================================================
--- team/irroot/t38gateway-1.8/res/res_rtp_asterisk.c (original)
+++ team/irroot/t38gateway-1.8/res/res_rtp_asterisk.c Sun Oct 16 11:52:59 2011
@@ -2381,44 +2381,65 @@
 	struct ast_rtp *rtp = ast_rtp_instance_get_data(instance);
 
 	if (property == AST_RTP_PROPERTY_RTCP) {
-		if (rtp->rtcp) {
-			ast_debug(1, "Ignoring duplicate RTCP property on RTP instance '%p'\n", instance);
+		if (value) {
+			if (rtp->rtcp) {
+				ast_debug(1, "Ignoring duplicate RTCP property on RTP instance '%p'\n", instance);
+				return;
+			}
+			/* Setup RTCP to be activated on the next RTP write */
+			if (!(rtp->rtcp = ast_calloc(1, sizeof(*rtp->rtcp)))) {
+				return;
+			}
+
+			/* Grab the IP address and port we are going to use */
+			ast_rtp_instance_get_local_address(instance, &rtp->rtcp->us);
+			ast_sockaddr_set_port(&rtp->rtcp->us,
+					      ast_sockaddr_port(&rtp->rtcp->us) + 1);
+
+			if ((rtp->rtcp->s =
+			     create_new_socket("RTCP",
+					       ast_sockaddr_is_ipv4(&rtp->rtcp->us) ?
+					       AF_INET :
+					       ast_sockaddr_is_ipv6(&rtp->rtcp->us) ?
+					       AF_INET6 : -1)) < 0) {
+				ast_debug(1, "Failed to create a new socket for RTCP on instance '%p'\n", instance);
+				ast_free(rtp->rtcp);
+				rtp->rtcp = NULL;
+				return;
+			}
+
+			/* Try to actually bind to the IP address and port we are going to use for RTCP, if this fails we have to bail out */
+			if (ast_bind(rtp->rtcp->s, &rtp->rtcp->us)) {
+				ast_debug(1, "Failed to setup RTCP on RTP instance '%p'\n", instance);
+				close(rtp->rtcp->s);
+				ast_free(rtp->rtcp);
+				rtp->rtcp = NULL;
+				return;
+			}
+
+			ast_debug(1, "Setup RTCP on RTP instance '%p'\n", instance);
+			rtp->rtcp->schedid = -1;
+
 			return;
-		}
-		if (!(rtp->rtcp = ast_calloc(1, sizeof(*rtp->rtcp)))) {
+		} else {
+			if (rtp->rtcp) {
+				if (rtp->rtcp->schedid > 0) {
+					if (!ast_sched_del(rtp->sched, rtp->rtcp->schedid)) {
+						/* Successfully cancelled scheduler entry. */
+						ao2_ref(instance, -1);
+					} else {
+						/* Unable to cancel scheduler entry */
+						ast_debug(1, "Failed to tear down RTCP on RTP instance '%p'\n", instance);
+						return;
+					}
+					rtp->rtcp->schedid = -1;
+				}
+				close(rtp->rtcp->s);
+				ast_free(rtp->rtcp);
+				rtp->rtcp = NULL;
+			}
 			return;
 		}
-
-		/* Grab the IP address and port we are going to use */
-		ast_rtp_instance_get_local_address(instance, &rtp->rtcp->us);
-		ast_sockaddr_set_port(&rtp->rtcp->us,
-				      ast_sockaddr_port(&rtp->rtcp->us) + 1);
-
-		if ((rtp->rtcp->s =
-		     create_new_socket("RTCP",
-				       ast_sockaddr_is_ipv4(&rtp->rtcp->us) ?
-				       AF_INET :
-				       ast_sockaddr_is_ipv6(&rtp->rtcp->us) ?
-				       AF_INET6 : -1)) < 0) {
-			ast_debug(1, "Failed to create a new socket for RTCP on instance '%p'\n", instance);
-			ast_free(rtp->rtcp);
-			rtp->rtcp = NULL;
-			return;
-		}
-
-		/* Try to actually bind to the IP address and port we are going to use for RTCP, if this fails we have to bail out */
-		if (ast_bind(rtp->rtcp->s, &rtp->rtcp->us)) {
-			ast_debug(1, "Failed to setup RTCP on RTP instance '%p'\n", instance);
-			close(rtp->rtcp->s);
-			ast_free(rtp->rtcp);
-			rtp->rtcp = NULL;
-			return;
-		}
-
-		ast_debug(1, "Setup RTCP on RTP instance '%p'\n", instance);
-		rtp->rtcp->schedid = -1;
-
-		return;
 	}
 
 	return;




More information about the asterisk-commits mailing list