summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2014-05-02 16:39:58 +0000
committerRichard Mudgett <rmudgett@digium.com>2014-05-02 16:39:58 +0000
commit119599407b95f96c15535d1c86e88b840c933ee7 (patch)
tree08712380fd4e6f1b73f92923bbb60cb639423a86 /channels/chan_sip.c
parent57372e61d23543c70158ba8a0fec40e4848ee44e (diff)
res_pjsip_refer: Add Referred-By header on INVITE for blind transfers.
Per rfc3892, the Referred-By header in a REFER must be copied into the referenced request (IE. The outgoing INVITE to the transfer target). * Automatically put the Referred-By header in the outgoing INVITE message if the SIPREFERREDBYHDR channel variable is defined with a value. * Made chan_sip.c:get_refer_info() set SIPREFERREDBYHDR for inheritance so chan_pjsip has a better chance to interoperate. * Fixed refer_blind_callback() and refer_incoming_refer_request() to not modify the data in the pointer returned by pjsip_msg_find_hdr_by_name(). It seems wrong to modify that data since the calling routine doesn't own the buffer. ASTERISK-23501 #close Reported by: John Bigelow Review: https://reviewboard.asterisk.org/r/3514/ ........ Merged revisions 413210 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413211 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 2ff1c5010..1f9453cb4 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -18008,8 +18008,10 @@ static int get_refer_info(struct sip_pvt *transferer, struct sip_request *outgoi
peer = ast_channel_bridge_peer(owner_ref);
if (peer) {
- pbx_builtin_setvar_helper(peer, "SIPREFERRINGCONTEXT", transferer->context);
- pbx_builtin_setvar_helper(peer, "SIPREFERREDBYHDR", p_referred_by);
+ pbx_builtin_setvar_helper(peer, "SIPREFERRINGCONTEXT",
+ S_OR(transferer->context, NULL));
+ pbx_builtin_setvar_helper(peer, "__SIPREFERREDBYHDR",
+ S_OR(p_referred_by, NULL));
ast_channel_unlock(peer);
}