--- app.c.orig 2006-04-11 03:05:01.000000000 +0200 +++ app.c 2006-05-05 05:09:52.354423500 +0200 @@ -537,7 +537,7 @@ static int global_silence_threshold = 128; static int global_maxsilence = 0; -int ast_play_and_record(struct ast_channel *chan, const char *playfile, const char *recordfile, int maxtime, const char *fmt, int *duration, int silencethreshold, int maxsilence, const char *path) +int ast_play_and_record(struct ast_channel *chan, const char *playfile, const char *recordfile, int maxtime, const char *fmt, int *duration, int silencethreshold, int maxsilence, const char *path, char *accepteddtmf) { int d; char *fmts; @@ -688,7 +688,7 @@ /* Write only once */ ast_writestream(others[0], f); } else if (f->frametype == AST_FRAME_DTMF) { - if (f->subclass == '#') { + if (f->subclass == '#' && strstr(accepteddtmf, "#")) { if (option_verbose > 2) ast_verbose( VERBOSE_PREFIX_3 "User ended message by pressing %c\n", f->subclass); res = '#'; @@ -696,7 +696,7 @@ ast_frfree(f); break; } - if (f->subclass == '0') { + if (f->subclass == '0' && strstr(accepteddtmf, "0")) { /* Check for a '0' during message recording also, in case caller wants operator */ if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3 "User cancelled by pressing %c\n", f->subclass); @@ -1191,6 +1191,7 @@ int attempts = 0; int recorded = 0; int message_exists = 0; + char *accepteddtmf = "#"; /* Note that urgent and private are for flagging messages as such in the future */ /* barf if no pointer passed to store duration in */ @@ -1228,7 +1229,7 @@ else ast_verbose(VERBOSE_PREFIX_3 "Recording\n"); recorded = 1; - cmd = ast_play_and_record(chan, playfile, recordfile, maxtime, fmt, duration, silencethreshold, maxsilence, path); + cmd = ast_play_and_record(chan, playfile, recordfile, maxtime, fmt, duration, silencethreshold, maxsilence, path, accepteddtmf); if (cmd == -1) { /* User has hung up, no options to give */ return cmd;