Asterisk Hangs Up Call After 20s

Home » Asterisk Tips » Asterisk Hangs Up Call After 20s
Asterisk Tips No Comments

Sometimes, when using Asterisk server and XLite softphones, if Asterisk and the local XLite phone are located in a LAN behind a NAT router, and the remote XLite phone is located elsewhere on the Net behind its own NAT router, you will notice that when the local XLite calls out the remote XLite, everything works fine; However, when the remote XLite calls the local XLite, things work OK until precisely 20s, where Asterisk decides to hang up, and displays the following error message in the console:

WARNING[593]: chan_sip.c:1948 retrans_pkt: Maximum retries exceeded on transmission e45ed578253b9f3dMTRiYTg2OTI0YjExYjUzZWFiNDk3ZjZjMmRlMTQ4NjM. for seqno 2 (Critical Response)

WARNING[593]: chan_sip.c:1972 retrans_pkt: Hanging up call e45ed578253b9f3dMTRiYTg2OTI0YjExYjUzZWFiNDk3ZjZjMmRlMTQ4NjM. - no reply to our critical packet.
== Spawn extension (my-phones, local-xlite-extension, 1) exited non-zero on 'SIP/unused-008008e4'

If we evaluate the SIP debug output, we will see that before deciding to hang up, Asterisk tries several times to send an OK message to the remote XLite, and doesn’t seem to get an answer. Furthermore, after Asterisk has hung up, the remote XLite remains off-hook, oblivious to this error and keeps displaying “Call established”.

Follow this recommendations in order to nail down the cause of the problem:

  • Look in the XLite advanced network settings and disable the 2 timeout settings (RTP and RTCP?). This is not always necessary, but there are sufficient cases where the packets XLite expects appear early on, but do not persist, thus causing a hangup. It’s likely the default timeout is 20 seconds.
  • Try setting qualify=yes to your sip peers config to keep the NAT port open.
  • Make sure you have all your VPN connections as localnet and other side subnet as localnet as well if you are using VPN.
  • Make sure your NAT router is configured to use port UDP5060 for SIP.