[svn-commits] dvossel: trunk r246420 - /trunk/channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Feb 12 11:59:43 CST 2010


Author: dvossel
Date: Fri Feb 12 11:59:39 2010
New Revision: 246420

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=246420
Log:
fixes areas where port should be removed from domain during parsing

A patch was committed recently that converted duplicate uri parsing
code to use the parse_uri function.  There were two instances where
this conversion did not mimic previous behavior exactly because the
port was not being parsed off the end of the domain. In order to do
this, a dummy pointer argument needs to be passed into parse_uri so
it will know it must parse out the port from the domain.  If a port
output paramenter is not present,   the domain is returned with the
port still attached.


Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=246420&r1=246419&r2=246420
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Fri Feb 12 11:59:39 2010
@@ -11904,7 +11904,7 @@
 	enum check_auth_result res = AUTH_NOT_FOUND;
 	struct sip_peer *peer;
 	char tmp[256];
-	char *name = NULL, *c, *domain = NULL;
+	char *name = NULL, *c, *domain = NULL, *dummy = NULL;
 	char *uri2 = ast_strdupa(uri);
 
 	terminate_uri(uri2);
@@ -11914,7 +11914,7 @@
 	c = get_in_brackets(tmp);
 	c = remove_uri_parameters(c);
 
-	if (parse_uri(c, "sip:,sips:", &name, NULL, &domain, NULL, NULL)) {
+	if (parse_uri(c, "sip:,sips:", &name, &dummy, &domain, &dummy, NULL)) {
 		ast_log(LOG_NOTICE, "Invalid to address: '%s' from %s (missing sip:) trying to use anyway...\n", c, ast_inet_ntoa(sin->sin_addr));
 		return -1;
 	}
@@ -12407,7 +12407,7 @@
 */
 static int get_destination(struct sip_pvt *p, struct sip_request *oreq)
 {
-	char tmp[256] = "", *uri, *domain;
+	char tmp[256] = "", *uri, *domain, *dummy = NULL;
 	char tmpf[256] = "", *from = NULL;
 	struct sip_request *req;
 	char *decoded_uri;
@@ -12422,7 +12422,7 @@
 	
 	uri = get_in_brackets(tmp);
 
-	if (parse_uri(uri, "sip:,sips:", &uri, NULL, &domain, NULL, NULL)) {
+	if (parse_uri(uri, "sip:,sips:", &uri, &dummy, &domain, &dummy, NULL)) {
 		ast_log(LOG_WARNING, "Not a SIP header (%s)?\n", uri);
 		return -1;
 	}




More information about the svn-commits mailing list