diff options
author | Jonathan Rose <jrose@digium.com> | 2012-01-04 19:53:49 +0000 |
---|---|---|
committer | Jonathan Rose <jrose@digium.com> | 2012-01-04 19:53:49 +0000 |
commit | dd3f9b51c805d3817981f69860f7b20007ae2b6d (patch) | |
tree | 90027aa5d8973c2073451707448d60bc45fe6e7a /channels | |
parent | 573e1e5dc018b65bb3d2a288d77fcaa0f0e1d1a2 (diff) |
Adds Subscription-State header to notify with call completion. per RFC3265
(Closes issue ASTERISK-17953)
Reported by: George Konopacki
Patches:
19400.patch uploaded by mmichelson (license 5049)
........
Merged revisions 349482 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 349502 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349503 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index ea4e0b9f1..80417ef16 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -12811,6 +12811,7 @@ static int transmit_cc_notify(struct ast_cc_agent *agent, struct sip_pvt *subscr struct sip_cc_agent_pvt *agent_pvt = agent->private_data; char uri[SIPBUFSIZE]; char state_str[64]; + char subscription_state_hdr[64]; if (state < CC_QUEUED || state > CC_READY) { ast_log(LOG_WARNING, "Invalid state provided for transmit_cc_notify (%d)\n", state); @@ -12821,6 +12822,8 @@ static int transmit_cc_notify(struct ast_cc_agent *agent, struct sip_pvt *subscr snprintf(state_str, sizeof(state_str), "%s\r\n", sip_cc_notify_state_map[state].state_string); add_header(&req, "Event", "call-completion"); add_header(&req, "Content-Type", "application/call-completion"); + snprintf(subscription_state_hdr, sizeof(subscription_state_hdr), "active;expires=%d", subscription->expiry); + add_header(&req, "Subscription-State", subscription_state_hdr); if (state == CC_READY) { generate_uri(subscription, agent_pvt->notify_uri, sizeof(agent_pvt->notify_uri)); snprintf(uri, sizeof(uri) - 1, "cc-URI: %s\r\n", agent_pvt->notify_uri); |