Voicemail not playing personal greeting, just system default

For some reason asterisk is ignoring the personal greeting for this extension when calls come in from the SIP trunk.

Asterisk 1.8

I can record and playback the personal greeting from the phone in the voicemail menu, and I can see it records to /var/spool/asterisk/voicemail/internal/301/unavail.wav just fine.

sip.conf for extension:



fromstring=Asterisk PBX
emailsubject=New voicemail from ${VM_CALLERID}
emailbody=New voicemail message from from ${VM_CIDNAME} (${VM_CIDNUM}) of length ${VM_DUR}\n on ${VM_DATE}\nso you might want to check it when you get a chance.\n\n

301 => 1234,A Person,voicemail@mailbox.com


exten => s,1,GotoIf(${DB_EXISTS(blacklist/${CALLERID(num)})}?blacklisted,s,1)
exten => s,2,Dial(SIP/301,5)
exten => s,3,VoiceMail(301@internal)
exten => s,4,Hangup()

And the verbose console:
== Using SIP RTP CoS mark 5
– Executing [s@from-trunk:1] GotoIf(“SIP/1VoIP-00000002”, “0?blacklisted,s,1”) in new stack
– Executing [s@from-trunk:2] Dial(“SIP/1VoIP-00000002”, “SIP/301,5”) in new stack
== Using SIP RTP CoS mark 5
– Called SIP/301
– SIP/301-00000003 is ringing
– Nobody picked up in 5000 ms
– Executing [s@from-trunk:3] VoiceMail(“SIP/1VoIP-00000002”, “301@internal”) in new stack
– <SIP/1VoIP-00000002> Playing ‘vm-intro.ulaw’ (language ‘en’)
– <SIP/1VoIP-00000002> Playing ‘beep.ulaw’ (language ‘en’)
– Recording the message
– x=0, open writing: /var/spool/asterisk/voicemail/internal/301/tmp/gOJoWP format: wav, 0x7f39ec0075e8
– User hung up
== Parsing ‘/var/spool/asterisk/voicemail/internal/301/INBOX/msg0001.txt’: == Found
== Parsing ‘/var/spool/asterisk/voicemail/internal/301/INBOX/msg0001.txt’: == Found
== Parsing ‘/var/spool/asterisk/voicemail/internal/301/INBOX/msg0001.txt’: == Found
== Spawn extension (from-trunk, s, 3) exited non-zero on ‘SIP/1VoIP-00000002’

You have serious security issues Anyone can pose as device 301 and initiate calls from your internal context. On most systems internal is allowed to make chargeable calls.

Please take time to understand what type=friend and insecure=invite really do.

I think I would want to look at the SIP debugging, as it seems likely that the peer is not responding promptly to the answer, and use RTP debug to confirm that media is being sent at the right time.

What happens you do

exten => s,1,GotoIf(${DB_EXISTS(blacklist/${CALLERID(num)})}?blacklisted,s,1)
 same => n,Dial(SIP/301,5)
 same => n,Voicemail(301@internal,u)
 same => n,Hangup()

Sorry. Thought you weren’t hearing the announcement, rather than hearing wrong one.

That ,u option did the trick! Thanks!

Now I have a slightly different problem, though. I want Asterisk to email the voicemail and delete it from the voicemail once it’d deleted. Asterisk does email out but won’t delete it automatically. I have to go into the voicemail menu to delete it.

I’ve tried this, with no luck:
301 => 1234,A Person,voicemail@mailbox.com,attach=yes|delete=1

As for the insecure option, should I set that to no or just remove it to force authentication for security?

Again thanks for all the help!

I believe the syntax is attach=yes,delete=yes

1 Like

The setting for insecure depends on whether the “port” part was wrong as well (probably was)

no is the default, so I would try just leaving it out. Also change type to peer, unless there is some specific reason to do otherwise, e.g. multiple lines on the same device in different contexts.

Ok thanks! That seemed to clear that up. I got a bogus sample off voip-info.org

I’ll just remove insecure to make it more secure.

The information on that site is now decades out of date in many cases.

The official Asterisk Wiki has a lot of good documentation in it.


1 Like

Good point. Also http://www.asteriskdocs.org/ can be safely ignored, too!

Grab the Google Personal Blocklist extension from https://chrome.google.com/webstore/detail/personal-blocklist-by-goo/nolijncfnkgaikbjbdaogikpmpbdcdef?hl=en and add these two sites

I also wrote a little guide on adding a search shortcut to Google Chrome so you just type adx in the toolbar, and then any words after that will ONLY search the official Asterisk site and wiki. You can modify it as you require.

By the way, to the original poster, @zermus: 1.8 is 7 years old, and reached “end of life” over 2 years ago.
No security fixes, patches or anything, and it’s completely unsupported.

1.8 was just what my CentOS 6 distro came with. I have since spun up a new CentOS 7 VM and put Asterisk 13 on it and ported my config over.