aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-03 21:04:38 +0000
committerroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-03 21:04:38 +0000
commitb7e3cf7d13df7493d5051135a917cbd8eeba1e07 (patch)
tree0ac9784f207209d7381c40587db3c40fccddf1fd /channels/chan_sip.c
parentf82e2d94cba23eb6d1ed37e6a03289d60c555e76 (diff)
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@17177 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index fb557072c..8b826f195 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -4912,12 +4912,16 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, int sipmetho
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);