[asterisk-users] Removing mailbox and password prompt for voicemail

A J Stiles asterisk_list at earthshod.co.uk
Thu Aug 4 08:03:25 CDT 2016

On Thursday 04 Aug 2016, Nabeel wrote:
> On 30 July 2016 at 19:32, D'Arcy J.M. Cain <darcy at vex.net> wrote:
> > Not playing the prompt changes nothing.  If someone presses '*' while
> > listening to your answer message then they are in your mailbox.  You
> > better have a password that they need to enter to continue.
> I have now tested the 'Unavailable' message by pressing "*" while listening
> to the recorded message. I can confirm that this does NOT directly enter to
> the called number's mailbox. It actually enter's the registered
> device's/caller's own mailbox. Therefore, this does not necessitate setting
> a password.
> The problem is that the 'mailbox' prompt allows a way for accessing any
> other mailbox, which is not necessary in my case. If anyone knows a way to
> remove this 'mailbox' prompt, please let me know.
> Nabeel

To get rid of the "Mailbox?" prompt, you need to supply a mailbox as a 
parameter to the VoicemailMain() command:

exten => xxxx,y,VoicemailMail(${mbox})

This takes you straight to the mailbox specified by ${mbox} .  If mailboxes are 
simply the same as extension numbers, then you can just use ${CALLERID(num)} 
here.  Otherwise, you may need a script to look them up in a database.

If you also add the "s" option, like this:

exten => xxxx,y,,VoicemailMail(${mbox},s)

Then this will also get rid of the "Password?" prompt  (and therefore presume 
you are already authenticated).  Therefore, this should *only* be used in one 
of the following situations:

(1)  In a small, intimate business environment, where there is full mutual 
trust between all personnel and nobody has any secrets from anybody else.

(2)  Where sufficient precautions have been taken to ensure that phones are 
physically secure against unwanted access.

The latter is the approach usually taken by telcos with their basic voicemail 
configuration; your messages can only be retrieved from your own phone, which 
normally is either behind a locked door  (if it is a land line)  or about your 
person  (if it is a mobile).

For instance, you might have something like this in your Dialplan.  
"get_mailbox.agi" is an AGI script  (not included)  for looking up the mailbox 
associated with a caller's number and populating a channel variable "mbox", or 
leaving it empty in the event of an error.  "ajs-vm_not_avail.wav" is a sound 
file  (also not included)  announcing that voicemail is not available.

exten => 1571,1,AGI(get_mailbox.agi,${CALLERID(num)})
exten => 1571,n,GotoIf($[${mbox}]?mbox_ok:mbox_err)
exten => 1571,n(mbox_ok),VoicemailMain(${mbox}, s)
exten => 1571,n,Hangup()
exten => 1571,n(mbox_ng),Playback(ajs-vm_not_avail)
exten => 1571,n,Hangup()


Note:  Originating address only accepts e-mail from list!  If replying off-
list, change address to asterisk1list at earthshod dot co dot uk .

More information about the asterisk-users mailing list