IAX2 Trunk between 2 Trixboxes

tshuttleworth
Posts: 2
Member Since:
2009-01-09

All,

I know this topic has been beat to death, BUT, before I get flamed let me explain my scenerio. All I am trying to do is trunk 2 trixboxes together. I have scoured the internet for information regarding the IAX2 protocol. I even read the IETF Draft specs. I have not come across a COMPLETE solution regarding this topic. The closest I came was the guide at http://keystoneit.wordpress.com/2006/08/16/trunking-two-trixbox-s.... This solution works, HOWEVER, it does not take IAX REGISTRATION into consideration. The guide, mentioned above, only works when IP addresses do not change. Now, my understanding (from doing research) is that IAX Registration takes care of that aspect. It sends source and destination IP's in the IAX frames it uses to register the peer. I'm not sure how this would react in the case of NAT connections. Please correct me if I'm wrong. I read somewhere that one solution is to set up a VPN tunnel and use local IP's. That sounds a little over the top IMO. ANY help is GREATLY appreciated!

Here is my configuration. What am I missing?

************************************
* Topology
************************************

Server1.domain.com -> Linksys Router (WRT54G) -> Cable Modem -> Internet
-dynamic IP address
-Ports 4569, 5060, 10000 - 20000 forwarded to Trixbox
-Trixbox version 2.6.1.13 (stand-alone box)
-2 fully functional SIP trunks to DID providers
-2 fully functional SIP extensions
-fully functional Dynamic DNS name

Server2.domain.com -> Linksys Router (WRT54GS) -> DSL Modem -> Internet
-dynamic IP address
-Ports 4569, 5060, 10000 - 20000 forwarded to Trixbox
-Trixbox version 2.6.1.13 (virtual machine)
-fully functional Dynamic DNS name

************************************
* FreePBX Configuration
************************************

-------------
- Server1 -
-------------

Trunk Name: Server2

Peer Details:
context=from-internal
host=Server2.domain.com
qualify=yes
secret=Server2Secret
type=peer
username=Server2User

User Context: Server1User

User Details:
context=from-internal
host=Server2.domain.com
secret=Server1Secret
type=user

Registration: Server2User:Server2Secret@Server2.domain.com

-------------
- Server2 -
-------------

Trunk Name: Server1

Peer Details:
context=from-internal
host=Server1.domain.com
qualify=yes
secret=Server1Secret
type=peer
username=Server1User

User Context: Server2User

User Details:
context=from-internal
host=Server1.domain.com
secret=Server2Secret
type=user

Registration: Server1User:Server1Secret@Server1.domain.com

************************************
* FreePBX PBX Status
************************************

-------------
- Server1 -
-------------

IAX Registry:
Host dnsmgr Username Perceived Refresh State
[Server2IP]:4569 N Server2Use 60 Rejected

IAX Peers:
Name/Username Host Mask Port Status
Server2/Server2 [Server2IP] (S) 255.255.255.255 4569 OK (125 ms)
1 iax2 peers [1 online, 0 offline, 0 unmonitored]

-------------
- Server2 -
-------------

IAX Registry:
Host dnsmgr Username Perceived Refresh State
[Server1IP]:4569 N Server1Use 60 Rejected

IAX Peers:
Name/Username Host Mask Port Status
Server1/Server1 [Server1IP] (S) 255.255.255.255 4569 OK (91 ms)
1 iax2 peers [1 online, 0 offline, 0 unmonitored]

************************************
* IAX2 SET DEBUG Info
************************************

-------------
- Server1 -
-------------

Tx-Frame Retry[000] -- OSeqno: 000 ISeqno: 000 Type: IAX Subclass: REGREQ
Timestamp: 00011ms SCall: 04567 DCall: 00000 [Server2IP:4569]
USERNAME : Server2User
REFRESH : 60

Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 001 Type: IAX Subclass: ACK
Timestamp: 00011ms SCall: 00512 DCall: 04567 [Server2IP:4569]
Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 001 Type: IAX Subclass: REGREJ
Timestamp: 00008ms SCall: 00512 DCall: 04567 [Server2IP:4569]
CAUSE : Registration Refused
CAUSE CODE : 29

Tx-Frame Retry[-01] -- OSeqno: 001 ISeqno: 001 Type: IAX Subclass: ACK
Timestamp: 00008ms SCall: 04567 DCall: 00512 [Server2IP:4569]
Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 000 Type: IAX Subclass: REGREQ
Timestamp: 00005ms SCall: 16048 DCall: 00000 [Server2IP:4569]
USERNAME : Server1User
REFRESH : 60

Tx-Frame Retry[-01] -- OSeqno: 000 ISeqno: 001 Type: IAX Subclass: ACK
Timestamp: 00005ms SCall: 03747 DCall: 16048 [Server2IP:4569]
Tx-Frame Retry[000] -- OSeqno: 000 ISeqno: 001 Type: IAX Subclass: REGREJ
Timestamp: 00007ms SCall: 03747 DCall: 16048 [Server2IP:4569]
CAUSE : Registration Refused
CAUSE CODE : 29

