[asterisk-commits] simon.perreault: branch group/v6 r84776 - /team/group/v6/trunk/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Oct 5 07:29:16 CDT 2007


Author: simon.perreault
Date: Fri Oct  5 07:29:16 2007
New Revision: 84776

URL: http://svn.digium.com/view/asterisk?view=rev&rev=84776
Log:
The IPv4 version of this code was simply removed when doing the IPv6 port and not replaced
by an IPv6-enabled version. It is necessary for nat=yes to work.

Modified:
    team/group/v6/trunk/channels/chan_sip.c

Modified: team/group/v6/trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/group/v6/trunk/channels/chan_sip.c?view=diff&rev=84776&r1=84775&r2=84776
==============================================================================
--- team/group/v6/trunk/channels/chan_sip.c (original)
+++ team/group/v6/trunk/channels/chan_sip.c Fri Oct  5 07:29:16 2007
@@ -3358,6 +3358,22 @@
 	if(!peer)
 		return -1;
 
+	if ((peer->addr_len || peer->defaddr_len) &&
+			(!peer->maxms || ((peer->lastms >= 0)
+					  && (peer->lastms <= peer->maxms)))) {
+		if (peer->addr_len) {
+			memcpy(&dialog->sa, &peer->addr, peer->addr_len);
+			dialog->sa_len = peer->addr_len;
+		}
+		else {
+			memcpy(&dialog->sa, &peer->defaddr, peer->defaddr_len);
+			dialog->sa_len = peer->defaddr_len;
+		}
+		memcpy(&dialog->recv, &dialog->sa, dialog->sa_len);
+		dialog->recv_len = dialog->sa_len;
+	} else
+		return -1;
+
 	ast_copy_flags(&dialog->flags[0], &peer->flags[0], SIP_FLAGS_TO_COPY);
 	ast_copy_flags(&dialog->flags[1], &peer->flags[1], SIP_PAGE2_FLAGS_TO_COPY);
 	dialog->capability = peer->capability;
@@ -5225,7 +5241,7 @@
  * Returns a reference to the sip_pvt object, remember to give it back once done.
  *     Called by handle_incoming(), sipsock_read
  */
-static struct sip_pvt *find_call(struct sip_request *req, struct sockaddr *sa,
+struct sip_pvt *find_call(struct sip_request *req, struct sockaddr *sa,
 		socklen_t sa_len, struct ast_vinetsock *ns,
 		const int intended_method)
 {




More information about the asterisk-commits mailing list