Asterisk slow to answer, every few months

We’re running Asterisk 18.2 on four different servers.
Every few months we have a problem that affects all four servers at once. It’s happening right now.
Because it was happening to all servers at once we assumed it was the ODBC connection, but that has been eliminated. The second assumption was the ARI application, but that has been eliminated by creating a dial plan that only plays weasels and does not connect to the ARI application.
The SIP invite arrives at Asterisk, Asterisk sends the TRYING response, but is taking around nine to ten seconds before sending the 200 OK
This is true whether the call originates with a carrier, another Asterisk instance, or from a direct SIP connection.

Does anyone have any insight please?

DNS where the local hostname is not on the system? That gets resolved down for the answer SDP, so if DNS is slow or has an issue then it will cause SIP messaging to slow down.

Otherwise you’d need to get a backtrace[1] to show what Asterisk is doing.


Turns out it was the STUN server, we’re using one provided by our PBX provider and it went down. Switched to Google and everything worked fine.
We’ll build a COTURN server this afternoon and use it.

Thanks for your response.

Is there a reason you need to use a STUN server in Asterisk in the first place?

We have the stunaddr set in the rpt.conf for webrtc

I understand that, but why? It’s not necessary if your Asterisk has a public static IP address. If it’s directly bound then it’s not needed at all. If it’s not directly bound then you can configure rtp.conf to put your public IP address as an ICE candidate.


Our asterisk servers all have public static IP addresses.
So, we simply leave the stunaddr out of rpt.conf ?

Yes. It’s not necessary for your usage. In reality it’s rarely needed.


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