[asterisk-commits] file: trunk r58780 - in /trunk: ./ channels/chan_sip.c configs/sip.conf.sample

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun Mar 11 17:54:14 MST 2007


Author: file
Date: Sun Mar 11 19:54:13 2007
New Revision: 58780

URL: http://svn.digium.com/view/asterisk?view=rev&rev=58780
Log:
Merged revisions 58779 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r58779 | file | 2007-03-11 20:51:16 -0400 (Sun, 11 Mar 2007) | 2 lines

Add matchexterniplocally setting which only substitutes your externip/externhost setting if it matches the localnet setting. I know of at least two people who need opposite settings, so I made it an option! (issue #8821 reported by kokoskarokoska)

........

Modified:
    trunk/   (props changed)
    trunk/channels/chan_sip.c
    trunk/configs/sip.conf.sample

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=58780&r1=58779&r2=58780
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Sun Mar 11 19:54:13 2007
@@ -577,6 +577,8 @@
 static int global_autoframing;          /*!< Turn autoframing on or off. */
 static enum transfermodes global_allowtransfer;	/*!< SIP Refer restriction scheme */
 static struct sip_proxy global_outboundproxy;	/*!< Outbound proxy */
+
+static int global_matchexterniplocally; /*!< Match externip/externhost setting against localnet setting */
 
 /*! \brief Codecs that we support by default: */
 static int global_capability = AST_FORMAT_ULAW | AST_FORMAT_ALAW | AST_FORMAT_GSM | AST_FORMAT_H263;
@@ -1935,7 +1937,7 @@
 
 	if (localaddr && externip.sin_addr.s_addr &&
 	    (ast_apply_ha(localaddr, &theirs)) &&
-	    (!ast_apply_ha(localaddr, &ours))) {
+	    (!global_matchexterniplocally || !ast_apply_ha(localaddr, &ours))) {
 		if (externexpire && time(NULL) >= externexpire) {
 			struct ast_hostent ahp;
 			struct hostent *hp;
@@ -16936,6 +16938,8 @@
 	global_callevents = FALSE;
 	global_t1min = DEFAULT_T1MIN;		
 
+	global_matchexterniplocally = FALSE;
+
 	/* Copy the default jb config over global_jbconf */
 	memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf));
 
@@ -17187,6 +17191,8 @@
 			default_maxcallbitrate = atoi(v->value);
 			if (default_maxcallbitrate < 0)
 				default_maxcallbitrate = DEFAULT_MAX_CALL_BITRATE;
+		} else if (!strcasecmp(v->name, "matchexterniplocally")) {
+			global_matchexterniplocally = ast_true(v->value);
 		}
 	}
 

Modified: trunk/configs/sip.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/sip.conf.sample?view=diff&rev=58780&r1=58779&r2=58780
==============================================================================
--- trunk/configs/sip.conf.sample (original)
+++ trunk/configs/sip.conf.sample Sun Mar 11 19:54:13 2007
@@ -148,10 +148,12 @@
 				; for Sipura and Grandstream ATAs, among others). This is
 				; contrary to the RFC3551 specification, the peer _should_
 				; be negotiating AAL2-G726-32 instead :-(
-
 ;outboundproxy=proxy.provider.domain           ; send outbound signaling to this proxy, not directly to the devices
 ;outboundproxy=proxy.provider.domain:8080       ; send outbound signaling to this proxy, not directly to the devices
 ;outboundproxy=proxy.provider.domain,force      ; Send ALL outbound signalling to proxy, ignoring route: headers
+;matchexterniplocally = yes     ; Only substitute the externip or externhost setting if it matches
+                                ; your localnet setting. Unless you have some sort of strange network
+                                ; setup you will not need to enable this.
 
 ;
 ; If regcontext is specified, Asterisk will dynamically create and destroy a



More information about the asterisk-commits mailing list