[svn-commits] pabelanger: trunk r422241 - in /trunk: ./ channels/ configs/samples/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Aug 28 11:06:59 CDT 2014


Author: pabelanger
Date: Thu Aug 28 11:06:55 2014
New Revision: 422241

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=422241
Log:
One-line summary

Multi-line description

ASTERISK-24280 #close
Reported by: Paul Belanger
Tested by: Paul Belanger
Review: https://reviewboard.asterisk.org/r/3952/
Patches:
    rtpengine.diff uploaded by Paul Belanger

Modified:
    trunk/CHANGES
    trunk/channels/chan_sip.c
    trunk/configs/samples/sip.conf.sample

Modified: trunk/CHANGES
URL: http://svnview.digium.com/svn/asterisk/trunk/CHANGES?view=diff&rev=422241&r1=422240&r2=422241
==============================================================================
--- trunk/CHANGES (original)
+++ trunk/CHANGES Thu Aug 28 11:06:55 2014
@@ -12,7 +12,14 @@
 --- Functionality changes from Asterisk 13 to Asterisk 14 --------------------
 ------------------------------------------------------------------------------
 
-
+Channel Drivers
+------------------
+
+chan_sip
+------------------
+ * New 'rtpbindaddr' global setting. This allows a user to define which
+   ipaddress to bind the rtpengine too.  For example, chan_sip might bind
+   to eth0 (10.0.0.2) but rtpengine to eth1 (192.168.1.10).
 
 ------------------------------------------------------------------------------
 --- Functionality changes from Asterisk 12 to Asterisk 13 --------------------

Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=422241&r1=422240&r2=422241
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Thu Aug 28 11:06:55 2014
@@ -1076,6 +1076,7 @@
  */
 static struct ast_sockaddr externaddr;      /*!< External IP address if we are behind NAT */
 static struct ast_sockaddr media_address; /*!< External RTP IP address if we are behind NAT */
+static struct ast_sockaddr rtpbindaddr;   /*!< RTP: The address we bind to */
 
 static char externhost[MAXHOSTNAMELEN];   /*!< External host name */
 static time_t externexpire;             /*!< Expiration counter for re-resolving external host name in dynamic DNS */
@@ -5783,7 +5784,12 @@
 		return 0;
 	}
 
-	ast_sockaddr_copy(&bindaddr_tmp, &bindaddr);
+	if (!ast_sockaddr_isnull(&rtpbindaddr)) {
+		ast_sockaddr_copy(&bindaddr_tmp, &rtpbindaddr);
+	} else {
+		ast_sockaddr_copy(&bindaddr_tmp, &bindaddr);
+	}
+
 	if (!(dialog->rtp = ast_rtp_instance_new(dialog->engine, sched, &bindaddr_tmp, NULL))) {
 		return -1;
 	}
@@ -20857,6 +20863,10 @@
 	ast_cli(a->fd, "  TLS SIP Bindaddress:    %s\n",
 		default_tls_cfg.enabled != FALSE ?
 				ast_sockaddr_stringify(&sip_tls_desc.local_address) :
+				"Disabled");
+	ast_cli(a->fd, "  RTP Bindaddress:        %s\n",
+		!ast_sockaddr_isnull(&rtpbindaddr) ?
+				ast_sockaddr_stringify_addr(&rtpbindaddr) :
 				"Disabled");
 	ast_cli(a->fd, "  Videosupport:           %s\n", AST_CLI_YESNO(ast_test_flag(&global_flags[1], SIP_PAGE2_VIDEOSUPPORT)));
 	ast_cli(a->fd, "  Textsupport:            %s\n", AST_CLI_YESNO(ast_test_flag(&global_flags[1], SIP_PAGE2_TEXTSUPPORT)));
@@ -31183,6 +31193,7 @@
 	memset(&localaddr, 0, sizeof(localaddr));
 	memset(&externaddr, 0, sizeof(externaddr));
 	memset(&media_address, 0, sizeof(media_address));
+	memset(&rtpbindaddr, 0, sizeof(rtpbindaddr));
 	memset(&sip_cfg.outboundproxy, 0, sizeof(struct sip_proxy));
 	sip_cfg.outboundproxy.force = FALSE;		/*!< Don't force proxy usage, use route: headers */
 	default_transports = AST_TRANSPORT_UDP;
@@ -31646,6 +31657,10 @@
 		} else if (!strcasecmp(v->name, "media_address")) {
 			if (ast_parse_arg(v->value, PARSE_ADDR, &media_address))
 				ast_log(LOG_WARNING, "Invalid address for media_address keyword: %s\n", v->value);
+		} else if (!strcasecmp(v->name, "rtpbindaddr")) {
+			if (ast_parse_arg(v->value, PARSE_ADDR, &rtpbindaddr)) {
+				ast_log(LOG_WARNING, "Invalid address for rtpbindaddr keyword: %s\n", v->value);
+			}
 		} else if (!strcasecmp(v->name, "externaddr") || !strcasecmp(v->name, "externip")) {
 			if (ast_parse_arg(v->value, PARSE_ADDR, &externaddr)) {
 				ast_log(LOG_WARNING,

Modified: trunk/configs/samples/sip.conf.sample
URL: http://svnview.digium.com/svn/asterisk/trunk/configs/samples/sip.conf.sample?view=diff&rev=422241&r1=422240&r2=422241
==============================================================================
--- trunk/configs/samples/sip.conf.sample (original)
+++ trunk/configs/samples/sip.conf.sample Thu Aug 28 11:06:55 2014
@@ -179,6 +179,9 @@
 
 udpbindaddr=0.0.0.0             ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
                                 ; Optionally add a port number, 192.168.1.1:5062 (default is port 5060)
+
+;rtpbindaddr=172.16.42.1        ; IP address to bind RTP listen sock to (default is disabled). When
+                                ; disabled the udpbindaddr is used.
 
 ; When a dialog is started with another SIP endpoint, the other endpoint
 ; should include an Allow header telling us what SIP methods the endpoint




More information about the svn-commits mailing list