Summary:ASTERISK-11363: [patch] VoiceMail d([context]) option does not set extension, priority
Reporter:Nic Bellamy (nic_bellamy)Labels:
Date Opened:2008-02-02 18:23:25.000-0600Date Closed:2011-06-07 14:08:14
Versions:Frequency of
Environment:Attachments:( 0) asterisk-trunk-bug-11910_v1.patch
Description:The VoiceMail() 'd' option is supposed to allow you to dial a single digit extension during the playback of the initial prompt.

This doesn't work, but is easily fixed.

Using the following very simple example extensions.conf (assume voicemail box is all happy):

exten => 200,1,VoiceMail(200,ud(vmexit))

exten => _X,1,SayDigits(${EXTEN})
exten => _X,n,DumpChan()
exten => _X,n,Goto(default,200,1)

Now, when you start voicemail and enter a digit, it should jump to that digit in the vmexit context.

It doesn't - it tries to jump to the original extension in the vmexit context, ie.:

[Feb  3 13:01:26] WARNING[22057]: pbx.c:3358 __ast_pbx_run: Channel 'SIP/200-081ee6b8' sent into invalid extension '200' in context 'vmexit', but no invalid handler


Feature came in via bug ASTERISK-7007063 but seems to have gotten broken in the process.

Although it was discussed in the original bug, the patch that got committed didn't have a way to pass on the mailbox and mailbox context to the voicemail exit context.

Patch attached that (a) fixes the initial problem, (b) makes leave_voicemail() set VMMAILBOX and VMCONTEXT variables before jumping out to the exit context.
Comments:By: Nic Bellamy (nic_bellamy) 2008-02-03 00:02:57.000-0600

Please put a hold on committing this for the moment.

A bit more playing around has found that although this does fix a valid bug, there's still some behavior that's a bit unpredictable around the functioning of 'a' / '*' and 'o' extensions when you're using the d(ctx) flag.

I'll come up with something saner and update the patch.

By: Tilghman Lesher (tilghman) 2008-02-03 11:43:51.000-0600

Actually, the 'd' option is supposed to allow you to dial ANY extension within the destination context, not just single digit extensions.  It's why we didn't set the extension or priority AT ALL, but pass back the digit to the pbx routines to allow them to complete the extension, as the context specifies.

By: Tilghman Lesher (tilghman) 2008-02-03 11:47:53.000-0600

So the only problem you could fix (and really, it's a feature that we simply chose not to add) was to set channel variables that specified the vmcontext and mailbox that were jumped out of.  You, of course, can get nearly the same behavior by setting those variables prior to entering the Voicemail application, assuming you're not using the Voicemail app to request the mailbox number (which nearly nobody does anymore, anyway).

By: Tilghman Lesher (tilghman) 2008-02-11 12:59:28.000-0600

No response from reporter, and as I already pointed out, this can be done in the dialplan.