aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_directory.c
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-21 20:57:29 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-21 20:57:29 +0000
commita139aad1f4ed15064e16e31605b65f8f995d01d3 (patch)
tree7591617b5f1207dc2d4efaedf5c0456f373f8f12 /apps/app_directory.c
parentfa4bd289a0db2130788ce0f695028442000e0f9b (diff)
convert to use ast_stream_and_wait
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@22082 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_directory.c')
-rw-r--r--apps/app_directory.c33
1 files changed, 8 insertions, 25 deletions
diff --git a/apps/app_directory.c b/apps/app_directory.c
index 3856bb04c..0c165df90 100644
--- a/apps/app_directory.c
+++ b/apps/app_directory.c
@@ -168,47 +168,32 @@ static int play_mailbox_owner(struct ast_channel *chan, char *context, char *dia
(char *)ast_config_AST_SPOOL_DIR, ext);
if (ast_fileexists(fn, NULL, chan->language) > 0) {
- res = ast_streamfile(chan, fn, chan->language);
- if (!res) {
- res = ast_waitstream(chan, AST_DIGIT_ANY);
- }
+ res = ast_stream_and_wait(chan, fn, chan->language, AST_DIGIT_ANY);
ast_stopstream(chan);
/* If Option 'e' was specified, also read the extension number with the name */
if (readext) {
- res = ast_streamfile(chan, "vm-extension", chan->language);
- if (!res)
- res = ast_waitstream(chan, AST_DIGIT_ANY);
+ ast_stream_and_wait(chan, "vm-extension", chan->language, AST_DIGIT_ANY);
res = ast_say_character_str(chan, ext, AST_DIGIT_ANY, chan->language);
}
} else if (ast_fileexists(fn2, NULL, chan->language) > 0) {
- res = ast_streamfile(chan, fn2, chan->language);
- if (!res)
- res = ast_waitstream(chan, AST_DIGIT_ANY);
+ res = ast_stream_and_wait(chan, fn2, chan->language, AST_DIGIT_ANY);
ast_stopstream(chan);
/* If Option 'e' was specified, also read the extension number with the name */
if (readext) {
- res = ast_streamfile(chan, "vm-extension", chan->language);
- if (!res) {
- res = ast_waitstream(chan, AST_DIGIT_ANY);
- }
+ ast_stream_and_wait(chan, "vm-extension", chan->language, AST_DIGIT_ANY);
res = ast_say_character_str(chan, ext, AST_DIGIT_ANY, chan->language);
}
} else {
- res = ast_say_character_str(chan, S_OR(name, ext),
- AST_DIGIT_ANY, chan->language);
+ res = ast_say_character_str(chan, S_OR(name, ext), AST_DIGIT_ANY, chan->language);
if (!ast_strlen_zero(name) && readext) {
- res = ast_streamfile(chan, "vm-extension", chan->language);
- if (!res)
- res = ast_waitstream(chan, AST_DIGIT_ANY);
+ ast_stream_and_wait(chan, "vm-extension", chan->language, AST_DIGIT_ANY);
res = ast_say_character_str(chan, ext, AST_DIGIT_ANY, chan->language);
}
}
while (loop) {
if (!res)
- res = ast_streamfile(chan, "dir-instr", chan->language);
- if (!res)
- res = ast_waitstream(chan, AST_DIGIT_ANY);
+ res = ast_stream_and_wait(chan, "dir-instr", chan->language, AST_DIGIT_ANY);
if (!res)
res = ast_waitfordigit(chan, 3000);
ast_stopstream(chan);
@@ -479,9 +464,7 @@ static int directory_exec(struct ast_channel *chan, void *data)
for (;;) {
if (!res)
- res = ast_streamfile(chan, dirintro, chan->language);
- if (!res)
- res = ast_waitstream(chan, AST_DIGIT_ANY);
+ res = ast_stream_and_wait(chan, dirintro, chan->language, AST_DIGIT_ANY);
ast_stopstream(chan);
if (!res)
res = ast_waitfordigit(chan, 5000);