Originally reorted in #1668:
This is really a features codes (*98 and *97) combined with voicemail bug.
Two scenarios:
First:
200 has voicemail in context default
210 has no voicemail
call *97 from a 210 (no vm), get-vmcontext returns disabled, a call is put into VoiceMailMain?(210@disabled). No such mail box exist so Allison asks for a mailbox followed by a password. Mailbox 200 is entered with a correct password but it fails. The problem is, VoicemailMain?() is assuming a context of disabled and 200 is default.
call *98 and enter box 200 and password and it works because VoicemailMain?() is called with no parameters so it defaults to 'default' context.
Second:
200 has voicemail in context accounting
210 has no voicemail
call *97 from a 210 (no vm), get-vmcontext returns disabled, a call is put into VoiceMailMain?(210@disabled). No such mail box exist so Allison asks for a mailbox followed by a password. Mailbox 200 is entered with a correct password but it fails. The problem is, VoicemailMain?() is assuming a context of disabled and 200 is accounting.
call *98 from 210 (no vm), enter 200 and password and it fails. Since VoicemailMain?() assumes 'default' but the proper context is 'accounting' it fails.
Implications, suggestions:
When a call comes into *98, it should have a dialplan code asking for the extension with the same recordings that the vm system uses. Once obtained, it should get the vmcontext of that extension so that it can properly call VoicemailMain?.
When a call comes into *98 and it is determined that the calling party has voicemail disabled, it should effectively mimic the same code as *98 (but not jump to it as that feature code might be disabled).
ADDENDUM:
Actually, the whole mailbox and password should be written in the dialplan using the vmauthenticate(). If you just get the mailbox and then lookup the context and then drop into the VoicemailMain?, and they had a typo, you are now stuck in voicemailmain with whatever context you looked up (and it re-asks). If you write it in the dialplan, you can control that and do a new lookup of the context. Once everything authenticates you can drop into voicemailmain with the proper mailbox@context and the s options which skip authenticating.