[asterisk-commits] jrose: trunk r422697 - in /trunk: ./ include/asterisk/dial.h main/dial.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Sep 5 15:22:14 CDT 2014


Author: jrose
Date: Fri Sep  5 15:22:12 2014
New Revision: 422697

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=422697
Log:
Dial API: Add a dial option to indicate the dialed channel will replace dialer

Adds an option to the dial API that marks an outgoing dial as replacing the dialing channel for the purpose of propagating accountcode. When it is used, AST_CHANNEL_REQUESTOR_REPLACEMENT is used instead of AST_CHANNEL_REQUESTOR_BRIDGE_PEER when setting accountcodes on the involved channels with ast_channel_req_accountcodes.

Review: https://reviewboard.asterisk.org/r/3968/
........

Merged revisions 422684 from http://svn.asterisk.org/svn/asterisk/branches/13

Modified:
    trunk/   (props changed)
    trunk/include/asterisk/dial.h
    trunk/main/dial.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-13-merged' - no diff available.

Modified: trunk/include/asterisk/dial.h
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/dial.h?view=diff&rev=422697&r1=422696&r2=422697
==============================================================================
--- trunk/include/asterisk/dial.h (original)
+++ trunk/include/asterisk/dial.h Fri Sep  5 15:22:12 2014
@@ -45,6 +45,7 @@
 	AST_DIAL_OPTION_MUSIC,                   /*!< Play music on hold instead of ringing to the calling channel */
 	AST_DIAL_OPTION_DISABLE_CALL_FORWARDING, /*!< Disable call forwarding on channels */
 	AST_DIAL_OPTION_PREDIAL,                 /*!< Execute a predial subroutine before dialing */
+	AST_DIAL_OPTION_DIAL_REPLACES_SELF,      /*!< The dial operation is a replacement for the requester */
 	AST_DIAL_OPTION_MAX,                     /*!< End terminator -- must always remain last */
 };
 

Modified: trunk/main/dial.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/dial.c?view=diff&rev=422697&r1=422696&r2=422697
==============================================================================
--- trunk/main/dial.c (original)
+++ trunk/main/dial.c Fri Sep  5 15:22:12 2014
@@ -205,6 +205,7 @@
 	{ AST_DIAL_OPTION_MUSIC, music_enable, music_disable },                   /*!< Play music to the caller instead of ringing */
 	{ AST_DIAL_OPTION_DISABLE_CALL_FORWARDING, NULL, NULL },                  /*!< Disable call forwarding on channels */
 	{ AST_DIAL_OPTION_PREDIAL, predial_enable, predial_disable },             /*!< Execute a subroutine on the outbound channels prior to dialing */
+	{ AST_DIAL_OPTION_DIAL_REPLACES_SELF, NULL, NULL },                       /*!< The dial operation is a replacement for the requester */
 	{ AST_DIAL_OPTION_MAX, NULL, NULL },                                      /*!< Terminator of list */
 };
 
@@ -344,7 +345,11 @@
 		ast_connected_line_copy_from_caller(ast_channel_connected(channel->owner), ast_channel_caller(chan));
 
 		ast_channel_language_set(channel->owner, ast_channel_language(chan));
-		ast_channel_req_accountcodes(channel->owner, chan, AST_CHANNEL_REQUESTOR_BRIDGE_PEER);
+		if (channel->options[AST_DIAL_OPTION_DIAL_REPLACES_SELF]) {
+			ast_channel_req_accountcodes(channel->owner, chan, AST_CHANNEL_REQUESTOR_REPLACEMENT);
+		} else {
+			ast_channel_req_accountcodes(channel->owner, chan, AST_CHANNEL_REQUESTOR_BRIDGE_PEER);
+		}
 		if (ast_strlen_zero(ast_channel_musicclass(channel->owner)))
 			ast_channel_musicclass_set(channel->owner, ast_channel_musicclass(chan));
 




More information about the asterisk-commits mailing list