Tip: type a SIP code like 488, or a problem like one-way audio. Use ↑ ↓ and Enter.

Troubleshooting

VoIP Calls Dropping After 30 Seconds: Causes and Fixes

On this page
  1. Why 32 seconds: the 200 OK and ACK handshake
  2. Why the ACK goes missing
  3. Confirm it in a trace
  4. Drops at other intervals
  5. Fixes for Asterisk and FreePBX
  6. Router and firewall fixes
  7. Quick checklist

A call that connects and then drops at about 32 seconds is almost always a missing ACK. The side that answered keeps resending its 200 OK because the caller's acknowledgement never arrives, and after 64 × T1 (32 seconds with default timers) it gives up and hangs up. The ACK goes missing because of NAT, a wrong Contact or Record-Route address, SIP ALG or a firewall, so fixing the addressing fixes the drop.

Why 32 seconds: the 200 OK and ACK handshake

INVITE is the only SIP request with a three-way handshake. The caller sends INVITE, the called side answers with 200 OK, and the caller confirms with ACK. Both sides already have each other's SDP, so audio usually flows as soon as the 200 OK is sent. That is why the call sounds fine for the first half minute.

Because the 200 OK matters so much, RFC 3261 makes the answering side (the UAS) retransmit it until the ACK arrives: first after T1 (500 ms), then doubling each time up to T2 (4 seconds), then every 4 seconds. If no ACK has arrived after 64 × T1, which is 32 seconds, the UAS ends the session with a BYE. You see about ten retransmissions in a trace before the BYE.

