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.
[general]
format=wav
serveremail=asterisk@box
attach=yes
delete=yes
fromstring=Asterisk PBX
maxmessage=300
minmessage=1
maxgreet=30
maxsilence=10
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
[internal]
301 => 1234,A Person,voicemail@mailbox.com
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.
[from-trunk]
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()
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.
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.
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. http://forums.asterisk.org/viewtopic.php?f=13&t=96203&start=0
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.