diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-02-15 16:19:39 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-02-15 16:19:39 +0000 |
commit | 27f39e5aeaa53bfd128fe49e7db0a0086ec4e592 (patch) | |
tree | f3f1cbd4e71880f35e44560a5ad34d862a81a0f9 /apps/app_dial.c | |
parent | 44d7e9bbce7e6cdb55d4ca9e22b883d7b1c17f1b (diff) |
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: http://svn.digium.com/svn/asterisk/branches/1.4@54623 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_dial.c')
-rw-r--r-- | apps/app_dial.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c index efbf4e341..e19c4f107 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -770,7 +770,7 @@ static int valid_priv_reply(struct ast_flags *opts, int res) return 0; } -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; struct ast_module_user *u; @@ -1052,6 +1052,9 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags } } + if (continue_exec) + *continue_exec = 0; + /* 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"); @@ -1475,7 +1478,9 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags peer->priority++; ast_pbx_start(peer); hanguptree(outgoing, NULL); - res = 1; + if (continue_exec) + *continue_exec = 1; + res = 0; goto done; } @@ -1668,12 +1673,10 @@ done: static int dial_exec(struct ast_channel *chan, void *data) { struct ast_flags peerflags; - int res = 0; 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) @@ -1729,14 +1732,16 @@ static int retrydial_exec(struct ast_channel *chan, void *data) res = 0; while (loops) { + int continue_exec; + chan->data = "Retrying"; if (ast_test_flag(chan, AST_FLAG_MOH)) ast_moh_stop(chan); - res = dial_exec_full(chan, dialdata, &peerflags); - if (res == 1) { + res = dial_exec_full(chan, dialdata, &peerflags, &continue_exec); + if (continue_exec) break; - } else if (res == 0) { + 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); @@ -1774,7 +1779,6 @@ static int retrydial_exec(struct ast_channel *chan, void *data) if (ast_test_flag(chan, AST_FLAG_MOH)) ast_moh_stop(chan); - done: ast_module_user_remove(u); return res; |