[asterisk-commits] file: branch 1.2 r50295 -
/branches/1.2/apps/app_dial.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Tue Jan 9 21:51:06 MST 2007
Author: file
Date: Tue Jan 9 22:51:06 2007
New Revision: 50295
URL: http://svn.digium.com/view/asterisk?view=rev&rev=50295
Log:
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)
Modified:
branches/1.2/apps/app_dial.c
Modified: branches/1.2/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/apps/app_dial.c?view=diff&rev=50295&r1=50294&r2=50295
==============================================================================
--- branches/1.2/apps/app_dial.c (original)
+++ branches/1.2/apps/app_dial.c Tue Jan 9 22:51:06 2007
@@ -1470,7 +1470,7 @@
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 @@
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 @@
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 @@
ast_moh_stop(chan);
LOCAL_USER_REMOVE(u);
- return loops ? res : 0;
+ return loops ? (res >= 0 ? 0 : -1) : 0;
}
More information about the asterisk-commits
mailing list