Troubleshooting
VoIP Calls Dropping After 30 Seconds: Causes and Fixes
On this page
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.
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.
| Cause | What happens | How it shows in a trace |
|---|---|---|
| Private IP in Contact | PBX or phone behind NAT does not know its public address | Contact in the 200 OK shows 10.x, 172.16-31.x or 192.168.x |
| SIP ALG | Router rewrites some headers, misses others, or rewrites them wrongly | Contact or Via differs between captures on either side of the router |
| Wrong Record-Route | A proxy or SBC records an internal address, or omits ;lr | ACK sent towards an internal hop or rejected by a proxy |
| Transport mismatch | INVITE 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 forward | No forward for the SIP port, or the provider sends the ACK from a different IP than the INVITE | ACK 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
- 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. - 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.
- 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.
- 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.
- 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 time | Likely cause | Where to look |
|---|---|---|
| About 32 seconds | Missing ACK | Contact, Record-Route, NAT, SIP ALG |
| A fixed time after audio stops or goes one-way | RTP timeout | RTP timeout settings, firewall on RTP ports |
| Just under 15 or 30 minutes | Session timer refresh failed | re-INVITE or UPDATE at half the interval |
| A round long duration (1, 2 or 4 hours) | Maximum call length on the PBX or provider | Dial options, provider policy |
| Random | Network: loss bursts, Wi-Fi roaming, ISP failover changing your public IP | Link 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
- Time the drop. About 32 seconds points to the ACK; other times, use the table above.
- Capture on the answering side and confirm repeated 200 OKs with no ACK.
- Read the Contact and Record-Route headers in the 200 OK and decide whether the other side can reach them.
- Disable SIP ALG on every router in the path.
- Set the external address and every local network; enable
rewrite_contact,force_rportandrtp_symmetricon NATed endpoints; restart Asterisk. - 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
How to Fix One-Way Audio on VoIP Calls
One side can't hear the other? A step-by-step guide to fixing one-way and no-audio VoIP calls caused by NAT, SIP ALG, firewalls and wrong SDP addresses.
SIP ALG: What It Is and Why to Disable It
What SIP ALG does, why it breaks VoIP calls and registrations, how to tell if it's causing problems, and how to turn it off on common routers and firewalls.
SIP Registration Failed? Troubleshooting Checklist
Fix failed SIP registrations step by step: read 401, 403, 404, 408, 423 and 503 replies, then check DNS, ports, NAT, fail2ban bans and Asterisk PJSIP.
Capture SIP Traces With sngrep and Wireshark
Capture SIP and RTP with sngrep and tcpdump, then analyse calls in Wireshark: call flows, RTP stream analysis, jitter, loss, audio playback and safe sharing.