How to Connect 2 Trixboxes with IAX2 Trunks
I am going berserk!
I have 2 trixboxes and have setup a IAX2 peer between the two. The peer sessions appear to be good because I get the following output from the Asterix CLI when I run the IAX2 show peers command:
freePBX 2.2.3 on xxx.xxx.xxx.xxx
Name/Username Host Mask Port Status
ToVoip2/trixbox xxx.xxx.xxx.138 (S) 255.255.255.255 4569 OK (1 ms)
1 iax2 peers [1 online, 0 offline, 0 unmonitored]
Verbosity is at least 1
FreePBX 2.3.1.3 on xxx.xxx.xxx
Name/Username Host Mask Port Status
ToVoip/trixboxa xxx.xxx.xxx.205 (S) 255.255.255.255 4569 OK (1 ms)
1 iax2 peers [1 online, 0 offline, 0 unmonitored]
I have an outbound rules on both boxes with appropriate dial rules. ie 1XX on the box with 2XX extensions and vice-versa on the other box.
All I get when I attempt to dial a 1XX extension from Box2 is is "All circuits are busy now" and when I try dialing a 1XX extension on Box 1 it's "cannot complete call as dialed"
Help
This is how GSnover taught me how to do this:
Here is an IAX2 trunk that we are using right now:
Outgoing Settings:
Trunk Name: Plasma-Peer
Peer Details:
allow=speex
disallow=all
host=66.197.221.49
secret=VoIPIsMyFriend
type=peer
username=Plasma-User
Incoming Settings:
User Context: Plasma-User
User Details:
allow=speex
context=from-internal
disallow=all
host=66.197.221.49
secret=VoIPIsMyFriend
type=user
On the other machine, set up the trunk identically, except put the public address of YOUR TB in their definition - so they are looking at you and you are looking at them - the host= line.
Once this is done, you still have to have some sort of dialplan rules to accept traffic from them or direct traffice to them - easiest is just an outbound route that says the following:
Our TB - we use extensions 14xx, and Plasma uses extensions 3xx, so my outbound route is:
Plasma
Pattern:
3xx
Trunk:
Plasma-Peer
On his end, he would call the route Barking Dog, so
Barking Dog
Pattern:
14xx
Trunk:
Plasma Peer
Giving the user the context of from-internal gives them the ability to use your lines - if you just want intercom and transfer, set the context to from-pstn. Now, you have intercom and transfer ability between sites. To make a call ringing into one location ring at another, you either need to modify the dial plan (hard), or set up Miscellaneous Destinasions (easy) and then create an inbound route to point to the Misc. Dest. Set your FIrewall/Router to forward UDP port 4569 to the IP of the TB on both subnets, and you should be in business.
And give you my findings!
All circuits are busy now, please try again later.
Any other ideas?
Can you post your settings for both boxes?
...and you have two iax trunks on each box?
Box 1 (Free Pbx 2.2.3)
Trunk Name: ToVoip2
Peer Details
allow=speex
disallow=all
host=xxx.xxx.xxx.138 (xxx's are the actual IP of box2)
secret=12345
type=peer
username=trixboxb
User Details:
allow=speex
context=from-internal
disallow=all
host=xxx.xxx.xxx.138 (xxx's are the actual IP of box2)
secret=12345
type=user
Outbound Routes
Route Name: ToVoip2
Dial Patterns: 2XX
Box 2 (Free Pbx 2.3.1.3)
Trunk Name: ToVoip
Peer Details
allow=speex
disallow=all
host=xxx.xxx.xxx.205 (xxx's are the actual IP of box1)
secret=12345
type=peer
username=trixboxb
User Details:
allow=speex
context=from-internal
disallow=all
host=xxx.xxx.xxx.205 (xxx's are the actual IP of box1)
secret=12345
type=user
Outbound Routes
Route Name: ToVoip
Dial Patterns: 1XX
Only 1 IAX trunk on each box
Several Sip trunks on Box 1 and 1 Sip trunk on Box 2
I am trying to give myself some redundancy....
Truly appreciate the help.
are these boxes in the same lan?
On your original setup
"All circuits are busy now" indicates it was trying to get an outside line but could not find a route.
and "cannot complete call as dialed" indicates it was trying to dial an extension that did not exist or could not find.
I am assuming you are on the same LAN as a test.
As a test I would put in GSnover's example verbatim except for the host=
This worked in our shop, then we just modified it to suit our criteria.
I will be gone for a short time. Let me know what happens.
Rather than re write it, I'll just post a link:
http://pbxinaflash.com/forum/showthread.php?t=289
Robert Keller - FtOCC
The VoIP Experience
Official FreePBX Training
Hi Guys;
Thanks for all of your help. I have tried everything markwho suggested then tried cosmic wombats suggestions, as per the link.
A little more information, both boxes have public IP's and are fully open to each other and the world.
Again......help, aider moi, au secours...........
Should the type not = friend, instead of peer?
Hello All;
I finally got this puzzle working properly! I think it was an error on my part assuming that the "trunk name" had nothing to do with anything when in fact it would appear that it does.
Anywhoo just wanted to thank everyone for their help and I would be glad to post my settings if anyone requires.
Cheers
Would love to see your solution.
Box "A"
Trunk Name:voip2
context=from-internal
host=xxx.xxx.xxx.138 (Box "B" Public IP)
secret=123456
trunk=yes
type=friend
username=voip1
User Details: EMPTY
Register String: voip1:123456@xxx.xxx.xxx.138 (Box "B" Public IP)
Box "B"
Trunk Name:voip1
context=from-internal
host=xxx.xxx.xxx.142 (Box "A" Public IP)
secret=123456
trunk=yes
type=friend
username=voip2
User Details: EMPTY
Register String: voip2:123456@xxx.xxx.xxx.142 (Box "A" Public IP)
With this config I am able to connect to 2XX extension on Box "B" from 1XX etensions on Box "A" and vice versa.
I am also able to reach outsde trunks on Box "A" from extensions on Box "B".
Nice, With that configuration do you successfully pass along the original caller ID?
So if you call an extension from box a to box b and that extension picks up (box b) you get the correct caller id from (box a)
Thanks.
For anyone with this config, make sure you have outbound routing correct, so box B will look out to the box A trunk, or vice versa, depending on your config.
bigbadcliff,
Can you post your Outbound Routes on BoxA and B to make this possible?
thanks,
I followed this and it worked 100% - i can now trunk between two boxes.
Question: what is "Incoming Settings" used for then? I've got it blank and we can call from either side, so when would this be used?
I have followed the exact steps and what I get is a rining trunk trough FOP but no ringing. Is there something that I should be checking? I have Trixbox 2.4 BoxA Trixbox 2.6 BoxB. I am trying to route calls from TrixboxA to TrixboxB FXO port. So when I dial 10 digit it goes off the TixboxB IAX2 Trunk wich then TrixboxB dial out on the FXO port. Outbound route on TrixboxB is set for 10 digit dialing and use zap0 trunk.
Any help would be great.
Thanks
Tommaso,
This is how I have mine setup.
BoxA (has FXO card)
Outbound Route
Dial Patterns:
011.
1NXXNXXXXXX
1XX
5|XXX (this is for my intertrunk dialing)
NXXNXXXXXX
NXXXXXX
Trunk Sequence (I have 4 FXO card)
ZAP/1
ZAP/3
ZAP/4
ZAP/2
IAX/voip2
BoxB (IAX Trunk Only)
Outbound Route
Dial Patterns:
011.
1NXXNXXXXXX
1XX
5|XXX (this is for my intertrunk dialing)
NXXNXXXXXX
NXXXXXX
Trunk Sequence
IAX/voip1
Hope this help.
Hi guys,
I am able to call all extensions between Box A (Extensions 2xx) and Box B (Extensions 3xx) using bigbadcliff configs. But now what happen is when an external call is comming to Box A it gets picked up by the IVR which needs to connect to someone on Box B (ie Extsions 3xx) straight from IVR option. How would I do this? any suggestions of how to configure this on Box A to that the call gets transfers on Box B Extension.
Please Help
Thanks
Dhaval
destination - this is where Miscellaneous Destinations come in - create one for the extensio you want the IVR to be able to hit, and then it can be a destination referenced by the IVR.
Greg
Thanks for the reply Greg. But if I create the Extension (3xx) on Box A which is the actual extension in Box B It dosnt route the call it just say the the extension you calling is not available. So I dont know how to reference the Misc Extension in Box A to the actual Extension in Box B.
Thanks
Dhaval
and then a Dial-Plan route that says if it sees 3xx, use the IAX2 trunk and ge the extension there.
Greg
Awasome. That works all good. Thanks for the help.
Dhaval
I followed this thread and I have an IAX trunk between 2 TrixBox systems. I can call each extension from A to B and B to A no problems. I can make calls from the B system through the A systems PRI trunk as well. What I can't figure out is how to make incoming calls route to the B system ? My A system has extension 2X and My B system has extension 3X . If I call my primary number on the A system the A system does not know how to reach the 3X extensions I get a message indicating and invalid extension. Can anyone give me an idea what I need to do in order to accomplish this ? What I want to do is be able to route a specific DID to the B system. I am not sure if the misc destination is the only method to make this work.
Thanks
Ethan came up with this a little while ago. It is so much slicker than any of the other solutions using virtual extensions and such.
If you need help doing it why not post a bounty and use one of the excellent consultants that hang out in these forums?
Scott
Hi Guy both the server connect but no audio why?
New Update
There one way audio why?
Thank
IAX2 can't have one way audio, did you use SIP by accident?
i have 2 TB servers
First TB
iax2 user name : 111
password : 111
ip : 192.168.1.66
range of users : 1000 : 1999
Outbound Routes
Dial Patterns: 1XXX
Second TB
iax2 user name : 222
password : 222
ip : 10.0.0.2
range of users : 2000 : 2999
Outbound Routes
Dial Patterns: 2XXX
First TB configuration to connect to Second
Create new IAX2 Trunk
Trunk Name: Server2
Peer Details:
context=from-internal
host=10.0.0.2
qualify=yes
type=peer
secret=222
username=222
User Context: Server1User
User Details:
context=from-internal
host=10.0.0.2
secret=111
type=user
Create outbound route:
Dial Patterns: 2|XXX
trunk Sequence: IAX2/Server2
Second TB Configuration to connect to First
Create a new IAX2 Trunk
Trunk Name: Server1
Peer Details:
context=from-internal
host=192.168.1.66
qualify=yes
type=peer
secret=111
username=111
User Context: Server2User
User Details:
context=from-internal
host=192.168.1.66
secret=222
type=user
Create outbound route:
Dial Patterns: 1|XXX
trunk Sequence: IAX2/Server1
my 1st Problem :
when i call any one from server 1 to server 2 the callerID appear that 222
and from server 2 to server 1 the callerID appears that 111
i want to know why is that happen and how i can change the callerID to the user ID what i mean i want that when i call user 1001 from user 2001 the callerID which appear 2001 not 111
and when i call 2001 from user 1001 the callerID which appear 1001 not 222
how i can do that .
my 2ndproblem :
when i call from server 1 to server 2 or vice versa i can hear 4 or 5 rings with caller before the receiver ringing how i can stop that i want it ring with the double sides in the same time with no latency .
my 3rd problem :
we re using the lan ip to access to the server right i want to have an public static IP but dont allow any one to access to my page accept my public static ip and lan ip
what i mean i want to make a public static IP to my TB but i dont want any one to access TB accept me . how i can do that and i dont want to show my page as a restricted area or show its user name and password requirements "i dont want to show the window of user name and password"
i want to stop accessing the web page from public static IP and access it from lan ip or from my public static IP my ip only
my 4th problem :
how i can setup any FXO card and how i can it ? and how i can know the channels ?
my 5th problem :
i want to connect mt TB with a PRI line that is landline which have 30 Separated lines
which hardware which ill need and how i can make calls through them . i want to make every line from the 30 lines have its trunk and dial pattern . i hope any body can help me and what is the configuration will needed ?
details about platforms :
TB v2.6.2.1
processor 3GHz
Ram 1G
FXO cards : openvox A400P02 & digium 1TDM402BF
I am also having problem with my IAX2 trunking. It will say "your call cannot be proceeded as dialled".
Below are my settings
Machine A
Outgoing Settings
Trunk Name: systema
PEER Details:
context=from-internal
host=XXX.XXX.XXX.65
qualify=yes
secret=XXXXXXa-pass
type=peer
username=systema-user
Incoming Settings
USER Context: systemb-user
USER Details:
context=from-internal
host=XXX.XXX.XXX.65
secret=XXXXXXb-pass
type=user
Machine B
Trunk Name: systemb
PEER Details:
context=from-internal
host=XXX.XXX.XXX.77
qualify=yes
secret=XXXXXXb-pass
type=peer
username=systemb-user
User Context: systema-user
User Details:
context=from-internal
host=XXX.XXX.XXX.77
secret=XXXXXXa-pass
type=user
outbound route for systema
dial pattern 80XX <----systema extension pattern
trunk Sequence IAX2/systema
outbound route for systemb
dial pattern 60XX <----systemb extension pattern
trunk Sequence IAX2/systemb
I am hoping someone can spot the error or mistake I have made that I am unable to spot myself. Any help and advise is appreciated


Member Since:
2008-01-16