Asterisk takes too much time to make internal/external calls

Hello everybody,

I have an asterisk that takes too much time to make calls to internal and external numbers, I have 2 sip trunks active and using both of them cause the same issue.
When I go to the CLI and make the call it takes about 9 seconds to execute the dialplan, then it takes around 10 more seconds to establish rtp ports and get the rings fron the carrier and establish the call.
In the first 9 seconds the CLI isn´t doing anything it’s just the black screen with nothing to show, then it shows up the dialplan execution and the call is established without any issues.
I have another asterisk server with the same configuration but it doesn´t have the same issue, the call starts as inmediate as I push the call button.
The delay in starting to execute the dialplan is the thing that I haven´t been able to resolve, the CPU usage in the server is less of 1% when I make the call.
Have you found this behavior before? What could I do?

Thank you in advance for the help.

A common source of delays can be DNS issues.

A console log (cut-n-paste, no pictures) wrapped in preformatted text tags may yield clues.

Be sure to set debug and verbose to 3 or greater.

If you include ‘-T’ when you invoke the Asterisk CLI it should include timestamps that may help.

  1. Which Operating System, which version, what hardware spec, which version of
    Asterisk?

  2. Show us (the relevant part of) the dialplan.

  3. “I go to the CLI and make the call” - show us the command/s you use for
    this.

  4. “it takes about 9 seconds to execute the dialplan” - show us verbose log
    output.

  5. “it takes around 10 more seconds to establish rtp ports” - show us SIP
    packet captures.

  6. “I have another asterisk server with the same configuration but it doesn´t
    have the same issue” - is there any difference in the DNS setup on these
    machines?

Antony.

If your server is FreePBX and you are using the calendar module there is bug introduced with v.16.0.21 that could cause a big delay. You should downgrade to 16.0.18 or get the edge 16.0.23+

Hello to all,

I followed all your advices and found out that the issue was the google stun server. I noticed in a SIP packet capture that when I dialed a phone number asterisk sent multiple sip invites and they got destroyed because of the stun server conflict with those packets. The SIP call negotiation took around 10 seconds to receive an OK response to inmediately send the call out of the asterisk server. Once it was out the trunk answered almost inmediately with a ringing response. So I changed the stun server to a different URL and it worked, now the sip invite isn´t destroyed and the call is made in a few seconds. Do you know if there is any know issues with google stun servers? I decided to use a different one of those I mentioned.
Thanks to all for the help.

Have you tried disabling the stun server?
It’s often not needed.

Hi,

I’m currently using WebRTC extensions, I was on the understanding that webrtc uses stun servers to provide communications peer to peer because the connection needs to know the public ip address and port used. Am I correct? Or
Is there another option to keep webrtc working without using stun servers? My extensions are registered in multiple locations and they use modems provided by carriers with NAT configured.
I did somo research and what I looked into was that webrtc always has to use stun and turn servers and also ICE.

Thanks in advance.

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