Configuring Voicemail


I am working with Asterisk 13 and was trying to configure the voicemail.
How can I configure the voicemail?

I setup my asterisk config files as following:


exten => _.,1,Set(CALLERID(name)=12345678900)
exten => _.,2,Dial(SIP/000${EXTEN}@onsip)

exten => s,1,NoOp()
same => n,Wait(1)
same => n,Answer()
same => n,SendDTMF(1)
same => n,Dial(dahdi/1,10)
same => n,VoiceMail(6001@vm_demo)
same => n,HangUp()




6001 => 7132,name,

But after setting up this config,
I am not able to get voicemail working.
Dial gets disconnected after waiting for 10 seconds, then it will run the voicemail line that did not work.

Any help???


Can you confirm that Asterisk has a public IP address and is a non-routeable address? You have nat=yes, which is mainly for dealing with this situation, but you don’t have any NAT traversal parameters, which would be needed if Asterisk was inside and they were outside.

Hi @david551,

Thanks for your reply.

How can I confirm the public IP address and are non-routable address?

If you are specifying nat= you should already understand what I meant.

Thanks @david551 for your support.

Found the issue. I missed ulaw while building the asterisk.
Now, It is working fine. It is saving the voicemails and all other information in “gsm,wave and text” files.

But do you know how can I hear those voicemails?

I want to setup,
if I dial 123 then it should play voicemail.
if I have more than one voicemails then it should ask me that do I want to play all of them or just the latest one

Hi guys,

I have the same issue, this is the message that I have in Console CLI when I make a internal call:

  == Setting global variable 'SIPDOMAIN' to ''
    -- Executing [101@from-internal:1] NoOp("PJSIP/104-00000007", "First Line") in new stack
    -- Executing [101@from-internal:2] Dial("PJSIP/104-00000007", "PJSIP/101,20") in new stack
    -- Called PJSIP/101
    -- PJSIP/101-00000008 is ringing
    -- Nobody picked up in 20000 ms
    -- Executing [101@from-internal:3] VoiceMail("PJSIP/104-00000007", "101") in new stack
[Mar 22 15:29:11] WARNING[80819][C-00000004]: file.c:774 ast_openstream_full: File vm-intro does not exist in any format
[Mar 22 15:29:11] WARNING[80819][C-00000004]: file.c:1247 ast_streamfile: Unable to open vm-intro (format (ulaw)): No such file or directory
  == Spawn extension (from-internal, 101, 3) exited non-zero on 'PJSIP/104-00000007'

He talk about a vm-intro file, where is this file ? And can I put it in my dialplan or my asterisk ?
Actually I can’t let any voicemail message on the extensions.


exten => _10X,1,NoOp(First Line)
same => n,Dial(PJSIP/${EXTEN},20)
same => n,VoiceMail(${EXTEN})
same => n,Hangup()

Best regards,

I found the solution I can left some voicemail message on the extensions that I call.


exten => _10X,1,NoOp(First Line)
same => Set(CHANNEL(language)=fr)
same => n,Dial(PJSIP/${EXTEN},20)
same => n,VoiceMail(${EXTEN})
same => n,Hangup()

I add this line
same => Set(CHANNEL(language)=fr)
I think is because my core asterisk is in french.

But now I don’t know how listen the voicemail that I receive on the extensions.

I know now how to listen the voicemail mesage. Because my installation is in french, so,
I must to change the CHANNEL language before listening my voicemail message
Like this :

;===================================== VoiceMailMain
exten => *101,1,NoOp(## VoiceMail Access ##)
same => n,Set(CHANNEL(language)=fr)
same => n,VoiceMailMain(101,s)
same => n,Hangup()

the file for voicemail should be in the same directory as asterisk.conf. Generally, /etc/asterisk/voicemail.conf

Yes, he is in the same directory as asterisk.conf

You can edit your /etc/asterisk/asterisk.conf and change the language default to French if all your calls will be in French.

defaultlanguage = fr ; Default language