[asterisk-commits] branch 1.2 r17147 - /branches/1.2/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Apr 3 13:22:23 MST 2006


Author: oej
Date: Mon Apr  3 15:22:21 2006
New Revision: 17147

URL: http://svn.digium.com/view/asterisk?rev=17147&view=rev
Log:
Issue #6848 take two - Use the tag provided by the SUBSCRIBE request when sending NOTIFY

Modified:
    branches/1.2/channels/chan_sip.c

Modified: branches/1.2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/chan_sip.c?rev=17147&r1=17146&r2=17147&view=diff
==============================================================================
--- branches/1.2/channels/chan_sip.c (original)
+++ branches/1.2/channels/chan_sip.c Mon Apr  3 15:22:21 2006
@@ -4825,12 +4825,16 @@
 
 	ast_copy_string(p->uri, invite_buf, sizeof(p->uri));
 
-	/* 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), "<sip:%s>;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);



More information about the asterisk-commits mailing list