aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c10
1 files changed, 10 insertions, 0 deletions
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);