diff -Naur asterisk.orig/app.c asterisk/app.c --- asterisk.orig/app.c 2005-06-09 15:27:19.000000000 -0400 +++ asterisk/app.c 2005-07-08 21:18:01.000000000 -0400 @@ -678,6 +678,15 @@ ast_frfree(f); break; } + if (f->subclass == '*') { + /* Check for a '*' during message recording also, in case caller want to escape */ + if (option_verbose > 2) + ast_verbose(VERBOSE_PREFIX_3 "User cancelled by pressing %c\n", f->subclass); + res = '*'; + outmsg = 0; + ast_frfree(f); + break; + } if (maxtime) { time(&end); if (maxtime < (end - start)) { diff -Naur asterisk.orig/apps/app_voicemail.c asterisk/apps/app_voicemail.c --- asterisk.orig/apps/app_voicemail.c 2005-07-07 19:17:22.000000000 -0400 +++ asterisk/apps/app_voicemail.c 2005-07-08 21:18:31.000000000 -0400 @@ -2113,6 +2113,7 @@ /* Check for a '*' here in case the caller wants to escape from voicemail to something other than the operator -- an automated attendant or mailbox login for example */ if (res == '*') { + escape: chan->exten[0] = 'a'; chan->exten[1] = '\0'; if (!ast_strlen_zero(vmu->exit)) { @@ -2207,6 +2208,11 @@ fclose(txt); goto transfer; } + if (res == '*') { + if (txt) + fclose(txt); + goto escape; + } if (res > 0) res = 0; if (txt) { @@ -6024,6 +6030,12 @@ case '8': case '9': case '*': + if (message_exists || recorded) { + DELETE(recordfile, -1, recordfile); + cmd = '*'; + } + return cmd; + break; case '#': cmd = ast_play_and_wait(chan, "vm-sorry"); break;