[asterisk-commits] oej: branch group/pine-multiple-externip-1.4 r288922 - /team/group/pine-multi...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Sep 26 11:11:28 CDT 2010


Author: oej
Date: Sun Sep 26 11:11:20 2010
New Revision: 288922

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=288922
Log:
Make sure that Options requests also use extern IP properly.

Modified:
    team/group/pine-multiple-externip-1.4/channels/chan_sip.c

Modified: team/group/pine-multiple-externip-1.4/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pine-multiple-externip-1.4/channels/chan_sip.c?view=diff&rev=288922&r1=288921&r2=288922
==============================================================================
--- team/group/pine-multiple-externip-1.4/channels/chan_sip.c (original)
+++ team/group/pine-multiple-externip-1.4/channels/chan_sip.c Sun Sep 26 11:11:20 2010
@@ -1923,6 +1923,12 @@
 	ast_ouraddrfor(them, us);
 	theirs.sin_addr = *them;
 	ours.sin_addr = *us;
+	if (option_debug > 3) {
+		ast_log(LOG_DEBUG, "Checking ouraddr - externip = %s target address %s , our address %s\n", 
+			ast_inet_ntoa(*(struct in_addr *) &useexternip->sin_addr.s_addr),
+			ast_inet_ntoa(*(struct in_addr *)&them->s_addr),
+			ast_inet_ntoa(*(struct in_addr *)&us->s_addr) );
+	}
 
 
 	if (localaddr && useexternip->sin_addr.s_addr &&
@@ -17549,6 +17555,12 @@
 	else
 		ast_string_field_set(p, tohost, ast_inet_ntoa(peer->addr.sin_addr));
 
+	/* Set extern IP properly for the contact and via headers */
+	if (peer->externip.sin_addr.s_addr) {
+		memcpy(&p->externip.sin_addr, &peer->externip.sin_addr, sizeof(p->sa.sin_addr));
+	} else {
+		memcpy(&p->externip.sin_addr, &externip.sin_addr, sizeof(p->sa.sin_addr));
+	}
 	/* Recalculate our side, and recalculate Call ID */
 	if (ast_sip_ouraddrfor(p, &p->sa.sin_addr, &p->ourip))
 		p->ourip = __ourip;




More information about the asterisk-commits mailing list