IAX Routing/Peering

Hi all,

I have a question related to IAX routing. I’m a bit of a newb so please be patient if I’m using the wrong terminology :wink:

On my network I have 2 asterisk servers which will be used as PBX’s for 2 organistations. We share the building and we do have to use our own independent server. However I will get PSTN termination from a single provider who will provide a single IAX trunk. Each company then gets a their calls routed to an from their PBX’s. What I have in mind is :

PBX-A --------###########################
              # central asterisk server # --iax trunk to visp--
PBX-C --------###########################

I think I can figure out how to connect PBX A&B to the central server and the central server to the IAX provider.

What I don’t understand is how the routing is configured what do I need to do on my central server to allow either pbx to route calls to and from the external provider?

I should add that I need the central server to be transparent. IE users don’t have to dial anything to get access. A bit like a transparent proxy.

I’ve a feeling this is really simple and I’m missing something obvious.

TIA
Andy

Have a look at the Asterisk switch() command. This allows the dial plan on one Asterisk system switch control to a remote system/context.

Hi,

Thanks for the tip and it does look like it will help. What’s confusing me is what config on the central server will allow the switched call to use the IAX trunk up to the provider? Am I making sense?

TIA
Andy

ah, thats done in extensions.conf.

On your branch office pbx’s, you use a switch statement to refer to the iax2 link to the main pbx.

then in the main pbx, you use their iax.conf entry to put them in a context. in extensions.conf you add to that context things which can dial out

ie

[remote-office-incoming]
include => extensions
include => otherstuff
exten => _NXXNXXXXXX,1,Dial(IAX2/provider/${EXTEN})

thus when you dial a 10 digit number on the branch pbx, it ends up running the above on the main * box and goes out to the provider.

Good stuff, it’s becoming clear now. (which is good because was getting lost)

Would incoming routing work the same way?

I suppose the diference would be working out which asterisk to send incoming traffic to.

Also, I think it must be possible to collect cdr data at the central server. Feel free to correct me if I’m wrong.

Thanks again folks.

Actually, I haven’t asked the right question here.

What I meant was do switch statements work “both ways” between servers eg:

Outgoing from serverA switches to ServerB which routes call to PSTN
Inbound to ServerB from PSTN switches to ServerA which routes to local extension.

I saw something about reciprocal switch statements not being allowed.

Is it even worth thinking about DUNDI in this scenario or is it a case of what works for you? I should add that there is no real need for * servers to know about each others local extensions.

TIA
ANdy