Make voicemail timeout configurable
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@790 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
34a25ffc0a
commit
6275b6092f
|
@ -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;
|
||||
|
|
|
@ -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>
|
||||
|
|
6
file.c
6
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;
|
||||
|
|
|
@ -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 */
|
||||
|
|
Reference in New Issue