NO JOY Stand alone Voicemail platform

dudbug

New Member
Joined
Sep 25, 2013
Messages
11
Reaction score
1
I have created two PIAF servers. One to act as a sip gateway and the other to act as a stand-alone voicemail server. I have programmed a DID to act as the Pilot VM number. The pilot VM number comes in from a Tandem over a SIP trunk. In the inbound settings of the sip gateway I have the Pilot DID set to route to the stand-alone voicemail server via a SIP trunk. In the voicemail server, in inbound routes, I forward the Pilot DID to misc destinations which I have pointed to *97. I setup an Other (customer device) in the extensions menu.

When I call into the Pilot number the call routes to the voicemail platform and if I'm calling in directly from the device it works perfect....drops me right into the voicemail box.

When a call forward is processed and the call is redirected to the pilot number, all I get is the message that says Comedian Mail....essentially the voicemail server doesn't know which box to route to. I'm not sure how to get this to work. Does anyone have any ideas? Below is a snipet of the direct call and the redirect call:

Here is a call to the pilot xxx-330-0000 from handset xxx-330-0009 everything works.

-- Executing [+1xxx3300000@from-trunk:1] Set("SIP/SIP-Gateway-0000001c", "__FROM_DID=+1xxx3300000") in new stack
-- Executing [+1xxx3300000@from-trunk:2] Gosub("SIP/SIP-Gateway-0000001c", "app-blacklist-check,s,1()") in new stack
-- Executing [s@app-blacklist-check:1] GotoIf("SIP/SIP-Gateway-0000001c", "0?blacklisted") in new stack
-- Executing [s@app-blacklist-check:2] Set("SIP/SIP-Gateway-0000001c", "CALLED_BLACKLIST=1") in new stack
-- Executing [s@app-blacklist-check:3] Return("SIP/SIP-Gateway-0000001c", "") in new stack
-- Executing [+1xxx3300000@from-trunk:3] Set("SIP/SIP-Gateway-0000001c", "CDR(did)=+1xxx3300000") in new stack
-- Executing [+1xxx3300000@from-trunk:4] ExecIf("SIP/SIP-Gateway-0000001c", "0 ?Set(CALLERID(name)=xxx3301009)") in new stack
-- Executing [+1xxx3300000@from-trunk:5] Set("SIP/SIP-Gateway-0000001c", "__CALLINGPRES_SV=allowed_not_screened") in new stack
-- Executing [+1xxx3300000@from-trunk:6] Set("SIP/SIP-Gateway-0000001c", "CALLERPRES()=allowed_not_screened") in new stack
-- Executing [+1xxx3300000@from-trunk:7] Goto("SIP/SIP-Gateway-0000001c", "ext-miscdests,1,1") in new stack
-- Goto (ext-miscdests,1,1)
-- Executing [1@ext-miscdests:1] NoOp("SIP/SIP-Gateway-0000001c", "MiscDest: voicemail Pilot") in new stack
-- Executing [1@ext-miscdests:2] Goto("SIP/SIP-Gateway-0000001c", "from-internal,*97,1") in new stack
-- Goto (from-internal,*97,1)
-- Executing [*97@from-internal:1] Answer("SIP/SIP-Gateway-0000001c", "") in new stack
-- Executing [*97@from-internal:2] Wait("SIP/SIP-Gateway-0000001c", "1") in new stack
-- Executing [*97@from-internal:3] Macro("SIP/SIP-Gateway-0000001c", "user-callerid,") in new stack
-- Executing [s@macro-user-callerid:1] Set("SIP/SIP-Gateway-0000001c", "TOUCH_MONITOR=1380730754.28") in new stack
-- Executing [s@macro-user-callerid:2] Set("SIP/SIP-Gateway-0000001c", "AMPUSER=xxx3301009") in new stack
-- Executing [s@macro-user-callerid:3] GotoIf("SIP/SIP-Gateway-0000001c", "0?report") in new stack
-- Executing [s@macro-user-callerid:4] ExecIf("SIP/SIP-Gateway-0000001c", "1?Set(REALCALLERIDNUM=xxx3301009)") in new stack

