#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; \
int useadsi = 0;
int skipuser = 0;
char *s;
+ int ms = 3000;
int maxgreet = 0;
char tmp[256], *ext;
struct ast_config *cfg;
;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>
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;
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;
* \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 */