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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 28 06:35:36 CDT 2010


Author: oej
Date: Tue Sep 28 06:35:29 2010
New Revision: 289088

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=289088
Log:
Make sure we handle incoming requests properly. After peer matching, we need to
recalculate our number again - it's only done when we allocate the sip dialog.

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=289088&r1=289087&r2=289088
==============================================================================
--- team/group/pine-multiple-externip-1.4/channels/chan_sip.c (original)
+++ team/group/pine-multiple-externip-1.4/channels/chan_sip.c Tue Sep 28 06:35:29 2010
@@ -10682,6 +10682,16 @@
 				p->jointnoncodeccapability = p->noncodeccapability;
 				if (p->t38.peercapability)
 					p->t38.jointcapability &= p->t38.peercapability;
+				/* 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));
+					/* If the peer had an externip setting, recalculate our side, and recalculate Call ID */
+					if (ast_sip_ouraddrfor(p, &p->sa.sin_addr, &p->ourip)) {
+						p->ourip = __ourip;
+					}
+				} else {
+					memcpy(&p->externip.sin_addr, &externip.sin_addr, sizeof(p->sa.sin_addr));
+				}
 			}
 			ASTOBJ_UNREF(peer, sip_destroy_peer);
 		} else { 




More information about the asterisk-commits mailing list