[asterisk-commits] mmichelson: trunk r75254 - in /trunk: ./ apps/app_dial.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jul 16 13:18:20 CDT 2007


Author: mmichelson
Date: Mon Jul 16 13:18:19 2007
New Revision: 75254

URL: http://svn.digium.com/view/asterisk?view=rev&rev=75254
Log:
Merged revisions 75253 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r75253 | mmichelson | 2007-07-16 13:16:15 -0500 (Mon, 16 Jul 2007) | 8 lines

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)


........

Modified:
    trunk/   (props changed)
    trunk/apps/app_dial.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_dial.c?view=diff&rev=75254&r1=75253&r2=75254
==============================================================================
--- trunk/apps/app_dial.c (original)
+++ trunk/apps/app_dial.c Mon Jul 16 13:18:19 2007
@@ -1888,22 +1888,33 @@
 		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);
 				}
 			}




More information about the asterisk-commits mailing list