]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Do not add a sip: to the beginning of the To URI unless needed.
authorJoshua Colp <jcolp@digium.com>
Thu, 8 Nov 2007 02:26:48 +0000 (02:26 +0000)
committerJoshua Colp <jcolp@digium.com>
Thu, 8 Nov 2007 02:26:48 +0000 (02:26 +0000)
(closes issue #10756)
Reported by: goestelecom

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89101 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 84cbdfc26e08bf9748cc01c61a3784ad43cdbf7f..49caddf99db8306594afc4c8252cedfa818704a4 100644 (file)
@@ -6891,7 +6891,7 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, int sipmetho
 
        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), "<sip:%s>;tag=%s", 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);