Problems with SIP registration and UDP timeout

Good morning,
I have a serious problem, the context is:
the FreePBX device is connected to a Mikrotik ruoter, he registers to an external voip provider correctly. There are two different Internet lines on the Mikrotik router. When the line set as primary drops, the FreePBX switches to navigate correctly on the second line and still registers correctly with the VoIP provider. However, when the first line returns up, the FreePBX no longer registers with the VoIP provider, since it continues to match the NAT rule created for the second line, a known problem concerning Mikrotik (UDP and NAT) forum.mikrotik. com /viewtopic.php?f=2&t=129048&sid=a9d6d42391bff1ac841bdfe06a2bdf71.
How can I solve the problem without having to manually intervene or create scripts on Mikrotik?
Is it possible to set a register interval on the FreePBX to the VoIP trunk higher than the UDP stream timeout on the Mikrotik to solve the problem? Many thanks in advance.

Wow, that thread has 59 posts, many of which are not light reading, so some of my analysis may be inaccurate.

You can increase the retry interval; in pjsip Settings -> Advanced for the trunk, set General Retry Interval as desired. However, I’m concerned that qualify requests and/or outbound call attempts will also reset the UDP timeout, so that may not help. Also, it appears that if SIP ALG is enabled, the timeout defaults to one hour.

Possibly, an “if problem detected, reset the NAT table” solution will work; see post #10 in the thread.

How often and when does this issue typically arise? If it’s usually in the wee morning hours when the ISP is doing scheduled maintenance, upon detection of the trouble, your cron job could shut down Asterisk for a little more than an hour; it should then be fine when restarted.

Is replacing the router a possibility?

I dislike registration in general. If your providers support “IP authentication”, can you set them up so incoming calls are routed to IP address A, with failover to IP address B? Then, with the proper port forwarding in the router and having the PBX track public IP changes, calls could be delivered more robustly.

A somewhat more complex setup would allow the PBX to have access to both ISPs at all times, so e.g. calls on B would not be dropped as a result of A coming back online.

Thank you, we will probably proceed with putting a script on mikrotik for manual connections deletion, the solution tried with the change of timeouts does not seem to work properly …
Unfortunately we cannot change routers or use a different authentication method towards the voip provider.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.