Can't direct dial stations on remote servers from IVR

OK got a question. Got an install with 200+ stations and using 4 servers. Server PSTN has a 4 port PRI card in it and sends the inbound DID calls to extensions on the other three servers via IAX2 trunks. The three extension servers also dial out using the same IAX2 trunks and PRI circuits. This all works fine.

Five divisions of the same company use the inbound PRI’s and I setup 5 IVR’s, one for each division(on the PSTN server). I tried to assign DID’s using the inbound routes module to the IVR’s but they would not answer. I think it’s because I had to set the context to “from-internal” in the zapata.conf file to get the DID’s to route over the IAX2 trunks to the other servers. So I went into extensions-custom and added a one line “exten => 28xx,n,Goto(ivr-x,s,1)” for each IVR and now they are answered.

The problem is that when an IVR answers and I try to dial an extension on one of the other servers it says “I am sorry that is not a valid extension” as soon as I hit the first digit of the extension number. All the IVR’s have the “Enable Direct Dial” checked in them. And I have them(extensions) listed in “Outbound Routes” with the correct IAX2 selected, but still no joy. Also the IVR choice destinations(dial 1, dial 2,…etc.) I had to set up in the “Misc. Destinations” module and they route to the other servers fine. I have two test extensions on the PSTN server and I can dial those from the IVR no problem.

any ideas where to look for the solution?

Thanks
M Wood

Figured this one out, have a new challange.Same setup as before.

some users from the legacy PBX beleive that it would be too hard for thier customers to learn the new extensions so I whipped this together.

exten => oldnum,1,macro(newnumber,newnum)

[macro-newnumber]
exten => s,1,Playback(the-number-u-dialed)
exten => s,2,SayDigits(${MACRO_EXTEN})
exten => s,3,Playback(has-been-changed-to)
exten => s,4,SayDigits(${ARG1})
exten => s,5,Playback(pls-wait-connect-call)
exten => s,6,Dial(SIP/${ARG1})

And dropped it into the extensions_custom.conf file. It works fine if the newnum is on the same server(it won’t go to voicemail though), however if the newnum is on a server connected by an IAX2 trunk then it’s “your call cannot be completed as dialed”.

any help would be appreciated.

Looked at it some more, the last line, the dial command, is messing me up. So I ran asterisk -r -vvvvv to capture calls and see how they were being treated. My direct dial to the remote extension looked like this:

– Executing [[email protected]:1] Macro(“SIP/205-08b0bdf8”, “user-callerid|SKIPTTL|”) in new stack

So, I need to feed the output from my line 6 to this, somehow, does that make sense?