From 01299610b699e1716e95427ef331615ac2345dc9 Mon Sep 17 00:00:00 2001 From: automerge Date: Wed, 10 Jan 2007 05:10:20 +0000 Subject: automerge commit git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@50330 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_dial.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'apps/app_dial.c') 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; } -- cgit v1.2.3