[asterisk-commits] file: branch file/issue8855 r194428 - /team/file/issue8855/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 14 08:41:42 CDT 2009


Author: file
Date: Thu May 14 08:41:37 2009
New Revision: 194428

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=194428
Log:
If rport is not present or not forced send packets back using the source IP address and the port specified in the Via header.

Modified:
    team/file/issue8855/channels/chan_sip.c

Modified: team/file/issue8855/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/file/issue8855/channels/chan_sip.c?view=diff&rev=194428&r1=194427&r2=194428
==============================================================================
--- team/file/issue8855/channels/chan_sip.c (original)
+++ team/file/issue8855/channels/chan_sip.c Thu May 14 08:41:37 2009
@@ -13306,8 +13306,6 @@
 {
 	char via[512];
 	char *c, *pt;
-	struct hostent *hp;
-	struct ast_hostent ahp;
 
 	ast_copy_string(via, get_header(req, "Via"), sizeof(via));
 
@@ -13336,14 +13334,7 @@
 		pt = strchr(c, ':');
 		if (pt)
 			*pt++ = '\0';	/* remember port pointer */
-		hp = ast_gethostbyname(c, &ahp);
-		if (!hp) {
-			ast_log(LOG_WARNING, "'%s' is not a valid host\n", c);
-			return;
-		}
-		memset(&p->sa, 0, sizeof(p->sa));
-		p->sa.sin_family = AF_INET;
-		memcpy(&p->sa.sin_addr, hp->h_addr, sizeof(p->sa.sin_addr));
+		p->sa = p->recv;
 		p->sa.sin_port = htons(pt ? atoi(pt) : STANDARD_SIP_PORT);
 
 		if (sip_debug_test_pvt(p)) {




More information about the asterisk-commits mailing list