Freepbx to freepbx using iax2

Hi all.
I am sure this has been much covered but when searching for it I come up with stuff that is close but not the whole 9 yards.

I originally had an asterisk box with two digium cards, TDM400 (for fax machines) and an E1 card. They mostly played well together provided you loaded them in the correct order.

Recently I bought a Sangnoma a101 and built a freepbx server and installed the TDM400 and called it pbx1. These guys just would not work together. Period.

So I put the tdm400 in its own box and created a new freepbx box called pbx2.

pbx1 deals with all the voice related calls. However there is a fax number on our digital circuit. I need to forward calls based on the DID of 888890 from the trunk of pbx1 through to pbx2 and forward it to an extension where a fax machine waits to connect.

So my plan was to create an IAX2 trunk between the two using the context from-internal. That would allow them to talk nice and share resources.

[pbx01]
disallow=all
allow=alaw&g729
type=friend
username=pbx
secret=fr3nchs0l3123
auth=plaintext
host=192.168.2.161
context=from-iax
peercontext=from-internal
qualify=yes
trunk=yes

[pbx02]
disallow=all
allow=alaw&g729
type=friend
username=pbx
secret=fr3nchs0l3123
auth=plaintext
host=192.168.2.160
context=from-iax
peercontext=from-internal
qualify=yes
trunk=yes

When I do iax2 show peers I can see that all looks well.

So how do I created a route using the DID of 888890
pbx01 —> iax2trunk ----> pbx02 ----> ext 7501

currently I am getting all resources busy.
perhaps this needs to be defined in cust extensions?

All help gratefully received.

Matt

If you google “freepbx iax trunking” you’ll find numerous examples and discussion.

Thanks for the response.
I am using freepbx 2.6.0.3 which is part of piaf.
So the option to use a trunk as the destination is not available.
From what I have read I need to setup a custom destination?

Actually setting up the IAX2 trunk has not been a problem and I have been able to call the fax machine from and internal phones from pbx1.

So I am still stuck trying to trunk as the destination???

Matt

Just use the ‘module admin’ in FreePBX to upgrade to 2.8

If not you will need to create a custom extension for each destination.

You really want the improvements.

Don’t use the peercontext variable.

Do you actually have g.729 installed.

I also suggest naming peers the same.

Second you invented another context from-iax ?

You don’t need half the stuff you have in your trunks.


[tie-trunk]
disallow=all
allow=alaw
type=friend
username=tie-trunk
secret=fr3nchs0l3123
host=192.168.2.161
context=from-internal
qualify=yes
trunk=yes
[tietrunk]
disallow=all
allow=alaw
type=friend
username=pbx
secret=fr3nchs0l3123
host=192.168.2.160
context=from-iax
qualify=yes
trunk=yes

Lastly FreePBX 2.8 allows you to use a trunk as the destination of an inbound route.