aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_dial.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-01-10 04:51:06 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-01-10 04:51:06 +0000
commit0ac603fb9310f44510dc5e85539244ffb09d6b2d (patch)
treedbccdfde5f3118fae1334ff408aca391b06ea848 /apps/app_dial.c
parent5b79d7465dc61bf15eba397460ef2cff1af438cc (diff)
Add another return value to dial_exec_full that indicates execution is going to continuing at a new extension/context/priority and to just let it slide. (issue #8598 reported by jon)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@50295 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_dial.c')
-rw-r--r--apps/app_dial.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index c7fe8762d..522c47a3f 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -1470,7 +1470,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
ast_pbx_start(peer);
hanguptree(outgoing, NULL);
LOCAL_USER_REMOVE(u);
- return 0;
+ return 1;
}
if (ast_test_flag(&opts, OPT_CALLEE_MACRO) && !ast_strlen_zero(opt_args[OPT_ARG_CALLEE_MACRO])) {
@@ -1649,8 +1649,12 @@ out:
static int dial_exec(struct ast_channel *chan, void *data)
{
struct ast_flags peerflags;
+ int res = 0;
+
memset(&peerflags, 0, sizeof(peerflags));
- return dial_exec_full(chan, data, &peerflags);
+ res = dial_exec_full(chan, data, &peerflags);
+
+ return (res >= 0 ? 0 : -1);
}
static int retrydial_exec(struct ast_channel *chan, void *data)
@@ -1719,7 +1723,10 @@ static int retrydial_exec(struct ast_channel *chan, void *data)
if (ast_test_flag(chan, AST_FLAG_MOH))
ast_moh_stop(chan);
- if ((res = dial_exec_full(chan, dialdata, &peerflags)) == 0) {
+ res = dial_exec_full(chan, dialdata, &peerflags);
+ if (res == 1) {
+ break;
+ } else if (res == 0) {
if (ast_test_flag(&peerflags, OPT_DTMF_EXIT)) {
if (!(res = ast_streamfile(chan, announce, chan->language)))
res = ast_waitstream(chan, AST_DIGIT_ANY);
@@ -1755,7 +1762,7 @@ static int retrydial_exec(struct ast_channel *chan, void *data)
ast_moh_stop(chan);
LOCAL_USER_REMOVE(u);
- return loops ? res : 0;
+ return loops ? (res >= 0 ? 0 : -1) : 0;
}