-------------
- Server2 -
-------------

Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 000 Type: IAX Subclass: REGREQ
Timestamp: 00003ms SCall: 10953 DCall: 00000 [Server1IP:4569]
USERNAME : Server2User
REFRESH : 60

Tx-Frame Retry[-01] -- OSeqno: 000 ISeqno: 001 Type: IAX Subclass: ACK
Timestamp: 00003ms SCall: 04528 DCall: 10953 [Server1IP:4569]
Tx-Frame Retry[000] -- OSeqno: 000 ISeqno: 001 Type: IAX Subclass: REGREJ
Timestamp: 00003ms SCall: 04528 DCall: 10953 [Server1IP:4569]
CAUSE : Registration Refused
CAUSE CODE : 29

Rx-Frame Retry[ No] -- OSeqno: 001 ISeqno: 001 Type: IAX Subclass: ACK
Timestamp: 00003ms SCall: 10953 DCall: 04528 [Server1IP:4569]
Tx-Frame Retry[000] -- OSeqno: 000 ISeqno: 000 Type: IAX Subclass: REGREQ
Timestamp: 00016ms SCall: 05950 DCall: 00000 [Server1IP:4569]
USERNAME : Server1User
REFRESH : 60

Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 001 Type: IAX Subclass: ACK
Timestamp: 00016ms SCall: 08793 DCall: 05950 [Server1IP:4569]
Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 001 Type: IAX Subclass: REGREJ
Timestamp: 00001ms SCall: 08793 DCall: 05950 [Server1IP:4569]
CAUSE : Registration Refused
CAUSE CODE : 29



SkykingOH
Posts: 9537
Member Since:
2007-12-17
You don't need port 5060 nor

You don't need port 5060 nor 10000-20000 for IAX, those are for SIP and RTP.

IAX is not an Internet Standard and you are over complicating the scenario. The definitive docs are at asterisk.org and voip-info.org.

I posted this config last night and it works fine for me in numerous installations, all dynamic registering to a static. I have posted this example many times, I am not sure why you did not see it.

The other issue is that you are using the username in the trunk config to register to, that username is for originated traffic. You need to register to the trunk name:secret on system 2.

On the box with the static IP (IP for example 1.1.1.1):

Trunk Name: Remote1

disallow=all
allow=gsm 
context=from-internal
host=dynamic
qualify=yes
secret=mysuperdupersecret
type=friend

On the box with the dynamic IP:

disallow=all
allow=gsm
username=Remote1
secret=mysuperdupersecret
type=friend
qualify=yes
host=1.1.1.1
context=from-internal

Register string:  Remote1:mysuperdupersecret@1.1.1.1
--

Scott

aka "Skyking"



tshuttleworth
Posts: 2
Member Since:
2009-01-09
Scott, You are a genius!

Scott,

You are a genius! That is about the only configuration I did NOT try! hehehe :-) Thank you sooooo much, I hope this helps everyone else out there. Here are my final WORKING configs:

NOTE 1: BOTH of my routers have dynamic IP's hence both trixbox configs containing the 'host=dynamic' string.
NOTE 2: Both register strings specify the dynamic DNS name for the trixbox servers (because of NOTE 1)

-------------
- Server1 -
-------------

Trunk Name: Remote1

Peer Details:
disallow=all
allow=gsm
context=from-internal
host=dynamic
qualify=yes
secret=mysuperdupersecret
type=friend

User Context: N/A

User Details: N/A

Register: Remote2:mysuperdupersecret@Server2.domain.com

-------------
- Server2 -
-------------

Trunk Name: Remote2

Peer Details:
disallow=all
allow=gsm
context=from-internal
host=dynamic
qualify=yes
secret=mysuperdupersecret
type=friend

User Context: N/A

User Details: N/A

Register: Remote2:mysuperdupersecret@Server1.domain.com



jay123
Posts: 18
Member Since:
2009-04-12
Hi tshuttleworth, Don't you

Hi tshuttleworth,

Don't you need to configure the User Context and User Details for both trixbox?

Can you please show me a complete setting here?

Thanks a lot



SkykingOH
Posts: 9537
Member Since:
2007-12-17
Quote: Don't you need to
Quote:
Don't you need to configure the User Context and User Details for both trixbox?

No, the type==friend takes care of that hence the n/a next to those settings, leave them blank.

Quote:
Can you please show me a complete setting here?

That is complete does it not work for you?

--

Scott

aka "Skyking"



jay123
Posts: 18
Member Since:
2009-04-12
It is working now, thanks so

It is working now, thanks so much for your advice.



efx456
Posts: 132
Member Since:
2009-09-01
tshuttleworth, Thank you for

tshuttleworth,

Thank you for this very helpful post and solution. I am trying to do the same thing but having some problems. My question is this:

On Server1 you posted the following registration string:
Remote2:mysuperdupersecret@Server2.domain.com

On Server2 you posted the following registration string:
Remote2:mysuperdupersecret@Server1.domain.com

Why is the user "Remote2" in both registration strings? Is this a typo? Shouldn't it be "Remote1" in one of the reg strings?

Question 2: can I use the same trunk name on both servers, or do they have to be different?

Thanks.



efx456
Posts: 132
Member Since:
2009-09-01
anyone? please see last

anyone? please see last post.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.