Extension dialing from one trunk to another system over IAX

I have two systems linked together over IAX. The internal calling works just fine. The Main system has a PRI in it and the other system is using SIP trunks. The Main system is at 3.211 /asterisk 1.8 and the other one is at 6.12 / Asterisk 11.18. Both systems are in Device /User mode (I know it isn’t supported, but they needed Hot desking). This is a busy Dr office(s). They are on two floors. Initially we had them on a single system, they outgrew the Call Flow capabilities, so we installed a second system for the downstairs offices, hence the IAX connection. Now they are (All of a sudden, and we did tell them that it wouldn’t work) needing to be able to have callers dialing into the PRI on the main office system have the ability to direct dial extensions (users) on the downstairs system. I have tried Misc App and Misc Destinations. Neither work. Does anyone have any ideas how I can get this to work, short of upgrading them to a single system with the latest Freepbx software.

Thanks for any ideas!

A simple, but pain-in-the-butt way to do it is to add the extensions from the second system as virtual extensions on the first.

Set up the extension on the PRI connected “main machine” as an “Other” type and, for the dial string, use the SIP/[email protected] format as your dial string.

There are other ways as well, including (IIRC) DISA. The advantage is that, once you get it working, it should be reasonably flexible and scalable. The downside is getting it set up…

There is an elegant way to do this with FreeBPX 12 (won’t work in 13). To enable direct 4 digit dialing from all IVRs on the system, add following to extensions_custom.conf:

exten => _XXXX,1,Noop(Entering user defined context [from-did-direct-ivr-custom] in extensions_custom.conf)
exten => _XXXX,n,goto(outbound-allroutes,${EXTEN},1)

The more you can refine the pattern match the better. So if the remote system is only 300 series extensions, change the pattern to _3XX

So you are wanting a user on pbx upstairs to be able to pickup there phone and dial a ext on the upstairs pbx.

Or from the downstairs system dial a user from the ivr

Thanks guys for the suggestions;

Tried your idea, no go I got a “We have not recieved a response”


Forgive my ignorance on your idea, do I need to restart Asterisk for it to work? If not then I got the same response that I got with Dave’s idea.


Users on the Main system and the downstairs systems can dial each other directly, that is fine. The issue is that the dial extension function does not work from an ivr on one system to the other. For instance, if I dial a DID on the Main system and get the IVR I cannot dial an extension on the downstairs system. We get the “We have not recieved a valid response”, we can however dial a local extension and get through.


No, but you do need to reload the dialplan:

amportal r


That got it. Thanks!

What would work in version 13? Or does it work already, he said being to lazy at the moment to try it out :))

1 Like

Would that work in FreePBX 13 and 14 too?
If not, I have two feature requests open to make this work.

  1. Allow wildcards in IVR
  2. Fix the trunk destination option in IVR. “Trunks” is selectable as an option but doesn’t work.

Did not test, but you could add custom entries in a directory and tie it to an IVR.

Not really practical with about a thousand of them, but thanks for the tip.

True, which is why i suggested bulk handler to be available in more modules, in FreePBX 15. Hopefully. :crossed_fingers:

For each IVR you want to dial extensions on a remote system from, you can add a little bit of custom context.
If your ivr context is called [ivr-2], then add this to extensions_custom.conf and set the match pattern accordingly depending on what the numbering pattern of your extensions is:

exten => _[1-38]XXX,1,Noop(Custom Dialplan for your extensions on remote system)
exten => _[1-38]XXX,n,goto(outbound-allroutes,${EXTEN},1)
1 Like