From 9d8a5ceb02f6559940bd94aaf163a544ce6e6f4c Mon Sep 17 00:00:00 2001 From: Matthew Jordan Date: Thu, 25 Jul 2013 02:20:23 +0000 Subject: Move after bridge callbacks into their own file One more major refactoring to go. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395367 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_dial.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'apps/app_dial.c') diff --git a/apps/app_dial.c b/apps/app_dial.c index 0a43197b4..6d7c1abb5 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -67,6 +67,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/dial.h" #include "asterisk/stasis_channels.h" #include "asterisk/bridging.h" +#include "asterisk/bridging_after.h" #include "asterisk/features_config.h" /*** DOCUMENTATION @@ -201,7 +202,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") If the call is answered, transfer the calling party to - the specified priority and the called party to the specified + the specified priority and the called party to the specified priority plus one. You cannot use any additional action post answer options in conjunction with this option. @@ -290,7 +291,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Macro arguments - Execute the specified macro for the called channel + Execute the specified macro for the called channel before connecting to the calling channel. Arguments can be specified to the Macro using ^ as a delimiter. The macro can set the variable MACRO_RESULT to specify the following actions after the macro is @@ -332,7 +333,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") With delete set to 1, the introduction will always be deleted. - This option is a modifier for the call screening/privacy mode. (See the + This option is a modifier for the call screening/privacy mode. (See the p and P options.) It specifies that no introductions are to be saved in the priv-callerintros directory. @@ -353,7 +354,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") With mode either not specified or set to 1, the originator hanging up will cause the phone to ring back immediately. - With mode set to 2, when the operator + With mode set to 2, when the operator flashes the trunk, it will ring their phone back. Enables operator services mode. This option only @@ -1071,7 +1072,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, /* If we are calling a single channel, and not providing ringback or music, */ /* then, make them compatible for in-band tone purpose */ if (ast_channel_make_compatible(outgoing->chan, in) < 0) { - /* If these channels can not be made compatible, + /* If these channels can not be made compatible, * there is no point in continuing. The bridge * will just fail if it gets that far. */ @@ -1765,7 +1766,7 @@ static int do_privacy(struct ast_channel *chan, struct ast_channel *peer, /*! \page DialPrivacy Dial Privacy scripts * \par priv-callee-options script: - * \li Dial 1 if you wish this caller to reach you directly in the future, + * \li Dial 1 if you wish this caller to reach you directly in the future, * and immediately connect to their incoming call. * \li Dial 2 if you wish to send this caller to voicemail now and forevermore. * \li Dial 3 to send this caller to the torture menus, now and forevermore. @@ -1891,7 +1892,7 @@ static int setup_privacy_args(struct privacy_args *pa, } else if (ast_test_flag64(opts, OPT_SCREEN_NOCALLERID) && strncmp(pa->privcid, "NOCALLERID", 10) == 0) { ast_verb(3, "CallerID blank; N option set; Screening should happen; dbval is %d\n", pa->privdb_val); } - + if (pa->privdb_val == AST_PRIVACY_DENY) { ast_verb(3, "Privacy DB reports PRIVACY_DENY for this callerid. Dial reports unavailable\n"); ast_copy_string(pa->status, "NOANSWER", sizeof(pa->status)); @@ -2021,14 +2022,14 @@ static void setup_peer_after_bridge_goto(struct ast_channel *chan, struct ast_ch ast_channel_lock(chan); context = ast_strdupa(ast_channel_context(chan)); ast_channel_unlock(chan); - ast_after_bridge_set_h(peer, context); + ast_bridge_set_after_h(peer, context); } else if (ast_test_flag64(opts, OPT_CALLEE_GO_ON)) { ast_channel_lock(chan); context = ast_strdupa(ast_channel_context(chan)); extension = ast_strdupa(ast_channel_exten(chan)); priority = ast_channel_priority(chan); ast_channel_unlock(chan); - ast_after_bridge_set_go_on(peer, context, extension, priority, + ast_bridge_set_after_go_on(peer, context, extension, priority, opt_args[OPT_ARG_CALLEE_GO_ON]); } } @@ -2444,7 +2445,7 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast /* We are on the only destination. */ ast_rtp_instance_early_bridge_make_compatible(tc, chan); } - + /* Inherit specially named variables from parent channel */ ast_channel_inherit_variables(chan, tc); ast_channel_datastore_inherit(chan, tc); @@ -2698,7 +2699,7 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast /* If appropriate, log that we have a destination channel and set the answer time */ if (ast_channel_name(peer)) pbx_builtin_setvar_helper(chan, "DIALEDPEERNAME", ast_channel_name(peer)); - + ast_channel_lock(peer); number = pbx_builtin_getvar_helper(peer, "DIALEDPEERNUMBER"); if (ast_strlen_zero(number)) { @@ -2967,7 +2968,7 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast ast_channel_hangupcause_set(chan, ast_channel_hangupcause(peer)); } setup_peer_after_bridge_goto(chan, peer, &opts, opt_args); - if (ast_after_bridge_goto_setup(peer) + if (ast_bridge_setup_after_goto(peer) || ast_pbx_start(peer)) { ast_autoservice_chan_hangup_peer(chan, peer); } @@ -2997,7 +2998,7 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast config.end_bridge_callback = end_bridge_callback; config.end_bridge_callback_data = chan; config.end_bridge_callback_data_fixup = end_bridge_callback_data_fixup; - + if (moh) { moh = 0; ast_moh_stop(chan); -- cgit v1.2.3