Index: apps/app_voicemail.c =================================================================== --- apps/app_voicemail.c (revision 102060) +++ apps/app_voicemail.c (working copy) @@ -496,9 +496,15 @@ " 0 - Jump to the 'o' extension in the current dialplan context.\n" " * - Jump to the 'a' extension in the current dialplan context.\n" " This application will set the following channel variable upon completion:\n" - " VMSTATUS - This indicates the status of the execution of the VoiceMail\n" - " application. The possible values are:\n" - " SUCCESS | USEREXIT | FAILED\n\n" + " VMSTATUS - This indicates the status of the execution of the VoiceMail\n" + " application. The possible values are:\n" + " SUCCESS | USEREXIT | FAILED\n" + " VMMAILBOX - When using the d() option, this will be set to the current\n" + " mailbox before jumping to the exit context extension.\n" + " VMCONTEXT - When using the d() option, this will be set to the voicemail\n" + " context for the current mailbox before jumping to the exit\n" + " context extension.\n" + "\n" " Options:\n" " b - Play the 'busy' greeting to the calling party.\n" " d([c]) - Accept digits for a new extension in context c, if played during\n" @@ -3188,6 +3194,11 @@ if (ast_test_flag(options, OPT_DTMFEXIT) && res > 0) { if (!ast_strlen_zero(options->exitcontext)) ast_copy_string(chan->context, options->exitcontext, sizeof(chan->context)); + chan->exten[0] = res; + chan->exten[1] = '\0'; + chan->priority = 0; + pbx_builtin_setvar_helper(chan, "VMMAILBOX", vmu->mailbox); + pbx_builtin_setvar_helper(chan, "VMCONTEXT", vmu->context); free_user(vmu); pbx_builtin_setvar_helper(chan, "VMSTATUS", "USEREXIT"); return res; Index: doc/tex/channelvariables.tex =================================================================== --- doc/tex/channelvariables.tex (revision 102060) +++ doc/tex/channelvariables.tex (working copy) @@ -811,7 +811,9 @@ ${TRANSFERSTATUS} * transfer() ${TXTCIDNAMESTATUS} * txtcidname() ${UPQMSTATUS} * unpausequeuemember() -${VMSTATUS} * voicmail() +${VMSTATUS} * voicemail() +${VMMAILBOX} * voicemail() +${VMCONTEXT} * voicemail() ${VMBOXEXISTSSTATUS} * vmboxexists() ${WAITSTATUS} * waitforsilence() \end{verbatim}