[asterisk-commits] file: trunk r72354 - in /trunk: CHANGES channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 27 18:13:10 CDT 2007


Author: file
Date: Wed Jun 27 18:13:09 2007
New Revision: 72354

URL: http://svn.digium.com/view/asterisk?view=rev&rev=72354
Log:
Add SIPREFERRINGCONTEXT and SIPREFERREDBYHDR variables when a transfer takes place. (issue #8378 reported by jcovert)

Modified:
    trunk/CHANGES
    trunk/channels/chan_sip.c

Modified: trunk/CHANGES
URL: http://svn.digium.com/view/asterisk/trunk/CHANGES?view=diff&rev=72354&r1=72353&r2=72354
==============================================================================
--- trunk/CHANGES (original)
+++ trunk/CHANGES Wed Jun 27 18:13:09 2007
@@ -60,6 +60,7 @@
      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
 ------------

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=72354&r1=72353&r2=72354
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Wed Jun 27 18:13:09 2007
@@ -9340,6 +9340,16 @@
 
 	/* 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);




More information about the asterisk-commits mailing list