summaryrefslogtreecommitdiff
path: root/apps/app_dial.c
diff options
context:
space:
mode:
authorJeff Peeler <jpeeler@digium.com>2009-04-09 19:10:02 +0000
committerJeff Peeler <jpeeler@digium.com>2009-04-09 19:10:02 +0000
commitde4af72f9f3bb2a8697c18345239a777bcbc40ca (patch)
treed684b69b0997c7e491afd637549e46f117868989 /apps/app_dial.c
parente53bd994d0e5819d77713d0bc0ce66efee2d0435 (diff)
Add ability for dialplan execution to continue when caller hangs up.
The F option to app_dial has been modified to accept no parameters and perform the above functionality. I don't see anywhere else that is doing function overloading, but this really is the best place for this operation because: - It makes it close to the 'g' option in the argument list which provides similar functionality. - The existing code to support the current F option provides a very convienient location to add this new feature. (closes issue #12381) Reported by: michael-fig git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187491 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_dial.c')
-rw-r--r--apps/app_dial.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index f2cea75d2..8a2e152d6 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -133,6 +133,10 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
<para>When the caller hangs up, transfer the called party
to the specified destination and continue execution at that location.</para>
</option>
+ <option name="F">
+ <para>Proceed with dialplan execution at the next priority in the current extension if the
+ source channel hangs up.</para>
+ </option>
<option name="g">
<para>Proceed with dialplan execution at the next priority in the current extension if the
destination channel hangs up.</para>
@@ -2332,9 +2336,18 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
}
ast_set2_flag(peer, autoloopflag, AST_FLAG_IN_AUTOLOOP); /* set it back the way it was */
}
- if (!ast_check_hangup(peer) && ast_test_flag64(&opts, OPT_CALLEE_GO_ON) && !ast_strlen_zero(opt_args[OPT_ARG_CALLEE_GO_ON])) {
- replace_macro_delimiter(opt_args[OPT_ARG_CALLEE_GO_ON]);
- ast_parseable_goto(peer, opt_args[OPT_ARG_CALLEE_GO_ON]);
+ if (!ast_check_hangup(peer) && ast_test_flag64(&opts, OPT_CALLEE_GO_ON)) {
+ if(!ast_strlen_zero(opt_args[OPT_ARG_CALLEE_GO_ON])) {
+ replace_macro_delimiter(opt_args[OPT_ARG_CALLEE_GO_ON]);
+ ast_parseable_goto(peer, opt_args[OPT_ARG_CALLEE_GO_ON]);
+ } else { /* F() */
+ int res;
+ res = ast_goto_if_exists(peer, chan->context, chan->exten, (chan->priority) + 1);
+ if (res == AST_PBX_GOTO_FAILED) {
+ ast_hangup(peer);
+ goto out;
+ }
+ }
ast_pbx_start(peer);
} else {
if (!ast_check_hangup(chan))