--- apps/app_voicemail.c 2004-06-05 00:20:07.016888136 -0400 +++ ../patches/app_voicemail.c 2004-06-04 23:36:25.949242577 -0400 @@ -1215,7 +1215,6 @@ if (option_verbose > 2) ast_verbose( VERBOSE_PREFIX_3 "Took too long, cutting it short...\n"); res = 't'; - outmsg=2; ast_frfree(f); break; } @@ -1442,7 +1441,6 @@ if (maxtime < (end - start)) { if (option_verbose > 2) ast_verbose( VERBOSE_PREFIX_3 "Took too long, cutting it short...\n"); - outmsg = 2; res = 't'; ast_frfree(f); break; @@ -2574,7 +2572,7 @@ static int wait_file(struct ast_channel *chan, struct vm_state *vms, char *file) { - return ast_control_streamfile(chan, file, "#", "*", "14679", "0", skipms); + return ast_control_streamfile(chan, file, "#", "*", "1", "0", "6", "4", "7", skipms); } static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *vmu, char *origtime, char *filename) @@ -2739,11 +2737,10 @@ if ((!res)&&(vmu->envelope)) res = play_message_datetime(chan, vmu, origtime, filename); + if ((!res)&&(vmu->saycid)) res = play_message_callerid(chan, vms, cid, context, 0); - /* Allow pressing '1' to skip envelope / callerid */ - if (res == '1') - res = 0; + ast_destroy(msg_cfg); if (!res) { --- apps/app_controlplayback.c 2004-06-05 00:20:01.430943821 -0400 +++ ../patches/app_controlplayback.c 2004-06-05 00:00:02.456537476 -0400 @@ -54,7 +54,7 @@ int skipms = 0; struct localuser *u; char tmp[256]; - char *skip = NULL, *fwd = NULL, *rev = NULL, *stop = NULL, *pause = NULL, *file = NULL; + char *skip = NULL, *fwd = NULL, *rev = NULL, *stop = NULL, *pause = NULL, *next = NULL, *prev = NULL, *del = NULL, *file = NULL; if (!data || ast_strlen_zero((char *)data)) { ast_log(LOG_WARNING, "ControlPlayback requires an argument (filename)\n"); @@ -97,6 +97,12 @@ fwd = "#"; if (!rev || !is_on_phonepad(*rev)) rev = "*"; + if (!rev || !is_on_phonepad(*next)) + next = NULL; + if (!rev || !is_on_phonepad(*prev)) + prev = NULL; + if (!rev || !is_on_phonepad(*del)) + del = NULL; if (stop && !is_on_phonepad(*stop)) stop = NULL; if (pause && !is_on_phonepad(*pause)) @@ -104,7 +110,7 @@ LOCAL_USER_ADD(u); - res = ast_control_streamfile(chan, file, fwd, rev, stop, pause, skipms); + res = ast_control_streamfile(chan, file, fwd, rev, stop, pause, next, prev, del, skipms); LOCAL_USER_REMOVE(u); return res; --- include/asterisk/app.h 2004-06-05 00:20:07.106871130 -0400 +++ ../patches/app.h 2004-06-04 23:38:10.361509748 -0400 @@ -55,7 +55,7 @@ int ast_linear_stream(struct ast_channel *chan, const char *filename, int fd, int allowoverride); //! Stream a file with fast forward, pause, reverse. -int ast_control_streamfile(struct ast_channel *chan, char *file, char *fwd, char *rev, char *stop, char *pause, int skipms); +int ast_control_streamfile(struct ast_channel *chan, char *file, char *fwd, char *rev, char *stop, char *pause, char *next, char *prev, char *del, int skipms); #if defined(__cplusplus) || defined(c_plusplus) } --- app.c 2004-06-05 00:20:00.976029795 -0400 +++ ../patches/app.c 2004-06-05 00:16:44.384183603 -0400 @@ -407,27 +407,34 @@ return res; } -int ast_control_streamfile(struct ast_channel *chan, char *file, char *fwd, char *rev, char *stop, char *pause, int skipms) +int ast_control_streamfile(struct ast_channel *chan, char *file, char *fwd, char *rev, char *stop, char *pause, char *next, char *prev, char *del, int skipms) { struct timeval started, ended; long elapsed = 0,last_elapsed =0; - char *breaks; - int blen=2; - int res=0; - - if (stop) - blen += strlen(stop); - if (pause) - blen += strlen(pause); - - breaks = alloca(blen + 1); - breaks[0] = '\0'; - strcat(breaks, stop); - strcat(breaks, pause); + char breaks[8]; + int x=0,res=0; if (chan->_state != AST_STATE_UP) res = ast_answer(chan); + if (stop != NULL && stop[0]) { + breaks[x++] = stop[0]; + } + if (pause != NULL && pause[0]) { + breaks[x++] = pause[0]; + } + if (next != NULL && next[0]) { + breaks[x++] = next[0]; + } + if (prev != NULL && prev[0]) { + breaks[x++] = prev[0]; + } + if (del != NULL && del[0]) { + breaks[x++] = del[0]; + } + + breaks[x] = '\0'; + if (chan) ast_stopstream(chan); @@ -452,16 +459,14 @@ if (res < 1) break; - if (pause != NULL && strchr(pause, res)) { + if (pause != NULL && res == *pause) { gettimeofday(&ended, NULL); elapsed = (((ended.tv_sec * 1000) + ended.tv_usec / 1000) - ((started.tv_sec * 1000) + started.tv_usec / 1000) + last_elapsed); for(;;) { if (chan) ast_stopstream(chan); res = ast_waitfordigit(chan, 1000); - if(res == 0) - continue; - else if(res == -1 || strchr(pause, res) || (stop && strchr(stop, res))) + if (res == -1 || res == *next || res == *prev || res == *del || res == *pause || (stop && res == *stop)) break; } if (res == *pause) { @@ -472,7 +477,10 @@ if (res == -1) break; - if (stop && strchr(stop, res)) { + if (prev != NULL || next != NULL || del != NULL) + break; + + if (stop != NULL && res == *stop) { res = 0; break; }