[asterisk-commits] file: branch 1.4 r58779 - in /branches/1.4: channels/ configs/

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


Author: file
Date: Sun Mar 11 19:51:16 2007
New Revision: 58779

URL: http://svn.digium.com/view/asterisk?view=rev&rev=58779
Log:
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:
    branches/1.4/channels/chan_sip.c
    branches/1.4/configs/sip.conf.sample

Modified: branches/1.4/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_sip.c?view=diff&rev=58779&r1=58778&r2=58779
==============================================================================
--- branches/1.4/channels/chan_sip.c (original)
+++ branches/1.4/channels/chan_sip.c Sun Mar 11 19:51:16 2007
@@ -556,6 +556,8 @@
 static int global_t1min;		/*!< T1 roundtrip time minimum */
 static int global_autoframing;          /*!< Turn autoframing on or off. */
 static enum transfermodes global_allowtransfer;	/*!< SIP Refer restriction scheme */
+
+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;
@@ -1781,7 +1783,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;
@@ -16203,6 +16205,8 @@
 	global_relaxdtmf = FALSE;
 	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));
@@ -16443,6 +16447,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: branches/1.4/configs/sip.conf.sample
URL: http://svn.digium.com/view/asterisk/branches/1.4/configs/sip.conf.sample?view=diff&rev=58779&r1=58778&r2=58779
==============================================================================
--- branches/1.4/configs/sip.conf.sample (original)
+++ branches/1.4/configs/sip.conf.sample Sun Mar 11 19:51:16 2007
@@ -135,6 +135,10 @@
 				; for Sipura and Grandstream ATAs, among others). This is
 				; contrary to the RFC3551 specification, the peer _should_
 				; be negotiating AAL2-G726-32 instead :-(
+
+;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