Add SIPREFERRINGCONTEXT and SIPREFERREDBYHDR variables when a transfer takes place...
authorJoshua Colp <jcolp@digium.com>
Wed, 27 Jun 2007 23:13:09 +0000 (23:13 +0000)
committerJoshua Colp <jcolp@digium.com>
Wed, 27 Jun 2007 23:13:09 +0000 (23:13 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@72354 65c4cc65-6c06-0410-ace0-fbb531ad65f3

CHANGES
channels/chan_sip.c

diff --git a/CHANGES b/CHANGES
index 41cc45c..a518c84 100644 (file)
--- 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
 ------------
index 37d7f30..5236842 100644 (file)
@@ -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);