IAX2 Trunk(s) between two (or more) FreePBX Servers

Hi, I am newbie at FreePBX and Asterisk. I am just messing around with it to learn more about SIP servers and B2BUA Servers.

I have setup a FreePBX server on my Raspberry Pi at home. It is connected to a router with a public dynamic IP address and port forwarded the relevant ports, so I can take calls to any user connected at that time from anywhere. And I setup another FreePBX server on a Raspberry Pi at one of my friends. But this server doesn’t have a Public IP address. It just functions as a SIP server within his home.

What I want to know is, if it is possible to establish a IAX2 link or some other form of link to connect my server and to my friend’s server which doesn’t have a public IP address? Is there some other way to connect my friend’s server to my server as an extension?

I am very new to this and still learning. I just want to know if it is possible to this. And if so, how to do it.

Thanks!!!

Hi!

By “doesn’t have a public IP address” do you mean that his Internet Service Provider gives her/him an IP in private IP space (10/8, 172.16/12 or 192.168/16)?

Otherwise he does have a public IP address, you only need to have some sort of dynamic DNS client to keep it updated as it changes…

I have never done an IAX link but I am told it’s even easier than SIP (no NATting problems and the like…)…

Good luck and have a nice day!

Nick

1 Like

What I mean is that I cannot ping his IP address from anywhere. But I can ping mine from anywhere. And the IP range is not in the Private range.

And IAX seems easier as it uses only one port (4569) for both signalling and RTP (voice) data. And it uses less bandwidth as the header sizes are smaller than that of SIP trunk.

Hi!

That’s ICMP echo… On some routers you can decide to block those requests or not… If you block them the IP address (or IP addresses) is (are) not pingable…

It’s a good thing her/his IP is not in private IP range, it means that’s there’s a lot of chances it might work.

Yes, I read up on this after I read your message and it’s definitely easier to setup…

As to how to do it, I think I would follow this: Sangoma Documentation

To get her/his IP (and yours as well) I would install a dynamic DNS client (hopefully your router supports this but I guess you could install it on the PI)…

Good luck and have a nice day!

Nick

1 Like

Thank you so much. I’ll try it this way and see if it works :smile:
Have a nice day

Hi,

No Need to verify the public IP for that. Just make sure the servers will register to each other.
in the trunk settings you can set host=dynamic and configure a user name and password for the trunks.
In the case of an IAX trunk you will need to forward port 4569 udp from your router to your Asterisk pbx.

You can use my example of IAX trunk configuration for static IPs:

All the configuration is case sensitive.

First Server:

Trunk Name: Second Server
    
    Trunk Name: SECOND-SERVER
    
    Peer details:

    host=ip_second_server
    username=FIRST-SERVER
    secret=some_secret
    type=friend
    context=from-internal
    transfer=no
    allow=alaw&ulaw
    disallow=all

Second Server:

Trunk Name: First Server

    Trunk Name: FIRST-SERVER
    
    Peer details:

    host=ip_first_server
    username=SECOND-SERVER
    secret=some_secret
    type=friend
    context=from-internal
    transfer=no
    allow=alaw&ulaw
    disallow=all

There is no need for the user details.

Thank you,

Daniel Friedman
Trixton LTD.

Mobile: +41.79.868.7050
Email: [email protected]

1 Like

Ah ok, I’ll try it this way.
But do i need to set any Incoming Settings on the trunks?

Thanks.

Hi,

If you will follow my example you will not need to set the user part of the trunk as the role of every trunk is type=friend.

Thank you,

Daniel Friedman
Trixton LTD.

Mobile: +41.79.868.7050
Email: [email protected]

1 Like

Thank you very much. This information is very helpful :smile: