diff -ru asterisk-1.4.15-dist/apps/app_controlplayback.c asterisk-1.4.15/apps/app_controlplayback.c --- asterisk-1.4.15-dist/apps/app_controlplayback.c 2007-10-23 02:15:18.000000000 +1000 +++ asterisk-1.4.15/apps/app_controlplayback.c 2007-12-11 01:04:27.000000000 +1100 @@ -129,7 +129,7 @@ priority_jump = 1; } - res = ast_control_streamfile(chan, argv[arg_file], argv[arg_fwd], argv[arg_rev], argv[arg_stop], argv[arg_pause], argv[arg_restart], skipms); + res = ast_control_streamfile(chan, argv[arg_file], argv[arg_fwd], argv[arg_rev], argv[arg_stop], argv[arg_pause], argv[arg_restart], skipms, skipms, skipms); /* If we stopped on one of our stop keys, return 0 */ if (res > 0 && argv[arg_stop] && strchr(argv[arg_stop], res)) { diff -ru asterisk-1.4.15-dist/apps/app_voicemail.c asterisk-1.4.15/apps/app_voicemail.c --- asterisk-1.4.15-dist/apps/app_voicemail.c 2007-11-29 04:30:47.000000000 +1100 +++ asterisk-1.4.15/apps/app_voicemail.c 2007-12-11 01:04:27.000000000 +1100 @@ -4195,7 +4195,7 @@ static int wait_file(struct ast_channel *chan, struct vm_state *vms, char *file) { - return ast_control_streamfile(chan, file, "#", "*", "1456789", "0", "2", skipms); + return ast_control_streamfile(chan, file, "#", "*", "1456789", "0", "2", skipms, skipms, skipms); } static int play_message_category(struct ast_channel *chan, const char *category) diff -ru asterisk-1.4.15-dist/include/asterisk/app.h asterisk-1.4.15/include/asterisk/app.h --- asterisk-1.4.15-dist/include/asterisk/app.h 2007-06-01 04:41:58.000000000 +1000 +++ asterisk-1.4.15/include/asterisk/app.h 2007-12-11 01:04:27.000000000 +1100 @@ -162,7 +162,7 @@ int ast_linear_stream(struct ast_channel *chan, const char *filename, int fd, int allowoverride); /*! Stream a file with fast forward, pause, reverse, restart. */ -int ast_control_streamfile(struct ast_channel *chan, const char *file, const char *fwd, const char *rev, const char *stop, const char *pause, const char *restart, int skipms); +int ast_control_streamfile(struct ast_channel *chan, const char *file, const char *fwd, const char *rev, const char *stop, const char *pause, const char *restart, int skipms, int skip_ms2, int skip_ms3); /*! Play a stream and wait for a digit, returning the digit that was pressed */ int ast_play_and_wait(struct ast_channel *chan, const char *fn); diff -ru asterisk-1.4.15-dist/include/asterisk/file.h asterisk-1.4.15/include/asterisk/file.h --- asterisk-1.4.15-dist/include/asterisk/file.h 2007-11-30 04:29:59.000000000 +1100 +++ asterisk-1.4.15/include/asterisk/file.h 2007-12-11 01:04:27.000000000 +1100 @@ -253,7 +253,7 @@ * 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 */ -int ast_waitstream_fr(struct ast_channel *c, const char *breakon, const char *forward, const char *rewind, int ms); +int ast_waitstream_fr(struct ast_channel *c, const char *breakon, const char *forward, const char *rewind, int ms, int skip_ms2, int skip_ms3); /* Same as waitstream, but with audio output to fd and monitored fd checking. Returns 1 if monfd is ready for reading */ diff -ru asterisk-1.4.15-dist/main/app.c asterisk-1.4.15/main/app.c --- asterisk-1.4.15-dist/main/app.c 2007-11-28 07:16:56.000000000 +1100 +++ asterisk-1.4.15/main/app.c 2007-12-11 01:04:27.000000000 +1100 @@ -362,7 +362,7 @@ int ast_control_streamfile(struct ast_channel *chan, const char *file, const char *fwd, const char *rev, const char *stop, const char *pause, - const char *restart, int skipms) + const char *restart, int skipms, int skip_ms2, int skip_ms3) { char *breaks = NULL; char *end = NULL; @@ -411,7 +411,7 @@ ast_seekstream(chan->stream, 0, SEEK_END); end = NULL; }; - res = ast_waitstream_fr(chan, breaks, fwd, rev, skipms); + res = ast_waitstream_fr(chan, breaks, fwd, rev, skipms, skip_ms2, skip_ms3); } if (res < 1) diff -ru asterisk-1.4.15-dist/main/file.c asterisk-1.4.15/main/file.c --- asterisk-1.4.15-dist/main/file.c 2007-11-30 04:29:59.000000000 +1100 +++ asterisk-1.4.15/main/file.c 2007-12-11 01:04:27.000000000 +1100 @@ -1052,7 +1052,7 @@ * \brief the core of all waitstream() functions */ static int waitstream_core(struct ast_channel *c, const char *breakon, - const char *forward, const char *rewind, int skip_ms, + const char *forward, const char *rewind, int skip_ms, int skip_ms2, int skip_ms3, int audiofd, int cmdfd, const char *context) { const char *orig_chan_name = NULL; @@ -1131,11 +1131,14 @@ return res; } } else { + char *thisKey; res = fr->subclass; - if (strchr(forward,res)) { - ast_stream_fastforward(c->stream, skip_ms); - } else if (strchr(rewind,res)) { - ast_stream_rewind(c->stream, skip_ms); + if ((thisKey = strchr(forward,res))) { + int this_skip_ms = ((thisKey - forward) == 0) ? skip_ms : (((thisKey - forward) == 1) ? skip_ms2 : skip_ms3); + ast_stream_fastforward(c->stream, this_skip_ms); + } else if ((thisKey = strchr(rewind,res))) { + int this_skip_ms = ((thisKey - rewind) == 0) ? skip_ms : (((thisKey - rewind) == 1) ? skip_ms2 : skip_ms3); + ast_stream_rewind(c->stream, this_skip_ms); } else if (strchr(breakon, res)) { ast_frfree(fr); ast_clear_flag(c, AST_FLAG_END_DTMF_ONLY); @@ -1180,20 +1183,20 @@ return (err || c->_softhangup) ? -1 : 0; } -int ast_waitstream_fr(struct ast_channel *c, const char *breakon, const char *forward, const char *rewind, int ms) +int ast_waitstream_fr(struct ast_channel *c, const char *breakon, const char *forward, const char *rewind, int ms, int skip_ms2, int skip_ms3) { - return waitstream_core(c, breakon, forward, rewind, ms, + return waitstream_core(c, breakon, forward, rewind, ms, skip_ms2, skip_ms3, -1 /* no audiofd */, -1 /* no cmdfd */, NULL /* no context */); } int ast_waitstream(struct ast_channel *c, const char *breakon) { - return waitstream_core(c, breakon, NULL, NULL, 0, -1, -1, NULL); + return waitstream_core(c, breakon, NULL, NULL, 0, 0, 0, -1, -1, NULL); } int ast_waitstream_full(struct ast_channel *c, const char *breakon, int audiofd, int cmdfd) { - return waitstream_core(c, breakon, NULL, NULL, 0, + return waitstream_core(c, breakon, NULL, NULL, 0, 0, 0, audiofd, cmdfd, NULL /* no context */); } @@ -1204,7 +1207,7 @@ if (!context) context = c->context; - return waitstream_core(c, NULL, NULL, NULL, 0, + return waitstream_core(c, NULL, NULL, NULL, 0, 0, 0, -1, -1, context); } diff -ru asterisk-1.4.15-dist/res/res_agi.c asterisk-1.4.15/res/res_agi.c --- asterisk-1.4.15-dist/res/res_agi.c 2007-10-02 05:56:28.000000000 +1000 +++ asterisk-1.4.15/res/res_agi.c 2007-12-11 01:04:27.000000000 +1100 @@ -547,7 +547,7 @@ else pause = NULL; - res = ast_control_streamfile(chan, argv[3], fwd, rev, stop, pause, NULL, skipms); + res = ast_control_streamfile(chan, argv[3], fwd, rev, stop, pause, NULL, skipms, skipms, skipms); fdprintf(agi->fd, "200 result=%d\n", res);