aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-16 18:16:15 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-16 18:16:15 +0000
commit9c61369a1498bda38df1df4dff5a65debbc9ade3 (patch)
tree5026cdd855108d8634e5a2dbd5b6bd37c9c22185
parent3326980a2ac66e61af014d3290df88779dd4bd79 (diff)
Restoring functionality from 1.2 wherein Retrydial will not exit if there is no announce file specified.
This change makes it so that if there is no announce file specified, the application will continue until finished (or caller hangs up). If a bogus announce file is specified, then a warning message will be printed saying that the file could not be found, but execution will still continue. (closes issue #10186, reported by jon, patched by me) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@75253 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--apps/app_dial.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index b95831869..79bcbc97f 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -1767,22 +1767,33 @@ static int retrydial_exec(struct ast_channel *chan, void *data)
res = dial_exec_full(chan, dialdata, &peerflags, &continue_exec);
if (continue_exec)
break;
+
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);
+ if (!ast_strlen_zero(announce)) {
+ if (ast_fileexists(announce, NULL, chan->language)) {
+ if(!(res = ast_streamfile(chan, announce, chan->language)))
+ ast_waitstream(chan, AST_DIGIT_ANY);
+ } else
+ ast_log(LOG_WARNING, "Announce file \"%s\" specified in Retrydial does not exist\n", announce);
+ }
if (!res && sleep) {
if (!ast_test_flag(chan, AST_FLAG_MOH))
ast_moh_start(chan, NULL, NULL);
res = ast_waitfordigit(chan, sleep);
}
} else {
- if (!(res = ast_streamfile(chan, announce, chan->language)))
- res = ast_waitstream(chan, "");
+ if (!ast_strlen_zero(announce)) {
+ if (ast_fileexists(announce, NULL, chan->language)) {
+ if (!(res = ast_streamfile(chan, announce, chan->language)))
+ res = ast_waitstream(chan, "");
+ } else
+ ast_log(LOG_WARNING, "Announce file \"%s\" specified in Retrydial does not exist\n", announce);
+ }
if (sleep) {
if (!ast_test_flag(chan, AST_FLAG_MOH))
ast_moh_start(chan, NULL, NULL);
- if (!res)
+ if (!res)
res = ast_waitfordigit(chan, sleep);
}
}