diff --git a/app.c b/app.c index b72f0efcba00a23e8465588ab810031c2e1798b8..e272dce545e76b16a12988fc0157845568121b0b 100755 --- a/app.c +++ b/app.c @@ -406,3 +406,13 @@ int ast_linear_stream(struct ast_channel *chan, const char *filename, int fd, in } return res; } + +int ast_control_streamfile(struct ast_channel *chan, char *file,char *f,char *r,int skipms) { + int res; + if ((res = ast_streamfile(chan, file, chan->language))) + ast_log(LOG_WARNING, "Unable to stream file %s\n", file); + if (!res) + res = ast_waitstream_fr(chan, AST_DIGIT_ANY,f,r,skipms); + return res; +} + diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 37972cb49f2b43660bd221c20d42c3d81238f630..8c0a2fef0092e8af394f1ba65547e68d6c5fee62 100755 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -2549,12 +2549,9 @@ static int wait_file2(struct ast_channel *chan, struct vm_state *vms, char *file static int wait_file(struct ast_channel *chan, struct vm_state *vms, char *file) { - int res; - if ((res = ast_streamfile(chan, file, chan->language))) - ast_log(LOG_WARNING, "Unable to play message %s\n", file); - if (!res) - res = ast_waitstream_fr(chan, AST_DIGIT_ANY, "#", "*",skipms); - return res; + + return ast_control_streamfile(chan,file,"#","*",skipms); + } static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *vmu, char *origtime, char *filename) diff --git a/include/asterisk/app.h b/include/asterisk/app.h index 0d0ec7b540e26e59749c1bc010d3446fa321677b..dacdf95eb23f87ffee12661c1341dfc5d828f4e1 100755 --- a/include/asterisk/app.h +++ b/include/asterisk/app.h @@ -54,6 +54,9 @@ int ast_dtmf_stream(struct ast_channel *chan, struct ast_channel *peer, char *di //! Stream a filename (or file descriptor) as a generator. int ast_linear_stream(struct ast_channel *chan, const char *filename, int fd, int allowoverride); +//! Stream a file with fast forward and reverse. +int ast_control_streamfile(struct ast_channel *chan, char *file,char *f,char *r,int skipms); + #if defined(__cplusplus) || defined(c_plusplus) } #endif