aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-27 23:13:09 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-27 23:13:09 +0000
commit0b3770075d644a86a7b95fdf9e2021d73a553f81 (patch)
treecf83b4a033118cd3fd464f0be96576a10f5a5480
parent38b61b488e5bb60a5755a179ee0ea7ed658ee8f6 (diff)
Add SIPREFERRINGCONTEXT and SIPREFERREDBYHDR variables when a transfer takes place. (issue #8378 reported by jcovert)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@72354 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--CHANGES1
-rw-r--r--channels/chan_sip.c10
2 files changed, 11 insertions, 0 deletions
diff --git a/CHANGES b/CHANGES
index 41cc45c25..a518c842c 100644
--- a/CHANGES
+++ b/CHANGES
@@ -60,6 +60,7 @@ SIP changes
in this file of the "pollmailboxes" and "pollfreq" options to voicemail.conf
for more information.
* Added rtpdest option to CHANNEL() dialplan function.
+ * Added SIPREFERRINGCONTEXT and SIPREFERREDBYHDR variables which are set when a transfer takes place.
IAX2 changes
------------
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 37d7f3010..52368427a 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -9340,6 +9340,16 @@ static int get_refer_info(struct sip_pvt *transferer, struct sip_request *outgoi
/* Get referred by header if it exists */
p_referred_by = get_header(req, "Referred-By");
+
+ /* Give useful transfer information to the dialplan */
+ if (transferer->owner) {
+ struct ast_channel *peer = ast_bridged_channel(transferer->owner);
+ if (peer) {
+ pbx_builtin_setvar_helper(peer, "SIPREFERRINGCONTEXT", transferer->context);
+ pbx_builtin_setvar_helper(peer, "SIPREFERREDBYHDR", p_referred_by);
+ }
+ }
+
if (!ast_strlen_zero(p_referred_by)) {
char *lessthan;
h_referred_by = ast_strdupa(p_referred_by);