From: David Vossel Date: Wed, 21 Apr 2010 18:13:36 +0000 (+0000) Subject: fixes issue with double "sip:" in header field X-Git-Tag: 1.8.0-beta1~597 X-Git-Url: http://git.asterisk.org/gitweb/?p=asterisk%2Fasterisk.git;a=commitdiff_plain;h=f2b8561a5af1088ba09d386afb789368771bb737;hp=f905bb1c0fe552aaa1628e1043e8810d2c6a07a8 fixes issue with double "sip:" in header field This is a clear mistake in logic. Future discussions about how to avoid having to handle uri's like this should take place in the future, but this fix needs to go in for now. (closes issue #15847) Reported by: ebroad Patches: doublesip.patch uploaded by ebroad (license 878) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@258305 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index a59d542..a145d0d 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -10518,7 +10518,7 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, int sipmetho } else { if (sipmethod == SIP_NOTIFY && !ast_strlen_zero(p->theirtag)) { /* If this is a NOTIFY, use the From: tag in the subscribe (RFC 3265) */ - snprintf(to, sizeof(to), "<%s%s>;tag=%s", (!strncasecmp(p->uri, "sip:", 4) ? "sip:" : ""), p->uri, p->theirtag); + snprintf(to, sizeof(to), "<%s%s>;tag=%s", (strncasecmp(p->uri, "sip:", 4) ? "sip:" : ""), p->uri, p->theirtag); } else if (p->options && p->options->vxml_url) { /* If there is a VXML URL append it to the SIP URL */ snprintf(to, sizeof(to), "<%s>;%s", p->uri, p->options->vxml_url);