487 4xx Client error RFC 3261
SIP 487 Request Terminated
The request was ended by a BYE or CANCEL before completion. Usually the caller hung up while ringing.
487 Request Terminated is the final response to an INVITE that was cancelled before anyone answered. It almost always follows a CANCEL: the caller hung up while the call was ringing, a ring group or queue stopped ringing the other phones because one answered, or a PBX gave up after its own ring timeout. The ringing device sends 200 OK to the CANCEL, then 487 to the original INVITE, and the caller's side confirms with ACK.
It is sent by whoever was handling the INVITE: the ringing phone, a PBX leg, or a carrier on outbound calls. In call records it means an abandoned or missed call, not a failure, and phones log it as missed unless the CANCEL says the call was answered elsewhere.
487 deserves attention only when calls are cancelled sooner than intended, or appear on calls nobody hung up. The question then is who sent the CANCEL and why: a ring timeout set too short, a carrier limiting ring time, or a failover rule cancelling a slow branch.
What it looks like in a SIP trace
PBX -> Phone : INVITE sip:2001@192.168.1.41:5060 SIP/2.0 (CSeq 1 INVITE) Phone -> PBX : SIP/2.0 180 Ringing PBX -> Phone : CANCEL sip:2001@192.168.1.41:5060 SIP/2.0 (CSeq 1 CANCEL) Reason: SIP;cause=200;text="Call completed elsewhere" Phone -> PBX : SIP/2.0 200 OK (CSeq 1 CANCEL) Phone -> PBX : SIP/2.0 487 Request Terminated (CSeq 1 INVITE) PBX -> Phone : ACK sip:2001@192.168.1.41:5060 SIP/2.0 (CSeq 1 ACK) # The CANCEL reuses the INVITE's Call-ID, CSeq number and Via branch. # The Reason header (RFC 3326) tells the phone another device answered, # so many phones do not log it as a missed call.
Example values only. Your headers, addresses and numbers will differ.
Common causes
- The caller hung up before answer.
- Ring-group or queue cancelled other branches when one phone answered.
- A timeout on the caller side cancelled the INVITE.
How to diagnose it
- Find the CANCEL and see which side sent it and how long after the INVITE. A CANCEL from the caller after normal ringing is just an abandoned call.
- If calls are cancelled after a fixed time such as 20 or 30 seconds, look for ring timeouts on the ring group, queue, follow-me or extension, or at the carrier, which may cap ring time.
- Check the CANCEL for a
Reasonheader. Call completed elsewhere means another branch answered; a Q.850 cause can show why a carrier or gateway gave up. - If the caller gets 487 although nobody hung up, check whether a failover rule or a 408-style timer on a proxy cancelled the branch to try another route.
- If phones keep ringing after a CANCEL, check that the CANCEL reaches them. It is sent to the same address as the INVITE, so NAT or a SIP ALG that broke that path can strand it.
How to fix it
- Usually normal. If calls are cancelled too soon, raise ring timeouts on the PBX or carrier.
Platform notes
Asterisk / FreePBX
FreePBX takes ring times from the ring group's Ring Time, the queue's agent timeout and the extension's ring time; in plain Asterisk it is the timeout argument of Dial(). When one ring group member answers, Asterisk cancels the other legs and each returns 487, which is normal. The DIALSTATUS of the abandoned leg shows CANCEL or NOANSWER.
OpenSIPS / Kamailio
The transaction module forwards a CANCEL to every pending branch and relays the 487s. In a failure route, call t_was_cancelled() first and exit if it is true, so a caller hanging up does not trigger failover to another gateway or to voicemail.
Phones and softphones
Desk phones generally log a cancelled call as missed. Many skip that when the CANCEL carries Reason: SIP;cause=200, which tells them another phone in the group answered.
SIP 487 FAQ
Is 487 Request Terminated an error?
Usually not. It is the normal result of a call cancelled before answer, most often because the caller hung up.
Why do I see a 487 for every phone in my ring group?
When one phone answers, the PBX cancels the others, and each cancelled phone replies with 487. That is expected behaviour.
What is the difference between 487 and 481?
487 answers an INVITE that was successfully cancelled. 481 means a request, sometimes the CANCEL itself, matched no call or transaction on the receiving side.
Related codes
Related guides
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.
Calls Dropping After 30 Seconds
Why VoIP calls drop after about 32 seconds: lost ACKs, NAT, wrong Contact headers and SIP ALG, how to prove it in a trace, and fixes for Asterisk and routers.