I recently start using IAX2 to connect a branch office. It works, the problem we have is that we don’t have static IP on both sides, the main office has dynamic IP and the branch also. We use dynDNS pro so we use hosts names to make the IAX connection. And for this reason I assume that both * box can’t register to each other sometimes. Today I check the IAX2 peers status and server A (the main office) had registered server B (the branch) but server B hadn’t registered server A. and today I couldn’t assume it was an IP problem because I could do ssh to the remote server (server B) using its hostname from dyndns, the same name server A has in its configuration.
Is it possible that when * has to resolve hostname it just resolves once and won’t refresh that value, because I think that happened, it is possible that the server B IP asterisk has on its records was the IP from the day before and not the actual IP, so today when it was trying to connect it couldn’t get it because it has the wrong IP.
I restart the asterisk service on server A but it doesn’t resolve the problem, so it reboot server B too, and then the problem was gone.
For now I will add a task on crontab to reboot both server each morning so they stay connected during the day, but I would like to provide some technical solution.
I hope you can help me out with this issue !
Here is Server A and B Iax Config:
register => serverA:passA@serverB.dyndns.com
register => serverB:passB@serverA.dyndns.com