Here is a call to xxx-330-0009 from xxx-530-5405 redirected to the pilot number xxx-320-0000:


-- Executing [+1xxx3300000@from-trunk:1] Set("SIP/SIP-Gateway-0000001d", "__FROM_DID=+1xxx3300000") in new stack
-- Executing [+1xxx3300000@from-trunk:2] Gosub("SIP/SIP-Gateway-0000001d", "app-blacklist-check,s,1()") in new stack
-- Executing [s@app-blacklist-check:1] GotoIf("SIP/SIP-Gateway-0000001d", "0?blacklisted") in new stack
-- Executing [s@app-blacklist-check:2] Set("SIP/SIP-Gateway-0000001d", "CALLED_BLACKLIST=1") in new stack
-- Executing [s@app-blacklist-check:3] Return("SIP/SIP-Gateway-0000001d", "") in new stack
-- Executing [+1xxx3300000@from-trunk:3] Set("SIP/SIP-Gateway-0000001d", "CDR(did)=+1xxx3300000") in new stack
-- Executing [+1xxx3300000@from-trunk:4] ExecIf("SIP/SIP-Gateway-0000001d", "0 ?Set(CALLERID(name)=xxx5305405)") in new stack
-- Executing [+1xxx3300000@from-trunk:5] Set("SIP/SIP-Gateway-0000001d", "__CALLINGPRES_SV=allowed_not_screened") in new stack
-- Executing [+1xxx3300000@from-trunk:6] Set("SIP/SIP-Gateway-0000001d", "CALLERPRES()=allowed_not_screened") in new stack
-- Executing [+1xxx3300000@from-trunk:7] Goto("SIP/SIP-Gateway-0000001d", "ext-miscdests,1,1") in new stack
-- Goto (ext-miscdests,1,1)
-- Executing [1@ext-miscdests:1] NoOp("SIP/SIP-Gateway-0000001d", "MiscDest: voicemail Pilot") in new stack
-- Executing [1@ext-miscdests:2] Goto("SIP/SIP-Gateway-0000001d", "from-internal,*97,1") in new stack
-- Goto (from-internal,*97,1)
-- Executing [*97@from-internal:1] Answer("SIP/SIP-Gateway-0000001d", "") in new stack
-- Executing [*97@from-internal:2] Wait("SIP/SIP-Gateway-0000001d", "1") in new stack
-- Executing [*97@from-internal:3] Macro("SIP/SIP-Gateway-0000001d", "user-callerid,") in new stack
-- Executing [s@macro-user-callerid:1] Set("SIP/SIP-Gateway-0000001d", "TOUCH_MONITOR=1380731066.29") in new stack
-- Executing [s@macro-user-callerid:2] Set("SIP/SIP-Gateway-0000001d", "AMPUSER=xxx5305405") in new stack
-- Executing [s@macro-user-callerid:3] GotoIf("SIP/SIP-Gateway-0000001d", "0?report") in new stack
-- Executing [s@macro-user-callerid:4] ExecIf("SIP/SIP-Gateway-0000001d", "1?Set(REALCALLERIDNUM=xxx5305405)") in new stack
-- Executing [s@macro-user-callerid:5] Set("SIP/SIP-Gateway-0000001d", "AMPUSER=") in new stack
-- Executing [s@macro-user-callerid:6] Set("SIP/SIP-Gateway-0000001d", "AMPUSERCIDNAME=") in new stack
-- Executing [s@macro-user-callerid:7] GotoIf("SIP/SIP-Gateway-0000001d", "1?report") in new stack
-- Goto (macro-user-callerid,s,14)
-- Executing [s@macro-user-callerid:14] GotoIf("SIP/SIP-Gateway-0000001d", "0?continue") in new stack
-- Executing [s@macro-user-callerid:15] Set("SIP/SIP-Gateway-0000001d", "__TTL=64") in new stack
-- Executing [s@macro-user-callerid:16] GotoIf("SIP/SIP-Gateway-0000001d", "1?continue") in new stack
-- Goto (macro-user-callerid,s,27)
-- Executing [s@macro-user-callerid:27] Set("SIP/SIP-Gateway-0000001d", "CALLERID(number)=xxx5305405") in new stack
-- Executing [s@macro-user-callerid:28] Set("SIP/SIP-Gateway-0000001d", "CALLERID(name)=xxx5305405") in new stack
-- Executing [s@macro-user-callerid:29] Set("SIP/SIP-Gateway-0000001d", "CDR(cnum)=xxx5305405") in new stack
-- Executing [s@macro-user-callerid:30] Set("SIP/SIP-Gateway-0000001d", "CDR(cnam)=xxx5305405") in new stack
-- Executing [s@macro-user-callerid:31] Set("SIP/SIP-Gateway-0000001d", "CHANNEL(language)=en") in new stack
-- Executing [*97@from-internal:4] Macro("SIP/SIP-Gateway-0000001d", "get-vmcontext,") in new stack
-- Executing [s@macro-get-vmcontext:1] Set("SIP/SIP-Gateway-0000001d", "VMCONTEXT=") in new stack
-- Executing [s@macro-get-vmcontext:2] GotoIf("SIP/SIP-Gateway-0000001d", "1?200:300") in new stack
-- Goto (macro-get-vmcontext,s,200)
-- Executing [s@macro-get-vmcontext:200] Set("SIP/SIP-Gateway-0000001d", "VMCONTEXT=default") in new stack
[2013-10-02 11:24:27] ERROR[28879]: app_voicemail.c:11081 acf_mailbox_exists: MAILBOX_EXISTS requires an argument (<mailbox>[@<context>])
[2013-10-02 11:24:27] WARNING[28879]: func_logic.c:192 acf_if: Syntax IF(<expr>?[<true>][:<false>]) (expr must be non-null, and either <true> or <false> must be non-null)
[2013-10-02 11:24:27] WARNING[28879]: func_logic.c:193 acf_if: In this case, <expr>='', <true>='SUCCESS', and <false>='FAILED'
-- Executing [*97@from-internal:5] Set("SIP/SIP-Gateway-0000001d", "VMBOXEXISTSSTATUS=") in new stack
-- Executing [*97@from-internal:6] GotoIf("SIP/SIP-Gateway-0000001d", "0?mbexist") in new stack
-- Executing [*97@from-internal:7] VoiceMailMain("SIP/SIP-Gateway-0000001d", "") in new stack
-- <SIP/SIP-Gateway-0000001d> Playing 'vm-login.gsm' (language 'en')
[2013-10-02 11:24:35] WARNING[28879]: app_voicemail.c:9834 vm_authenticate: Couldn't read username
-- Executing [h@from-internal:1] Hangup("SIP/SIP-Gateway-0000001d", "") in new stack
== Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/SIP-Gateway-0000001d'

