[asterisk-commits] qwell: trunk r114149 - /trunk/apps/app_directory.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Apr 15 15:27:05 CDT 2008
Author: qwell
Date: Tue Apr 15 15:27:04 2008
New Revision: 114149
URL: http://svn.digium.com/view/asterisk?view=rev&rev=114149
Log:
If somebody enters a digit during ast_stream_and_wait, the return value is the digit, which we need to use later.
Modified:
trunk/apps/app_directory.c
Modified: trunk/apps/app_directory.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_directory.c?view=diff&rev=114149&r1=114148&r2=114149
==============================================================================
--- trunk/apps/app_directory.c (original)
+++ trunk/apps/app_directory.c Tue Apr 15 15:27:04 2008
@@ -858,14 +858,23 @@
if (!ast_strlen_zero(dirintro) && !res) {
res = ast_stream_and_wait(chan, dirintro, AST_DIGIT_ANY);
} else if (!res) {
- res = ast_stream_and_wait(chan, "dir-welcome", AST_DIGIT_ANY) ||
- ast_stream_and_wait(chan, "dir-pls-enter", AST_DIGIT_ANY) ||
- ast_stream_and_wait(chan, digits, AST_DIGIT_ANY) ||
- ast_stream_and_wait(chan,
+ /* Stop playing sounds as soon as we have a digit. */
+ res = ast_stream_and_wait(chan, "dir-welcome", AST_DIGIT_ANY);
+ if (!res) {
+ res = ast_stream_and_wait(chan, "dir-pls-enter", AST_DIGIT_ANY);
+ }
+ if (!res) {
+ res = ast_stream_and_wait(chan, digits, AST_DIGIT_ANY);
+ }
+ if (!res) {
+ res = ast_stream_and_wait(chan,
which == FIRST ? "dir-first" :
which == LAST ? "dir-last" :
- "dir-firstlast", AST_DIGIT_ANY) ||
+ "dir-firstlast", AST_DIGIT_ANY);
+ }
+ if (!res) {
ast_stream_and_wait(chan, "dir-usingkeypad", AST_DIGIT_ANY);
+ }
}
ast_stopstream(chan);
if (!res)
More information about the asterisk-commits
mailing list