aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_directory.c
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-15 20:27:04 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-15 20:27:04 +0000
commit5e488b20d20658d8158d32b32d225510c6915de6 (patch)
tree4a6d7f20937a8f4f98c5793e58707a032a65e739 /apps/app_directory.c
parentb482d688d008cbe13f57e49a1537c7051dc33791 (diff)
If somebody enters a digit during ast_stream_and_wait, the return value is the digit, which we need to use later.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@114149 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_directory.c')
-rw-r--r--apps/app_directory.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/apps/app_directory.c b/apps/app_directory.c
index 03f8dbbe2..981e1f1de 100644
--- a/apps/app_directory.c
+++ b/apps/app_directory.c
@@ -858,14 +858,23 @@ static int directory_exec(struct ast_channel *chan, void *data)
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)