How do I get either the Voicemail server to route to the appropriate mailbox. I'm sure I probably need to modify both servers, but have run out of ides.

Thanks in advance for your suggestions.

Jake
 
I'm trying to setup a voicemail platform for cell phones. I saw another post from Sparkle Pony person, and that is exactly what I'm trying to accomplish but on a scale of 100-1000 phones. She was able to handle the redirects and I'm not sure how she routed on the redirects.

As for the avatar, it is a parody on Star Trek...Resistance is Futile :)
 
I have been following this guide. It is plain as day as to what I'm supposed to do: http://www.asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/Voicemail_id293070.html It states the following:

Dialplan requirements

The dialplan of the voicemail server can be fairly simple. Two needs must be satisfied:
  1. Receive incoming calls and direct them to the appropriate mailbox
  2. Handle incoming calls from users wishing to check their messages
The system that is passing calls to the voicemail server should set some SIP headers in order to pass additional information to the voicemail server. Typically, this information would include the mailbox/username that is relevant to the call. In our example, we are going to set the headers X-Voicemail-Mailbox and X-Voicemail-Context, which will contain information we wish to pass to the voicemail server.[88]
If the source system is also an Asterisk system, you might set the headers using the SIPAddHeader() voicemail application, in a manner similar to this:
exten => sendtovoicemail,1,Verbose(2,Set SIP headers for voicemail)
same => n,SipAddHeader(X-Voicemail-Mailbox: <mailbox number>)
same => n,SipAddHeader(X-Voicemail-Context: voicemailbox)
Note that this dialplan does not go on the voicemail server. It would only be useful if one of the other servers in your environment was also an Asterisk server. If you were using a different kind of server, you would need to find out how to set custom headers in that platform, or find out if it already uses specific headers for this sort of thing, and possibly modify the dialplan on the voicemail server to handle those headers.
The voicemail server will need an extensions.conf file containing the following:
[voicemailbox]
; direct incoming calls to a mailbox
exten => Deliver,1,NoOp()
same => n,Set(Mailbox=${SIP_HEADER(X-Voicemail-Mailbox)})
same => n,Set(MailboxContext=${SIP_HEADER(X-Voicemail-Context)})
same => n,VoiceMail(${Mailbox}@${MailboxContext})
same => n,Hangup()