About the name. The 32-second drop is often blamed on "Timer H". Strictly, Timer H is the transaction timer for an ACK to a non-2xx final response; retransmitting a 2xx is handled by the UAS core (RFC 3261 section 13.3.1.4). Both use the same 64 × T1 limit, so the effect is identical. If T1 has been changed from 500 ms (for example timer_t1 in Asterisk's PJSIP system section), the drop time changes with it.

Here is the classic inbound case, a PBX behind NAT answering a call from a provider:

PBX 192.168.1.10                       Provider 198.51.100.20
    |  <---------- INVITE -------------  |
    |  ----------- 100 Trying -------->  |
    |  ----------- 180 Ringing ------->  |
    |  ----------- 200 OK ------------>  |  0.0 s  answered, audio starts
    |  ----------- 200 OK ------------>  |  0.5 s  retransmission
    |  ----------- 200 OK ------------>  |  1.5 s
    |  ----------- 200 OK ------------>  |  3.5 s
    |  ----------- 200 OK ------------>  |  7.5 s, then every 4 s
    |                ...                 |
    |  ----------- BYE --------------->  |  ~32 s  no ACK ever received

200 OK from the PBX contains:
Contact: <sip:1000123@192.168.1.10:5060>

The provider is sending ACKs, but to 192.168.1.10, the private address in the PBX's Contact header, which cannot be reached from the internet.

Why the ACK goes missing

Responses travel back along the Via headers, which is why the 200 OK arrives without trouble. The ACK is a new request, so the caller sends it to the remote target in the 200 OK's Contact header, through any proxies listed in Record-Route. Anything that puts a wrong or unreachable address into those headers breaks the ACK while everything before it works.

CauseWhat happensHow it shows in a trace
Private IP in ContactPBX or phone behind NAT does not know its public addressContact in the 200 OK shows 10.x, 172.16-31.x or 192.168.x
SIP ALGRouter rewrites some headers, misses others, or rewrites them wronglyContact or Via differs between captures on either side of the router
Wrong Record-RouteA proxy or SBC records an internal address, or omits ;lrACK sent towards an internal hop or rejected by a proxy
Transport mismatchINVITE over TCP but Contact lacks ;transport=tcp, so the ACK goes over UDP (or the reverse)ACK leaves on a different protocol or port
Firewall or port forwardNo forward for the SIP port, or the provider sends the ACK from a different IP than the INVITEACK visible on the WAN side, never on the PBX

The same pattern happens in the other direction. When the PBX calls a phone behind NAT and the phone's 200 OK carries a private Contact, the PBX's ACK goes nowhere and the phone hangs up after 32 seconds.

Confirm it in a trace

  1. Capture a failing call on the side that answers, for example with sngrep -d any port 5060. The sngrep and Wireshark guide covers capture options.
  2. In the call flow, look for the 200 OK repeated about ten times with no ACK in between, then a BYE at about 32 seconds.
  3. Open the 200 OK and read its Contact and any Record-Route headers. Ask whether the other side can reach that address, on that port, over that transport.
  4. If you can, get a trace from the other side. If they sent an ACK you never received, compare its Request-URI with your Contact.
  5. Look at how the BYE is answered. Depending on the state each side holds, it may get a 200 OK or a 481 Call/Transaction Does Not Exist.

Older Asterisk systems running chan_sip log a warning containing Retransmission timeout reached on transmission and (Critical Response) when this happens.

Drops at other intervals

The exact drop time is a strong clue. Time a few failing calls before you change anything.

Drop timeLikely causeWhere to look
About 32 secondsMissing ACKContact, Record-Route, NAT, SIP ALG
A fixed time after audio stops or goes one-wayRTP timeoutRTP timeout settings, firewall on RTP ports
Just under 15 or 30 minutesSession timer refresh failedre-INVITE or UPDATE at half the interval
A round long duration (1, 2 or 4 hours)Maximum call length on the PBX or providerDial options, provider policy
RandomNetwork: loss bursts, Wi-Fi roaming, ISP failover changing your public IPLink monitoring and logs

Session timers (RFC 4028)

Session timers let both sides confirm that a long call is still alive. The INVITE or 200 OK carries a header such as Session-Expires: 1800;refresher=uac, and the refresher sends a re-INVITE or UPDATE, normally at half the interval. If no refresh succeeds, the other side sends a BYE shortly before the session expires. A call that always drops just before 15 or 30 minutes is the signature. Look for a re-INVITE or UPDATE at about 7.5 or 15 minutes that fails, times out or is never sent.

Causes include the same NAT and Contact problems (the re-INVITE goes to an unreachable address), a peer that does not support UPDATE, and SBCs that mishandle mid-dialog requests. On Asterisk PJSIP the endpoint options are timers, timers_sess_expires (default 1800) and timers_min_se (default 90, the RFC 4028 minimum). Setting timers=no on a trunk is a reasonable workaround while you fix the cause.

RTP timeouts

Many PBXs hang up when no RTP arrives for a set time. On Asterisk PJSIP these are the endpoint options rtp_timeout and rtp_timeout_hold, both disabled (0) by default. If incoming RTP is blocked or sent to a private address, the call is one-way and then drops after exactly the configured time, which could also be 30 seconds. An RTP timeout BYE is not preceded by repeated 200 OKs, so the trace tells them apart. Phones that stop sending RTP during silence or hold can trigger it too. For the media side, see fixing one-way audio.

Fixes for Asterisk and FreePBX

Most 32-second drops on Asterisk come from a PBX behind NAT that does not know its public address, or from remote phones whose Contact headers are not rewritten. Configure the transport with the public address and every internal network, then set NAT options on endpoints that sit behind NAT:

; pjsip.conf transport
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0:5060
external_signaling_address=203.0.113.10
external_media_address=203.0.113.10
local_net=192.168.1.0/24
local_net=10.8.0.0/24    ; VPN range, if phones use one

; endpoint for a phone (or trunk) behind NAT
[101]
type=endpoint
rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes
direct_media=no
  • external_signaling_address / external_media_address: the public IP written into Contact, Via and SDP for destinations outside local_net.
  • local_net: networks that get the private address. A missing subnet, such as a VPN range, gets the public one instead.
  • rewrite_contact: replaces a NATed device's Contact with the address its packets came from, so ACKs, BYEs and re-INVITEs reach it.
  • force_rport: sends responses to the request's source port (RFC 3581).
  • rtp_symmetric: sends RTP back to where the other side's RTP comes from.
  • direct_media=no: keeps media through Asterisk instead of re-inviting NATed devices to talk directly.

On FreePBX, set External Address and Local Networks under Settings → Asterisk SIP Settings, then the NAT options (Rewrite Contact, RTP Symmetric, Force rport, Direct Media) on the Advanced tab of PJSIP extensions and trunks; labels vary slightly by version. Transport changes usually need a full restart (fwconsole restart). On older chan_sip systems the equivalents are externaddr, localnet and nat=force_rport,comedia; chan_sip was removed in Asterisk 21.

Router and firewall fixes

  • Disable SIP ALG. It is a frequent cause of half-rewritten Contact headers. See SIP ALG explained; on MikroTik, /ip firewall service-port disable sip.
  • Forward the SIP port and RTP range to the PBX if it is behind NAT, restricted to your provider's addresses.
  • Allow all of the provider's signalling IPs, not just the one in your trunk settings. Providers often send requests and ACKs from different SBCs.
  • Avoid double NAT. If an ISP router sits in front of your firewall, put it in bridge mode or make sure neither device runs an ALG.
  • Keep source ports stable. On pfSense or OPNsense, use static-port outbound NAT for the PBX.
  • Keep transports consistent. If phones register over TCP, allow TCP on the SIP port and check the Contact carries ;transport=tcp.

Quick checklist

  1. Time the drop. About 32 seconds points to the ACK; other times, use the table above.
  2. Capture on the answering side and confirm repeated 200 OKs with no ACK.
  3. Read the Contact and Record-Route headers in the 200 OK and decide whether the other side can reach them.
  4. Disable SIP ALG on every router in the path.
  5. Set the external address and every local network; enable rewrite_contact, force_rport and rtp_symmetric on NATed endpoints; restart Asterisk.
  6. Test calls in both directions, from inside and outside the network, and keep a trace of a good call for comparison.

Try the SIP Response Codes

Every SIP status code from 100 to 608, with plain-English meanings, causes, fixes and example traces.

Keep reading