Voicemail application syntax

Hello,

I am aware that the voicemail application syntax has chnaged. Can you please help me with new syntax to get old behavior.

In my extensionss.conf I used to have this line.

exten => 8,1,VoiceMail

When I called into asterisk the prompt would ask for a voicemail box number, I would dial the number and then be able to leave a voicemail in that box.

Now with this same line this no longer happens. Now the mail box number is not able to be “found”.

No entry in voicemail config file for ‘1001’

With an example I found this works but not as I want.

exten => 8,1,VoiceMail(1001@cj)

But I can only leave a message in box 1001. I want to be able to provide a box from a list of 10 different boxes for the context. For example these from voicemail.conf

[cj]

1001 => 9999,cj,cj@cj.com

1002 => 9999,cj,1002@cj.com

1003 => 9999,cj,1003@cj.com

If any one can help this is greatly appreciated.

regards
cj

ok i am closer. I need a macro inside this.

exten => 8,1,VoiceMail(MACRO)

I do not know yet how to build this logic.

Please help if you can.

My voicemail.conf is here.

[cj]
1001 => 9999,cj,cj@cj.com
1002 => 9999,cj,1002@cj.com

1003 => 9999,cj,1003@cj.com

Here is the extensions.conf

[cj]
exten => 8,1,VoiceMail(MAACRO HERE)

HEre is my sip.conf

[3000]
type=friend
context=cj
username=3000
host=dynamic
mailbox=3000
dtmfmode=rfc2833

I want to dial 8 and have it ask me for a box number. I want to be a ble to provide a box number from the voicemail.conf file one of the three listed. I then want to leave a message in the box I dial in after prompted for it. Can this be done ?

Thanks for any help.

uhhh… so you mean the call answers, you dial “8” and it asks you for the mailbox you want to leave the message for?


[voicemail]
exten => _X.,1,Answer()
exten => _X.,n,Wait(1)
exten => _X.,n,Read(boxnum,vm-whichbox,4,,3,5)
exten => _X.,n,Voicemail(${buxnum})

Something like that? I mean, you have to adapt it for whatever nefarious use you deem suitable :smile:

Thank you for this reply. I will try the code you have given as examples.

“”“
uhhh… so you mean the call answers, you dial “8” and it asks you for the mailbox you want to leave the message for?
”""

You understand 99 percent of my need.

To answere your question here is what I need.

My sip client dials an 8.
From the snippet below the asterisk server recognizes the pattern of 8.

exten => 8,1,VoiceMail

Then what I want the asterisk to do i ask for a mailbox number.

Then I dial 1001, or 1002, or 1003.

Then I get a prompt to leave a message in that box.

In older version of asterisk 2005 or so the snipet would work fine.

I will experiment with the ones you provided. They look very interesting. Thanks

Oh, then you are looking for something like this:

[voicemail] 
exten => 8,1,Read(boxnum,vm-whichbox,4,,3,5) 
exten => 8,n,Voicemail(${buxnum}) 

So, the first line should ask for the voicemail box number and the second line should ship you to it. It should be noted that this configuration is waiting for 4 digit numbers at the read statement. If you need longer extensions, simply change the 4 to the correct length.

This is going to be the best solution I can think of because the channel variable will allow a dynamic range of inputs.

Thanks very much this did work.

[voicemail]
exten => _X.,1,Answer()
exten => _X.,n,Wait(1)
exten => _X.,n,Read(boxnum,vm-whichbox,)
exten => _X.,n,Voicemail(${boxnum})

Yes this is even better.

[voicemail]
exten => 8,1,Read(boxnum,vm-whichbox,4,3,5)
exten => 8,n,Voicemail(${buxnum})