From be1d78a3ea56f12463a967b04d2daf06296724b1 Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Wed, 9 Apr 2003 02:10:29 +0000 Subject: [PATCH] Make voicemail timeout configurable git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@790 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_voicemail.c | 7 ++++++- configs/voicemail.conf.sample | 2 ++ file.c | 6 +++--- include/asterisk/file.h | 3 ++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 0a95e5dd69..b7875d0808 100755 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -1471,7 +1471,11 @@ forward_message(struct ast_channel *chan, struct ast_config *cfg, char *dir, int #define WAITFILE(file) do { \ if (ast_streamfile(chan, file, chan->language)) \ ast_log(LOG_WARNING, "Unable to play message %s\n", file); \ - d = ast_waitstream_fr(chan, AST_DIGIT_ANY, "#", "*"); \ + if ((s = ast_variable_retrieve(cfg, "general", "skipms"))) { \ + if (sscanf(s, "%d", &x) == 1) \ + ms = x; \ + } \ + d = ast_waitstream_fr(chan, AST_DIGIT_ANY, "#", "*",ms); \ if (!d) { \ repeats = 0; \ goto instructions; \ @@ -1721,6 +1725,7 @@ static int vm_execmain(struct ast_channel *chan, void *data) int useadsi = 0; int skipuser = 0; char *s; + int ms = 3000; int maxgreet = 0; char tmp[256], *ext; struct ast_config *cfg; diff --git a/configs/voicemail.conf.sample b/configs/voicemail.conf.sample index 2ede7ff5f3..1b76e1916f 100755 --- a/configs/voicemail.conf.sample +++ b/configs/voicemail.conf.sample @@ -14,6 +14,8 @@ attach=yes ;maxmessage=180 ; Maximum length of greetings ;maxgreet=60 +; How many miliseconds to skip forward/back when rew/ff in message playback +skipms=3000 ; ; Each mailbox is listed in the form =,, diff --git a/file.c b/file.c index fc4972c6e9..bcc5319887 100755 --- a/file.c +++ b/file.c @@ -659,7 +659,7 @@ char ast_waitstream(struct ast_channel *c, char *breakon) return (c->_softhangup ? -1 : 0); } -char ast_waitstream_fr(struct ast_channel *c, char *breakon, char *forward, char *rewind) +char ast_waitstream_fr(struct ast_channel *c, char *breakon, char *forward, char *rewind, int ms) { int res; struct ast_frame *fr; @@ -687,9 +687,9 @@ char ast_waitstream_fr(struct ast_channel *c, char *breakon, char *forward, char case AST_FRAME_DTMF: res = fr->subclass; if (strchr(forward,res)) { - ast_stream_fastforward(c->stream, 3000); + ast_stream_fastforward(c->stream, ms); } else if (strchr(rewind,res)) { - ast_stream_rewind(c->stream, 3000); + ast_stream_rewind(c->stream, ms); } else if (strchr(breakon, res)) { ast_frfree(fr); return res; diff --git a/include/asterisk/file.h b/include/asterisk/file.h index 45b947b9ba..3cc739e64c 100755 --- a/include/asterisk/file.h +++ b/include/asterisk/file.h @@ -129,11 +129,12 @@ char ast_waitstream(struct ast_channel *c, char *breakon); * \param breakon string of DTMF digits to break upon * \param forward DTMF digit to fast forward upon * \param rewind DTMF digit to rewind upon + * \param ms How many miliseconds to skip forward/back * Begins playback of a stream... * Wait for a stream to stop or for any one of a given digit to arrive, Returns 0 * if the stream finishes, the character if it was interrupted, and -1 on error */ -char ast_waitstream_fr(struct ast_channel *c, char *breakon, char *forward, char *rewind); +char ast_waitstream_fr(struct ast_channel *c, char *breakon, char *forward, char *rewind, int ms); /* Same as waitstream, but with audio output to fd and monitored fd checking. Returns 1 if monfd is ready for reading */