aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-04-09 02:10:29 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-04-09 02:10:29 +0000
commit6275b6092f595030b029ad7cbe665fa03ebddf50 (patch)
tree105ace4a237f8b32917d78da8e1199987fdac22b
parent34a25ffc0a705b36c862afa3454c060793b846cd (diff)
Make voicemail timeout configurable
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@790 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xapps/app_voicemail.c7
-rwxr-xr-xconfigs/voicemail.conf.sample2
-rwxr-xr-xfile.c6
-rwxr-xr-xinclude/asterisk/file.h3
4 files changed, 13 insertions, 5 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 0a95e5dd6..b7875d080 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 2ede7ff5f..1b76e1916 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 <mailbox>=<password>,<name>,<email>
diff --git a/file.c b/file.c
index fc4972c6e..bcc531988 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 45b947b9b..3cc739e64 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 */