; connect users to their mailbox so that they can retrieve messages exten =>
Retrieve,1,NoOp()
same => n,Set(Mailbox=${SIP_HEADER(X-Voicemail-Mailbox)})
same => n,Set(MailboxContext=${SIP_HEADER(X-Voicemail-Context)})
same => n,VoiceMailMain(${Mailbox}@${MailboxContext})
same => n,Hangup()
sip.conf requirements
In the sip.conf file on the voicemail server, not only are entries required for all the mailboxes for message waiting notification, but some sort of entry is required to define the connection between the voicemail server and the rest of the SIP environment:
[VOICEMAILTRUNK]
type=peer
defaultuser=voicemail
fromuser=voicemail
secret=s0m3th1ngs3cur3
canreinvite=no
host=<address of proxy/registrar server>
disallow=all
allow=ulaw
dtmfmode=rfc2833
context=voicemailbox

This is brilliant!! I need to mark the calls as they leave the SIP gateway...unfortunately, I'm not sure where to put:

exten => sendtovoicemail,1,Verbose(2,Set SIP headers for voicemail)
same => n,SipAddHeader(X-Voicemail-Mailbox: <mailbox number>)
same => n,SipAddHeader(X-Voicemail-Context: voicemailbox)

I know that this needs to be part of the dial plan when sending calls to the voicemail server, but am not sure where to put it.

I'm also uncertain where to put the following on the Voicemail server as PIAF doesn't seem to use extensions.conf

[voicemailbox]
; direct incoming calls to a mailbox
exten => Deliver,1,NoOp()
same => n,Set(Mailbox=${SIP_HEADER(X-Voicemail-Mailbox)})
same => n,Set(MailboxContext=${SIP_HEADER(X-Voicemail-Context)})
same => n,VoiceMail(${Mailbox}@${MailboxContext})
same => n,Hangup()

; connect users to their mailbox so that they can retrieve messages exten =>
Retrieve,1,NoOp()
same => n,Set(Mailbox=${SIP_HEADER(X-Voicemail-Mailbox)})
same => n,Set(MailboxContext=${SIP_HEADER(X-Voicemail-Context)})
same => n,VoiceMailMain(${Mailbox}@${MailboxContext})
same => n,Hangup()
 
Thank you, this added the context brilliantly.....my problem is that the custom context is getting removed during the call hair-pin.

Ugh!

Jake
 
Ok so I forgot that Asterisk is actually a B2BUA by design. Instead of depending on another switch to get SIP correct, I just used the follow me features and that works much better. Now to get SMS working.....That should be a treat! (sarcasm intended)
 

Members online

Forum statistics

Threads
26,688
Messages
174,412
Members
20,258
Latest member
RandomPerson
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top