summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES2
-rw-r--r--apps/app_dial.c19
-rw-r--r--include/asterisk/pbx.h1
-rw-r--r--main/pbx.c5
4 files changed, 22 insertions, 5 deletions
diff --git a/CHANGES b/CHANGES
index 9397ae104..1c7e5c982 100644
--- a/CHANGES
+++ b/CHANGES
@@ -24,6 +24,8 @@ Applications
* Added progress option to the app_dial D() option. When progress DTMF is
present, those values are sent immediatly upon receiving a PROGRESS message
regardless if the call has been answered or not.
+ * Added functionality to the app_dial F() option to continue with execution
+ at the current location when no parameters are provided.
Dialplan Functions
------------------
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))
diff --git a/include/asterisk/pbx.h b/include/asterisk/pbx.h
index d3cfb2630..cd327661f 100644
--- a/include/asterisk/pbx.h
+++ b/include/asterisk/pbx.h
@@ -34,6 +34,7 @@ extern "C" {
#define AST_MAX_APP 32 /*!< Max length of an application */
+#define AST_PBX_GOTO_FAILED -3
#define AST_PBX_KEEP 0
#define AST_PBX_REPLACE 1
diff --git a/main/pbx.c b/main/pbx.c
index 2a1c9393d..6e7dd4ab0 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -9461,8 +9461,9 @@ static int __ast_goto_if_exists(struct ast_channel *chan, const char *context, c
goto_func = (async) ? ast_async_goto : ast_explicit_goto;
if (ast_exists_extension(chan, context, exten, priority, chan->cid.cid_num))
return goto_func(chan, context, exten, priority);
- else
- return -3;
+ else {
+ return AST_PBX_GOTO_FAILED;
+ }
}
int ast_goto_if_exists(struct ast_channel *chan, const char* context, const char *exten, int priority)