The IAX trunk problem

Hi team,

I would like to share with the forum my last conclusions to a problem that I have between 2 remote sites, connected by VPN with draytek routers and dynamic IP.

Problem - when the IP change, the routers will re-make the VPN connection, all the services and network will communicate between sites but the IAX trunk will not go UP.

SITE A - the first 2009

computer - ML110G5
Elastix - 1.3.2
Freepbx -
asterisk - 1.4.22

This was the first site. Is using a HP ML110 G5 with no issues for the last 2 years. 40 users 4 ISDN lines and 2 SIP trunks (voipbuste and other).
All ok, it updates the external IP and I never had a break or stop service in this machine.

Site B - The problem start - 2011

Last months we open a new company a few kms way, since we have a very fast internet connection the natural option was to make a VPN connection with ours draytek 2920 and all the services, databases and voip will go in this 10Mb VPN.

Because the ML110G5 is not available any more I choose the ML110G6 and I tried to install elastix 2.0.3 - problem…

The DAHDI is not ok, for me, and I had a lot of problems to use it with our B410P.

So I decided to go lower and tried to install the elastix 1.3.2, like the main site. Another problem…

The ML110G6 is a 100% sata computer and elsatix 1.3.2 can´t be installed in this computer… Jesus!!!

ok so finally I decided to try the elastix 1.6.12 that was installed and start to build the installation

computer - ML110G6
Elastix - 1.6.12
Freepbx -
Asterisk -

All the sip phones are ok, all the ISDN lines are ok, all the sip trunks are ok.

The IAX trunk is also ok until the moment that the IP changes.

In this situation the VPN will go up again, but the IAX trunk will not reconnect by itself.

Please take in consideration that the IAX is calling the LAN ip of the other server and vice versa.

The IAX is working during 6 days always, until the moment that the IP change.

After 35212588 tests and tries I finally understand that after the change of the IP, if I restart the 2 routers at the same time, the IAX will go up.

It is not enough to force a new reconnection of the VPN, I need to restart the routers.
During the restart both routers will have a new Ip, the VPN will go up and immediately the iax will also go up.

It does not make sense…

If the iax is trunked to the LAN IP why should I need to restart both routers again?

[code]IAX2 Peers Site B *

Name/Username Host Mask Port Status
InterOffice (S) 4569 OK (6 ms)

1 iax2 peers [1 online, 0 offline, 0 unmonitored][/code]

So I decide to make a new test, in the new site (asterisk I installed a new elastix in an old pc. This test PC is running with the same specs of the old site, elastix 1.3.2/asteris 1.4.2 and guess what happened after last IP renew???

The test machine was able to reconnect the IAX trunk, but the asterisk was again Unreacheable…

A new routers re-star = connection’s made = IAX up again

As conclusion I think the * is somehow connecting the IAX2 trunk to the IP of the sip externalHost.

when the IP changes the externalhost will be updated but the IAX is not been correctly solved, and he start to be unreachable.

and now how can I solve this?

actually each mooning, when I arrive to the office I dial to the remote site, and if I see that the trunk is down I just re-star the routers and for the next 6 days everything will be ok.

I would like to go to vacations without the problem of checking each Tuesday if the Iax is ok or not. :smiley:

What shall I do in the new site?

Is there “safer” 1.4 version that I can upgrade to and that by your experience is safe in a IAX DDNS VPN environment?

Can someone point me a idea of solution?

buying a new HP server is not a god idea… try to find an old pc that can run elatix 1.3.2 is an possible option, but this pc will not be so adequate like the ML110 series.

If you read it… Thanks


The IP address should not change on a lease renewal. If it does, either you have an incompetent ISP, or they are deliberately trying to frustrate business/server use on the sort of account you are using.

Hi David, thanks for the reply.

David the IPs change because I have Dynamic IP.

In both sites I am using a account, please also consider that the VPN between both sites is OK, working super with a connection speed of 10Mbits.

The sip is in external host and it have the, one for each sites with different names in each router.

The problem is the IAX2 trunk, that using the internal IPs of the VPN (10.0.1.X and 10.0.6.X) is not able to "understand) that I have a new VPN connection with a new dynamic IP.

If I did not understand well your post please help me to understand it, but I my opinion this is something related with IAX in the asterisk

In the 1.4.22 the connection is able to go up by itself.


The IP address should not change with properly managed IP. The only time it should change is if you fail to renew the lease for an extended period.


Not in Portugal:

The DSL changes the IP in 48H
The Optic fiber (my case) is renewing in each 6 days

the cable provider is fowling also 1 week.

We are short of IP4 adress :smile:

As I noted. This is typically done for consumer accounts to force business users to pay for more expensive accounts.

Unfortunately, the actual effect is often to make them try and work round the limitation by making software tolerate the broken behaviour.

Yes you are correct.

the main issue is the IAX behaviour in both release. The is showing a effect that it should not happen.

If it was calling the dynamic DDNS I would agree, but for avoid that issue I decide to make a VPN with quality routers that are showing a correct operation.

If the IAX is made on a LAN IP it should not be related to the WAN IP, but in somehow there is an internal relation.

Also the dynamic SIP peers that we have outside of the company (7) plus the 3 SIP trunks are working ok. They update the IP in the Asterisk and the NAT is done. We never lost the audio or the connection to the sip peers.

This is only my opinion, I can´t explain or secure my position with a strong justification, but is annoying. I like asterisk, I personally choose it and influence the CEO’s of my company to choose for it.