Merged revisions 54623 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r54623 | file | 2007-02-15 11:19:39 -0500 (Thu, 15 Feb 2007) | 10 lines

Merged revisions 54622 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r54622 | file | 2007-02-15 11:14:40 -0500 (Thu, 15 Feb 2007) | 2 lines

Use a separate variable to indicate execution should continue instead of the return value. (issue #8842 reported by pluto70)

........

................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@54624 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Joshua Colp
2007-02-15 16:24:13 +00:00
parent bd4858f6b7
commit a11b56a8e5

View File

@@ -1167,7 +1167,7 @@ static int setup_privacy_args(struct privacy_args *pa,
return 1; /* success */ return 1; /* success */
} }
static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags *peerflags) static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags *peerflags, int *continue_exec)
{ {
int res = -1; /* default: error */ int res = -1; /* default: error */
struct ast_module_user *u; struct ast_module_user *u;
@@ -1268,6 +1268,9 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
res = -1; /* reset default */ res = -1; /* reset default */
} }
if (continue_exec)
*continue_exec = 0;
/* If a channel group has been specified, get it for use when we create peer channels */ /* If a channel group has been specified, get it for use when we create peer channels */
outbound_group = pbx_builtin_getvar_helper(chan, "OUTBOUND_GROUP"); outbound_group = pbx_builtin_getvar_helper(chan, "OUTBOUND_GROUP");
@@ -1533,7 +1536,9 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
peer->priority++; peer->priority++;
ast_pbx_start(peer); ast_pbx_start(peer);
hanguptree(outgoing, NULL); hanguptree(outgoing, NULL);
res = 1; if (continue_exec)
*continue_exec = 1;
res = 0;
goto done; goto done;
} }
@@ -1708,12 +1713,10 @@ done:
static int dial_exec(struct ast_channel *chan, void *data) static int dial_exec(struct ast_channel *chan, void *data)
{ {
struct ast_flags peerflags; struct ast_flags peerflags;
int res = 0;
memset(&peerflags, 0, sizeof(peerflags)); memset(&peerflags, 0, sizeof(peerflags));
res = dial_exec_full(chan, data, &peerflags);
return (res >= 0 ? 0 : -1); return dial_exec_full(chan, data, &peerflags, NULL);
} }
static int retrydial_exec(struct ast_channel *chan, void *data) static int retrydial_exec(struct ast_channel *chan, void *data)
@@ -1769,14 +1772,16 @@ static int retrydial_exec(struct ast_channel *chan, void *data)
res = 0; res = 0;
while (loops) { while (loops) {
int continue_exec;
chan->data = "Retrying"; chan->data = "Retrying";
if (ast_test_flag(chan, AST_FLAG_MOH)) if (ast_test_flag(chan, AST_FLAG_MOH))
ast_moh_stop(chan); ast_moh_stop(chan);
res = dial_exec_full(chan, dialdata, &peerflags); res = dial_exec_full(chan, dialdata, &peerflags, &continue_exec);
if (res == 1) { if (continue_exec)
break; break;
} else if (res == 0) { if (res == 0) {
if (ast_test_flag(&peerflags, OPT_DTMF_EXIT)) { if (ast_test_flag(&peerflags, OPT_DTMF_EXIT)) {
if (!(res = ast_streamfile(chan, announce, chan->language))) if (!(res = ast_streamfile(chan, announce, chan->language)))
res = ast_waitstream(chan, AST_DIGIT_ANY); res = ast_waitstream(chan, AST_DIGIT_ANY);
@@ -1814,7 +1819,6 @@ static int retrydial_exec(struct ast_channel *chan, void *data)
if (ast_test_flag(chan, AST_FLAG_MOH)) if (ast_test_flag(chan, AST_FLAG_MOH))
ast_moh_stop(chan); ast_moh_stop(chan);
done: done:
ast_module_user_remove(u); ast_module_user_remove(u);
return res; return res;