aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2007-05-16 09:57:22 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2007-05-16 09:57:22 +0000
commit9b96708dbca9a5054d9ced85446e58e39841e1b0 (patch)
treed20ef71142242e847aec370ea832835b4632af14 /channels/chan_sip.c
parent9001c536a0063b2578b45bb4d6775c63044aa592 (diff)
Issue #9439 - properly handle username parameters in SIP uri.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@64565 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index bc5dd4f8c..788a16587 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -7745,7 +7745,6 @@ static int set_address_from_contact(struct sip_pvt *pvt)
/* Work on a copy */
contact = ast_strdupa(pvt->fullcontact);
- /* XXX this code is repeated all over */
/* Make sure it's a SIP URL */
if (strncasecmp(contact, "sip:", 4)) {
ast_log(LOG_NOTICE, "'%s' is not a valid SIP contact (missing sip:) trying to use anyway\n", contact);
@@ -7754,7 +7753,6 @@ static int set_address_from_contact(struct sip_pvt *pvt)
/* Ditch arguments */
/* XXX this code is replicated also shortly below */
- contact = strsep(&contact, ";"); /* trim ; and beyond */
/* Grab host */
host = strchr(contact, '@');
@@ -7771,6 +7769,9 @@ static int set_address_from_contact(struct sip_pvt *pvt)
} else
port = STANDARD_SIP_PORT;
+ contact = strsep(&contact, ";"); /* trim ; and beyond in username part */
+ host = strsep(&host, ";"); /* trim ; and beyond in host/domain part */
+
/* XXX This could block for a long time XXX */
/* We should only do this if it's a name, not an IP */
hp = ast_gethostbyname(host, &ahp);