[asterisk-commits] mmichelson: trunk r151420 - /trunk/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Oct 21 18:08:57 CDT 2008


Author: mmichelson
Date: Tue Oct 21 18:08:56 2008
New Revision: 151420

URL: http://svn.digium.com/view/asterisk?view=rev&rev=151420
Log:
When attempting to resolve hostnames, we need to be sure
to remove any parameters from the string so that name
resolution succeeds.

(closes issue #13727)
Reported by: fnordian
Patches:
      resolvewithouturiparameter.patch uploaded by fnordian (license 110)


Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=151420&r1=151419&r2=151420
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Tue Oct 21 18:08:56 2008
@@ -21927,9 +21927,17 @@
 
 	if (srvlookup && peer->dnsmgr == NULL) {
 		char transport[MAXHOSTNAMELEN];
+		char _srvlookup[MAXHOSTNAMELEN];
+		char *params;
+
+		ast_copy_string(_srvlookup, srvlookup, sizeof(_srvlookup));
+		if (params = strchr(_srvlookup, ';')) {
+			*params++ = '\0';
+		}
+		
 		snprintf(transport, sizeof(transport), "_sip._%s", get_transport(peer->socket.type));
 
-		if (ast_dnsmgr_lookup(srvlookup, &peer->addr, &peer->dnsmgr, global_srvlookup ? transport : NULL)) {
+		if (ast_dnsmgr_lookup(_srvlookup, &peer->addr, &peer->dnsmgr, global_srvlookup ? transport : NULL)) {
 			unref_peer(peer, "getting rid of a peer pointer");
 			return NULL;
 		}




More information about the asterisk-commits mailing list