Need help with trunk registration between two Freepbx systems

Hi there, i’m sorry if this scenario has been posted before but I have been unable to find a solution on here or through googling.

I have successfully setup IAX trunks between two systems - easy as. That is when the port forwarding is possible with static IPs/DDNS etc.

I have a particular situation where a branch office needs to connect to the head office. The head office has a static IP address and port forwarding so no issue here. Where the branch office people are, we can not do port forwarding. Not possible. Please don’t ask why, it is just NOT a possibility.

The issue then happens that we can call into the head office from the branch office, just not back in the same direction. Sometimes I have had this working ok but what ever router is in this branch office is not allowing this.

The SIP trunk to the phone provider works fine in both directions, and I suspect this is due to the fact that the trunk is registering to the provider (who use Asterisk).

My question is, is it possible to do a trunk registration to the head office Freepbx system from the branch office? All of the tutorials I have seen dont use the Register string at all so Im wondering if anyone out there has had any success with setting up a trunk in this type of setup.

Thank you in advance :slight_smile:

Yes. You would add a register string to the branch office that matches the inbound peer details of the head office trunk:

username:[email protected]

username is the peer inbound context, password is the secret. You can use an FQDN or IP address.

edit - it’s been a while since I’ve done this, you may have to set host=dynamic in the inbound peer details.

Hi Lorne, thanks for that.

Do you know any example setups of what I could have in the USER/PEER sections on both servers? I think I’ve got myself a bit muddled up here!

Thanks again

There are a number of tutorials on the Web that show how to setup IAX2 between two servers. Some also claim that no port forwarding is required, but that isn’t my experience. I once even found a XLS file that allowed to to put in the relevant info and if produced the config for both sites.

Enter CreateIAXtrunk in Google. You’ll get alot of info. Enter CreateIAXtrunk.xls and youll be able to get the excel file.

Also, a USER/PEER I beleive is called FRIEND

Hello @jsm,

You can add a qualify setting to your trunks: qualify=15000 (15 seconds keep alive).
As long the udp session (udp 4569) is kept open through the NAT session, you will be able to send calls back and forth.

If you are facing trouble with the IAX2 protocol, you can switch to the SIP protocol with the same qualify setting.

The registration helps to keep to session alive, but usually the default settings are send a packet twice an hour, so it is not good enough if you are not customizing the sip registration parameters (which is doable in the Asterisk).

From my experience, the qualify setting (15 seconds keep alive) is the most effective one.

Thank you,

Daniel Friedman
Trixton LTD.