From: Olle Johansson Date: Mon, 3 Apr 2006 20:40:08 +0000 (+0000) Subject: Add tag to NOTIFY headers (imported from 1.2) X-Git-Tag: 1.4.0-beta1~2171 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=878c88f8997f8a794d4cd2c63bc8ea37ffa0c515;p=thirdparty%2Fasterisk.git Add tag to NOTIFY headers (imported from 1.2) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@17151 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index ebb57d1508..76148cedf7 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -5066,12 +5066,16 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, int sipmetho ast_string_field_set(p, uri, invite_buf); - /* If there is a VXML URL append it to the SIP URL */ - if (p->options && p->options->vxml_url) { + 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), ";tag=%s", 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); } else { snprintf(to, sizeof(to), "<%s>", p->uri); } + memset(req, 0, sizeof(struct sip_request)); init_req(req, sipmethod, p->uri); snprintf(tmp, sizeof(tmp), "%d %s", ++p->ocseq, sip_methods[sipmethod].text);