Skip to content
SIP Mastery

Part 8 · Call flow library / Module 21

Basic call flows

The basic call flows of RFC 3665, message by message: registration with and without a challenge, a direct call, calls through one and two proxies, a 407 challenge, busy, no answer, no response, declined and not found, CANCEL, early media, late offer, a redirect, and parallel and sequential forking. One call flow builder covers every combination, with "what if" options.

BasicIntermediateNOC coreDEV core

After this module, you can

  • Follow a registration and a basic call, direct and through proxies, and say which element sends each message.
  • Tell which messages go hop by hop (100 Trying, CANCEL, the ACK for a failure response) and which go end to end (the 2xx, its ACK, BYE).
  • Follow a failed call (486, 480, 408, 603, 404) and a cancelled call to the last ACK.
  • Find the SDP offer and answer in an early-media call and in a late-offer call.
  • Follow a redirect and a forked call, parallel and sequential.
On this page12 sections
  1. 21.1Registration, with and without a challenge
  2. 21.2Direct call between two user agents
  3. 21.3Call through one proxy, then through two proxies with Record-Route
  4. 21.4Call with a 407 challenge
  5. 21.5Busy (486), no answer (480/408), rejected (603), not found (404)
  6. 21.6The caller cancels: CANCEL → 200 (CANCEL) → 487 → ACK
  7. 21.7Early media (183 with SDP)
  8. 21.8Late offer (SDP in the 200 OK and in the ACK)
  9. 21.9Redirect (302)
  10. 21.10Forking: parallel and sequential
  11. Common mistakes
  12. Summary

21.1 Registration, with and without a challenge

Part 8 is a library of call flows. Each one is a full interactive ladder: play it, step through it, and click a message to open it in the inspector, which also marks the headers that changed since the previous message. The flows follow RFC 3665, the IETF’s set of basic call flow examples. RFC 3665 itself warns that its messages are simplified:

RFC 3665 §1.3 · SIP Protocol Assumptions
“IMPORTANT: The exact flows here must not be copied as is by an implementer due to specific incorrect characteristics that were introduced into the document for convenience and are listed below.”
Read the section ↗

The messages in this course are complete. The course’s protocol checker reads every one of them, with the same rules as in the earlier modules, so you can copy them.

A call starts long before the INVITE: Bob’s phone must register, or Proxy B cannot find it. The REGISTER goes to the RegistrarRegistrar. The server that accepts REGISTER requests for a domain and stores the bindings in its location service. In most examples it serves atlanta.example; in Module 12, biloxi.example. of Bob’s domain, which stores the bindingbinding. One entry in the location service that maps an AOR to a Contact. and answers 200 OK with every binding of the AOR (Module 12). On a trusted network, for example a phone that the registrar knows by its IP address or its TLS certificate, that is all. On the public Internet, the registrar first challenges with 401, and the phone sends the REGISTER again with credentials (Module 13). The left ladder also shows a refresh, a query, and a removal (RFC 3665 §2.2 to §2.4):

Without a challenge

Register, refresh, query, and remove

  • SIP
Bob203.0.113.20Registrarbiloxi.example01REGISTER02200 OK03REGISTER (refresh)04200 OK05REGISTER (query)06200 OK07REGISTER (remove)08200 OK
01/08

Bob's phone starts. It asks the Registrar to bind sip:bob@biloxi.example to its Contact for 3600 seconds.

  • BobRegistering
All steps as text
  1. Bob → Registrar: REGISTER. Bob's phone starts. It asks the Registrar to bind sip:bob@biloxi.example to its Contact for 3600 seconds.
  2. Registrar → Bob: 200 OK. The Registrar stores the binding. The 200 OK lists every binding of the AOR, each with its expires value.
  3. Bob → Registrar: REGISTER (refresh). Halfway through, the phone refreshes. Same Call-ID and Contact, CSeq one higher.
  4. Registrar → Bob: 200 OK. The binding runs for 3600 seconds again, from now.
  5. Bob → Registrar: REGISTER (query). A REGISTER with no Contact header changes nothing. It asks for the list of bindings.
  6. Registrar → Bob: 200 OK. The binding has 3000 seconds left. The expires value always counts from now.
  7. Bob → Registrar: REGISTER (remove). Bob switches the phone off. It sends expires=0 for its Contact.
  8. Registrar → Bob: 200 OK. The Registrar removes the binding. The 200 OK has no Contact: Bob has no device registered now.

In every registration trace, check three things:

  • The Request-URI is the domain, with no user part. To and From hold the AOR.
  • The retry after the 401 has CSeq one higher, the same Call-ID, and a new branch.
  • The 200 OK lists all the bindings, each with its own expiry. The phone refreshes before the expiry in the 200 OK, not before the one it asked for.

21.2 Direct call between two user agents

The simplest call has no server at all: Alice’s phone sends the INVITE straight to Bob’s phone, as in RFC 3665 §3.1. Real networks rarely do this, because Alice’s phone would need Bob’s current address. But every other flow in this module builds on it:

  1. INVITE: Alice’s phone opens the INVITE transaction. The SDP offer lists the codecs it can use.
  2. 180 Ringing: Bob’s phone rings. The To tag in the 180 creates an early dialogearly dialog. A dialog created by a 1xx response with a To tag, before the call is answered..
  3. 200 OK: Bob answers. The SDP answer chooses PCMU, and the dialog is now confirmed.
  4. ACK: Alice’s phone confirms the 200 OK. This ACK is a new transaction, with a new branch.
  5. RTP: the audio flows between the two phones, to the addresses in the SDP.
  6. BYE and 200 OK: either side hangs up, and the dialog ends.

This is the call flow builder. Every option above the ladder changes the call, and the ladder and every message change with it. Try Lost packet: The 200 OK: Bob’s phone sends the 200 OK again and again until an ACK arrives, because only the UAS core can make a 2xx reliable:

Flow builder · RFC 3665 §3.1: a direct call

Bob answers, directly

  • SIP
  • RTP media
Path
Outcome
What if
Lost packet
Forwarding
Hangs up

Alice192.0.2.10Bob203.0.113.2001INVITE02180 Ringing03200 OK04ACK05RTP audio (PCMU)06BYE07200 OK (BYE)
01/07

Alice's phone calls Bob directly, at his address. The SDP offer lists PCMU and PCMA.

All steps as text
  1. Alice → Bob: INVITE. Alice's phone calls Bob directly, at his address. The SDP offer lists PCMU and PCMA.
  2. Bob → Alice: 180 Ringing. Bob's phone rings, and Alice's phone plays a ringback tone. The To tag in the 180 creates an early dialog.
  3. Bob → Alice: 200 OK. Bob answers. The 200 OK carries the SDP answer: PCMU.
  4. Alice → Bob: ACK. Alice's phone sends the ACK, with a new branch. It goes straight to Bob's Contact address.
  5. Alice → Bob: RTP audio (PCMU). Alice and Bob send RTP straight to each other, to the addresses in the SDP.
  6. Alice → Bob: BYE. Alice hangs up. The BYE goes to the remote target, straight to the Contact address.
  7. Bob → Alice: 200 OK (BYE). Bob's phone confirms the BYE. The dialog ends.
RFC 3261 §13.3.1.4 · The INVITE is Accepted
“The 2xx response is passed to the transport with an interval that starts at T1 seconds and doubles for each retransmission until it reaches T2 seconds (T1 and T2 are defined in Section 17).”
Read the section ↗

21.3 Call through one proxy, then through two proxies with Record-Route

With one proxy, Alice’s phone sends the INVITE to Proxy B, the proxy for biloxi.example; DNS gives its address (Module 11). Proxy B answers 100 Trying, finds Bob’s Contact in its location servicelocation service. The database of bindings from AORs to Contact addresses., puts that Contact in the Request-URI, adds its own Via, and forwards the INVITE. The responses come back along the Via headers. Without Record-Route, Proxy B is out of the dialog after the 200 OK: the ACK and the BYE go straight to Bob’s Contact.

Flow builder · one proxy, no Record-Route

Bob answers, through one proxy

  • SIP
  • RTP media
Path
Outcome
What if
Lost packet
Forwarding
Hangs up

Alice192.0.2.10Proxy B203.0.113.10Bob203.0.113.2001INVITE02100 Trying03INVITE04180 Ringing05180 Ringing06200 OK07200 OK08ACK09RTP audio (PCMU)10BYE11200 OK (BYE)
01/11

Alice's phone sends the INVITE to Proxy B, the proxy for biloxi.example. The SDP offer lists PCMU and PCMA.

All steps as text
  1. Alice → Proxy B: INVITE. Alice's phone sends the INVITE to Proxy B, the proxy for biloxi.example. The SDP offer lists PCMU and PCMA.
  2. Proxy B → Alice: 100 Trying. Proxy B answers 100 Trying, so Alice's phone stops retransmitting the INVITE.
  3. Proxy B → Bob: INVITE. Proxy B finds Bob's Contact in its location service. It adds its Via and sends the INVITE there.
  4. Bob → Proxy B: 180 Ringing. Bob's phone rings. The To tag in the 180 creates an early dialog.
  5. Proxy B → Alice: 180 Ringing. Proxy B forwards the 180. Alice's phone plays a ringback tone.
  6. Bob → Proxy B: 200 OK. Bob answers. The 200 OK carries the SDP answer: PCMU.
  7. Proxy B → Alice: 200 OK. Proxy B forwards the 200 OK.
  8. Alice → Bob: ACK. Alice's phone sends the ACK, with a new branch. It goes straight to Bob's Contact address.
  9. Alice → Bob: RTP audio (PCMU). Alice and Bob send RTP straight to each other. The proxies never see the media.
  10. Alice → Bob: BYE. Alice hangs up. The BYE goes to the remote target, straight to the Contact address.
  11. Bob → Alice: 200 OK (BYE). Bob's phone confirms the BYE. The dialog ends.

With two proxies (RFC 3665 §3.2), Alice’s phone sends everything to Proxy A, its outbound proxyoutbound proxy. The proxy that a user agent sends all its requests to first, whatever the destination., with a pre-loaded Routepre-loaded Route. A Route header that a UA puts in a request outside a dialog. It usually names the outbound proxy. header. Proxy A removes its Route entry and forwards the INVITE to Proxy B. Both proxies add Record-Route, so both stay in the path of every in-dialog request:

RFC 3665 §3.2 · Session Establishment Through Two Proxies
“Proxy 1 inserts a Record-Route header into the INVITE message to ensure that it is present in all subsequent message exchanges.”
Read the section ↗

Flow builder · RFC 3665 §3.2: two proxies with Record-Route

Bob answers, through two proxies

  • SIP
  • RTP media
Path
Outcome
What if
Lost packet
Forwarding
Hangs up

Alice192.0.2.10Proxy A198.51.100.10Proxy B203.0.113.10Bob203.0.113.2001INVITE02100 Trying03INVITE04100 Trying05INVITE06180 Ringing07180 Ringing08180 Ringing09200 OK10200 OK11200 OK12ACK13ACK14ACK15RTP audio (PCMU)16BYE17BYE18BYE19200 OK (BYE)20200 OK (BYE)21200 OK (BYE)
01/21

Alice's phone sends the INVITE to Proxy A, its outbound proxy. The SDP offer lists PCMU and PCMA.

All steps as text
  1. Alice → Proxy A: INVITE. Alice's phone sends the INVITE to Proxy A, its outbound proxy. The SDP offer lists PCMU and PCMA.
  2. Proxy A → Alice: 100 Trying. Proxy A answers 100 Trying, so Alice's phone stops retransmitting the INVITE.
  3. Proxy A → Proxy B: INVITE. Proxy A removes its own Route entry, adds its Via and a Record-Route, and forwards the INVITE.
  4. Proxy B → Proxy A: 100 Trying. Proxy B answers 100 Trying. A 100 Trying travels one hop only.
  5. Proxy B → Bob: INVITE. Proxy B finds Bob's Contact in its location service. It adds its Via and a Record-Route and sends the INVITE there.
  6. Bob → Proxy B: 180 Ringing. Bob's phone rings. The To tag in the 180 creates an early dialog.
  7. Proxy B → Proxy A: 180 Ringing. Proxy B removes its own Via and forwards the 180.
  8. Proxy A → Alice: 180 Ringing. Proxy A forwards the 180. Alice's phone plays a ringback tone.
  9. Bob → Proxy B: 200 OK. Bob answers. The 200 OK carries the SDP answer: PCMU.
  10. Proxy B → Proxy A: 200 OK. Proxy B removes its own Via and forwards the 200 OK.
  11. Proxy A → Alice: 200 OK. Proxy A forwards the 200 OK. Alice's phone reverses the Record-Route list to build the route set.
  12. Alice → Proxy A: ACK. Alice's phone sends the ACK, with a new branch. The ACK follows the route set.
  13. Proxy A → Proxy B: ACK. Proxy A removes its own Route entry and forwards the ACK.
  14. Proxy B → Bob: ACK. Proxy B removes its own Route entry and forwards the ACK.
  15. Alice → Bob: RTP audio (PCMU). Alice and Bob send RTP straight to each other. The proxies never see the media.
  16. Alice → Proxy A: BYE. Alice hangs up. The BYE goes to the remote target, through the route set.
  17. Proxy A → Proxy B: BYE. Proxy A removes its own Route entry and forwards the BYE.
  18. Proxy B → Bob: BYE. Proxy B removes its own Route entry and forwards the BYE.
  19. Bob → Proxy B: 200 OK (BYE). Bob's phone confirms the BYE. The dialog ends.
  20. Proxy B → Proxy A: 200 OK (BYE). Proxy B forwards the 200 OK.
  21. Proxy A → Alice: 200 OK (BYE). Proxy A forwards the 200 OK.

Switch Record-Route off and on, and watch the ACK and the BYE: with it, they follow the route setroute set. The list of proxies that in-dialog requests must visit, built from Record-Route.; without it, they go straight to Bob’s Contact. The INVITE and its responses always pass through both proxies.

Some messages go one hop at a time. Others go from one end of the call to the other:

Message Sent by How far it goes
100 Trying Each proxy One hop: back to the element that sent the INVITE
180, 183, 2xx to the INVITE Bob’s phone Back to Alice’s phone, along the Via headers
3xx to 6xx to the INVITE The element that ends the call Back to Alice’s phone, with an ACK on each hop
ACK for a 2xx Alice’s phone End to end: along the route set, or straight to the Contact
CANCEL, and its 200 OK Alice’s phone, then each proxy One hop each
BYE, and its 200 OK Either phone End to end, like the ACK for a 2xx

21.4 Call with a 407 challenge

Proxy A accepts calls only from its own users, so it challenges the first INVITE with 407 Proxy Authentication Required. This is RFC 3665 §3.2 in full: Module 13 explained the digest; here it is in the context of the whole call.

RFC 3261 §22.3 · Proxy-to-User Authentication
“The proxy MUST populate the 407 (Proxy Authentication Required) message with a Proxy-Authenticate header field value applicable to the proxy for the requested resource.”
Read the section ↗

Flow builder · RFC 3665 §3.2: a 407 challenge

Bob answers, through two proxies

  • SIP
  • RTP media
Path
Outcome
What if
Lost packet
Forwarding
Hangs up

Alice192.0.2.10Proxy A198.51.100.10Proxy B203.0.113.10Bob203.0.113.2001INVITE02407 Proxy Auth Required03ACK04INVITE (credentials)05100 Trying06INVITE07100 Trying08INVITE09180 Ringing10180 Ringing11180 Ringing12200 OK13200 OK14200 OK15ACK16ACK17ACK18RTP audio (PCMU)19BYE20BYE21BYE22200 OK (BYE)23200 OK (BYE)24200 OK (BYE)
01/24

Alice's phone sends the INVITE to Proxy A, its outbound proxy, with no credentials. The SDP offer lists PCMU and PCMA.

All steps as text
  1. Alice → Proxy A: INVITE. Alice's phone sends the INVITE to Proxy A, its outbound proxy, with no credentials. The SDP offer lists PCMU and PCMA.
  2. Proxy A → Alice: 407 Proxy Auth Required. Proxy A rejects the INVITE with 407. Proxy-Authenticate carries the realm and a nonce.
  3. Alice → Proxy A: ACK. Alice's phone confirms the final response. The ACK reuses the INVITE branch.
  4. Alice → Proxy A: INVITE (credentials). Alice's phone sends the INVITE again, with Proxy-Authorization. CSeq is now 2, and the branch is new.
  5. Proxy A → Alice: 100 Trying. Proxy A answers 100 Trying, so Alice's phone stops retransmitting the INVITE.
  6. Proxy A → Proxy B: INVITE. Proxy A accepts the credentials and removes them. It removes its own Route entry, adds its Via and a Record-Route, and forwards the INVITE.
  7. Proxy B → Proxy A: 100 Trying. Proxy B answers 100 Trying. A 100 Trying travels one hop only.
  8. Proxy B → Bob: INVITE. Proxy B finds Bob's Contact in its location service. It adds its Via and a Record-Route and sends the INVITE there.
  9. Bob → Proxy B: 180 Ringing. Bob's phone rings. The To tag in the 180 creates an early dialog.
  10. Proxy B → Proxy A: 180 Ringing. Proxy B removes its own Via and forwards the 180.
  11. Proxy A → Alice: 180 Ringing. Proxy A forwards the 180. Alice's phone plays a ringback tone.
  12. Bob → Proxy B: 200 OK. Bob answers. The 200 OK carries the SDP answer: PCMU.
  13. Proxy B → Proxy A: 200 OK. Proxy B removes its own Via and forwards the 200 OK.
  14. Proxy A → Alice: 200 OK. Proxy A forwards the 200 OK. Alice's phone reverses the Record-Route list to build the route set.
  15. Alice → Proxy A: ACK. Alice's phone sends the ACK, with a new branch. The ACK follows the route set.
  16. Proxy A → Proxy B: ACK. Proxy A removes its own Route entry and forwards the ACK.
  17. Proxy B → Bob: ACK. Proxy B removes its own Route entry and forwards the ACK.
  18. Alice → Bob: RTP audio (PCMU). Alice and Bob send RTP straight to each other. The proxies never see the media.
  19. Alice → Proxy A: BYE. Alice hangs up. The BYE goes to the remote target, through the route set.
  20. Proxy A → Proxy B: BYE. Proxy A removes its own Route entry and forwards the BYE.
  21. Proxy B → Bob: BYE. Proxy B removes its own Route entry and forwards the BYE.
  22. Bob → Proxy B: 200 OK (BYE). Bob's phone confirms the BYE. The dialog ends.
  23. Proxy B → Proxy A: 200 OK (BYE). Proxy B forwards the 200 OK.
  24. Proxy A → Alice: 200 OK (BYE). Proxy A forwards the 200 OK.

Follow the CSeq: 1 for the first INVITE and the ACK for the 407, 2 for the INVITE with credentials and the ACK for the 200 OK, and 3 for Alice’s BYE. The Call-ID and the From tag never change. Proxy A removes the Proxy-Authorization header before it forwards the INVITE, because those credentials are for its own realm only. Proxy B never sees them.

21.5 Busy (486), no answer (480/408), rejected (603), not found (404)

A call can fail at Bob’s phone or at a proxy. In each case the failure response travels back to Alice’s phone, and each hop confirms it with its own ACK:

RFC 3665 §3.9 · Unsuccessful Busy
“Note that the non-2xx response is acknowledged on a hop-by-hop basis instead of end-to-end.”
Read the section ↗
Outcome Code Sent by When RFC 3665
Busy 486 Busy Here Bob’s phone At once: Bob is on another call §3.9
No answer 480 Temporarily Unavailable Bob’s phone After ringing: the phone’s no-answer timer, or “do not disturb” §3.11
No response 408 Request Timeout Proxy B 32 s (Timer B) after an INVITE that nothing answers §3.10 (shown with 480)
Declined 603 Decline Bob’s phone Bob presses Reject —
Not found 404 Not Found Proxy B The user does not exist in the domain —

Pick an outcome in the builder:

Flow builder · failure responses

Bob is busy, through two proxies

  • SIP
Path
Outcome
What if
Lost packet
Forwarding
Hangs up

Alice192.0.2.10Proxy A198.51.100.10Proxy B203.0.113.10Bob203.0.113.2001INVITE02100 Trying03INVITE04100 Trying05INVITE06486 Busy Here07ACK08486 Busy Here09ACK10486 Busy Here11ACK
01/11

Alice's phone sends the INVITE to Proxy A, its outbound proxy. The SDP offer lists PCMU and PCMA.

All steps as text
  1. Alice → Proxy A: INVITE. Alice's phone sends the INVITE to Proxy A, its outbound proxy. The SDP offer lists PCMU and PCMA.
  2. Proxy A → Alice: 100 Trying. Proxy A answers 100 Trying, so Alice's phone stops retransmitting the INVITE.
  3. Proxy A → Proxy B: INVITE. Proxy A removes its own Route entry, adds its Via and a Record-Route, and forwards the INVITE.
  4. Proxy B → Proxy A: 100 Trying. Proxy B answers 100 Trying. A 100 Trying travels one hop only.
  5. Proxy B → Bob: INVITE. Proxy B finds Bob's Contact in its location service. It adds its Via and a Record-Route and sends the INVITE there.
  6. Bob → Proxy B: 486 Busy Here. Bob is already on another call. His phone rejects the INVITE at once.
  7. Proxy B → Bob: ACK. Proxy B confirms the 486 on its own hop, with the branch of its INVITE.
  8. Proxy B → Proxy A: 486 Busy Here. Proxy B removes its own Via and forwards the 486.
  9. Proxy A → Proxy B: ACK. Proxy A confirms the 486 on its own hop, with the branch of its INVITE.
  10. Proxy A → Alice: 486 Busy Here. Proxy A removes its own Via and forwards the 486.
  11. Alice → Proxy A: ACK. Alice's phone confirms the final response. The ACK reuses the INVITE branch.
RFC 3261 §21.4.18 · 480 Temporarily Unavailable
“The callee's end system was contacted successfully but the callee is currently unavailable (for example, is not logged in, logged in but in a state that precludes communication with the callee, or has activated the "do not disturb" feature).”
Read the section ↗

“No answer” has three possible ends, depending on which timer fires first:

  • Bob’s phone stops ringing after its own no-answer timer and sends 480 (RFC 3665 §3.11).

  • A proxy has a ring timeout of its own. When it fires, the proxy cancels the branch to Bob and answers Alice itself, often with 408 or 480. RFC 3261 calls the proxy’s INVITE timer Timer CTimer C. A proxy's timer for an INVITE that has received a provisional response but no final one (longer than 3 minutes). When it fires, the proxy cancels that branch.:

    RFC 3261 §16.8 · Processing Timer C
    “If the client transaction has received a provisional response, the proxy MUST generate a CANCEL request matching that transaction. If the client transaction has not received a provisional response, the proxy MUST behave as if the transaction received a 408 (Request Timeout) response.”
    Read the section ↗
  • Alice gives up first and hangs up: that is a CANCEL (21.6). RFC 3665 §3.8 calls this flow “Unsuccessful No Answer”.

“No response” is different: nothing answers at all, not even a 180. Bob’s phone is unplugged, but its binding has not expired yet. The proxy retransmits the INVITE until Timer B fires. RFC 3665 shows a 480 here:

RFC 3665 §3.10 · Unsuccessful No Response from User Agent
“In this example, there is no response from Bob to Alice's INVITE messages being re-transmitted by Proxy 2. After the sixth re-transmission, Proxy 2 gives up and sends a 480 No Response to Alice.”
Read the section ↗

A proxy can send either code. A 408 says that the request timed out; a 480 says that Bob is unavailable. Many proxies let you choose, and some phones show the two differently.

A 603 means that Bob does not want the call, on any device. A forking proxy that receives a 6xx cancels its other branches and tries no new ones (21.10). A 404 means that the user does not exist; for a user who exists but has no binding, a proxy sends 480 (see Common mistakes).

21.6 The caller cancels: CANCEL → 200 (CANCEL) → 487 → ACK

Alice hangs up while Bob’s phone rings. Her phone sends a CANCEL, which Proxy A answers itself and then sends on, hop by hop, with the branch of its own INVITE on that hop. The 200 OK to the CANCEL means only “CANCEL received”. The INVITE ends with 487 Request Terminated, which travels back like any other failure response, with an ACK on each hop:

Flow builder · RFC 3665 §3.8: Alice cancels

Alice hangs up first, through two proxies

  • SIP
Path
Outcome
What if
Lost packet
Forwarding
Hangs up

Alice192.0.2.10Proxy A198.51.100.10Proxy B203.0.113.10Bob203.0.113.2001INVITE02100 Trying03INVITE04100 Trying05INVITE06180 Ringing07180 Ringing08180 Ringing09CANCEL10200 OK (CANCEL)11CANCEL12200 OK (CANCEL)13CANCEL14200 OK (CANCEL)15487 Request Terminated16ACK17487 Request Terminated18ACK19487 Request Terminated20ACK
01/20

Alice's phone sends the INVITE to Proxy A, its outbound proxy. The SDP offer lists PCMU and PCMA.

All steps as text
  1. Alice → Proxy A: INVITE. Alice's phone sends the INVITE to Proxy A, its outbound proxy. The SDP offer lists PCMU and PCMA.
  2. Proxy A → Alice: 100 Trying. Proxy A answers 100 Trying, so Alice's phone stops retransmitting the INVITE.
  3. Proxy A → Proxy B: INVITE. Proxy A removes its own Route entry, adds its Via and a Record-Route, and forwards the INVITE.
  4. Proxy B → Proxy A: 100 Trying. Proxy B answers 100 Trying. A 100 Trying travels one hop only.
  5. Proxy B → Bob: INVITE. Proxy B finds Bob's Contact in its location service. It adds its Via and a Record-Route and sends the INVITE there.
  6. Bob → Proxy B: 180 Ringing. Bob's phone rings. The To tag in the 180 creates an early dialog.
  7. Proxy B → Proxy A: 180 Ringing. Proxy B removes its own Via and forwards the 180.
  8. Proxy A → Alice: 180 Ringing. Proxy A forwards the 180. Alice's phone plays a ringback tone.
  9. Alice → Proxy A: CANCEL. Alice hangs up before Bob answers. The CANCEL copies the Request-URI, Call-ID, From, To, and branch of the INVITE.
  10. Proxy A → Alice: 200 OK (CANCEL). Proxy A answers the CANCEL itself. A CANCEL travels hop by hop.
  11. Proxy A → Proxy B: CANCEL. Proxy A sends its own CANCEL on its own hop, with the branch of its own INVITE.
  12. Proxy B → Proxy A: 200 OK (CANCEL). Proxy B answers the CANCEL itself. A CANCEL travels hop by hop.
  13. Proxy B → Bob: CANCEL. Proxy B sends its own CANCEL on its own hop, with the branch of its own INVITE.
  14. Bob → Proxy B: 200 OK (CANCEL). Bob's phone stops ringing and answers the CANCEL.
  15. Bob → Proxy B: 487 Request Terminated. Bob's phone ends the INVITE transaction with 487.
  16. Proxy B → Bob: ACK. Proxy B confirms the 487 on its own hop, with the branch of its INVITE.
  17. Proxy B → Proxy A: 487 Request Terminated. Proxy B removes its own Via and forwards the 487.
  18. Proxy A → Proxy B: ACK. Proxy A confirms the 487 on its own hop, with the branch of its INVITE.
  19. Proxy A → Alice: 487 Request Terminated. Proxy A removes its own Via and forwards the 487.
  20. Alice → Proxy A: ACK. Alice's phone confirms the final response. The ACK reuses the INVITE branch.

Two rules from Module 5 and Module 8 matter here. A phone sends a CANCEL only after it has received a provisional response; before that, the CANCEL may arrive before the INVITE. And a CANCEL has no effect once the INVITE has a final response. If a 200 OK crosses the CANCEL, the call is up, and Alice’s phone must end it properly:

RFC 3665 §3.8 · Unsuccessful No Answer
“If a 200 OK to the INVITE had crossed with the CANCEL, Alice would have sent an ACK then a BYE to Bob in order to properly terminate the call.”
Read the section ↗

21.7 Early media (183 with SDP)

early mediaearly media. Audio sent before the call is answered, such as a ringback tone or an announcement from the far network. is media before the call is answered: a ringback tone from the far network, an announcement such as “the number you called is not available”, or an IVR. Bob’s side sends 183 Session Progress with the SDP answer, and starts RTP at once. The 183 creates an early dialog, like a 180:

RFC 3261 §13.3.1.1 · Progress
“This is accomplished with a provisional response between 101 and 199. These provisional responses establish early dialogs and therefore follow the procedures of Section 12.1.1 in addition to those of Section 8.2.6.”
Read the section ↗

Flow builder · early media in a 183

Bob answers, through two proxies

  • SIP
  • RTP media
Path
Outcome
What if
Lost packet
Forwarding
Hangs up

Alice192.0.2.10Proxy A198.51.100.10Proxy B203.0.113.10Bob203.0.113.2001INVITE02100 Trying03INVITE04100 Trying05INVITE06183 Session Progress07183 Session Progress08183 Session Progress09RTP early media10200 OK11200 OK12200 OK13ACK14ACK15ACK16RTP audio (PCMU)17BYE18BYE19BYE20200 OK (BYE)21200 OK (BYE)22200 OK (BYE)
01/22

Alice's phone sends the INVITE to Proxy A, its outbound proxy. The SDP offer lists PCMU and PCMA.

All steps as text
  1. Alice → Proxy A: INVITE. Alice's phone sends the INVITE to Proxy A, its outbound proxy. The SDP offer lists PCMU and PCMA.
  2. Proxy A → Alice: 100 Trying. Proxy A answers 100 Trying, so Alice's phone stops retransmitting the INVITE.
  3. Proxy A → Proxy B: INVITE. Proxy A removes its own Route entry, adds its Via and a Record-Route, and forwards the INVITE.
  4. Proxy B → Proxy A: 100 Trying. Proxy B answers 100 Trying. A 100 Trying travels one hop only.
  5. Proxy B → Bob: INVITE. Proxy B finds Bob's Contact in its location service. It adds its Via and a Record-Route and sends the INVITE there.
  6. Bob → Proxy B: 183 Session Progress. Bob's phone answers the offer in a 183, before anybody picks up. The To tag creates an early dialog.
  7. Proxy B → Proxy A: 183 Session Progress. Proxy B removes its own Via and forwards the 183 and its SDP.
  8. Proxy A → Alice: 183 Session Progress. Proxy A removes its own Via and forwards the 183 and its SDP.
  9. Bob → Alice: RTP early media. Bob's side sends a ringback tone or an announcement as RTP. Alice's phone plays it and makes no tone of its own.
  10. Bob → Proxy B: 200 OK. Bob answers. The 200 OK repeats the SDP of the 183, so the media goes on unchanged.
  11. Proxy B → Proxy A: 200 OK. Proxy B removes its own Via and forwards the 200 OK.
  12. Proxy A → Alice: 200 OK. Proxy A forwards the 200 OK. Alice's phone reverses the Record-Route list to build the route set.
  13. Alice → Proxy A: ACK. Alice's phone sends the ACK, with a new branch. The ACK follows the route set.
  14. Proxy A → Proxy B: ACK. Proxy A removes its own Route entry and forwards the ACK.
  15. Proxy B → Bob: ACK. Proxy B removes its own Route entry and forwards the ACK.
  16. Alice → Bob: RTP audio (PCMU). Alice and Bob send RTP straight to each other. The proxies never see the media.
  17. Alice → Proxy A: BYE. Alice hangs up. The BYE goes to the remote target, through the route set.
  18. Proxy A → Proxy B: BYE. Proxy A removes its own Route entry and forwards the BYE.
  19. Proxy B → Bob: BYE. Proxy B removes its own Route entry and forwards the BYE.
  20. Bob → Proxy B: 200 OK (BYE). Bob's phone confirms the BYE. The dialog ends.
  21. Proxy B → Proxy A: 200 OK (BYE). Proxy B forwards the 200 OK.
  22. Proxy A → Alice: 200 OK (BYE). Proxy A forwards the 200 OK.

Alice’s phone must decide what to play: its own ringback toneringback tone. The tone the caller hears while the callee's phone rings. The caller's phone makes it locally after a 180, unless early media arrives from the far end., or the media that arrives. RFC 3960 gives the rule:

RFC 3960 §3.2 · Ringing Tone Generation
“Such a UAC is supposed to generate ringing tones locally for its user as long as no early media is received from the UAS. If the UAS generates early media (e.g., an announcement or a special ringing tone), the UAC is supposed to play it rather than generate the ringing tone locally.”
Read the section ↗

The SIP messages alone do not tell the phone whether media will come, so a good phone also checks for incoming RTP:

RFC 3960 §3.2 · Ringing Tone Generation
“Therefore, by only looking at the SIP signalling, a UAC cannot be sure whether or not there will be early media for a particular session. The UAC needs to check if media packets are arriving at a given moment.”
Read the section ↗

Without 100rel (Module 22), a 183 is not reliable: it can be lost, and nobody resends it. That is why the 200 OK repeats the same SDP, with the same version in the o= line. Try Outcome: Declines (603) with early media on: carriers use exactly this to play an announcement before a failure response.

21.8 Late offer (SDP in the 200 OK and in the ACK)

In a late offerlate offer. The INVITE has no SDP. The offer is in the 200 OK (or a reliable 1xx), and the answer is in the ACK (or PRACK)., the INVITE has no SDP. Bob’s 200 OK carries the offer, and Alice’s ACK carries the answer. RFC 3665 §3.6 uses it, and so do some PBXs, gateways, and third-party call control (Module 22).

RFC 3261 §13.2.1 · Creating the Initial INVITE
“Concretely, the above rules specify two exchanges for UAs compliant to this specification alone - the offer is in the INVITE, and the answer in the 2xx (and possibly in a 1xx as well, with the same value), or the offer is in the 2xx, and the answer is in the ACK.”
Read the section ↗

Flow builder · late offer

Bob answers, through two proxies

  • SIP
  • RTP media
Path
Outcome
What if
Lost packet
Forwarding
Hangs up

Alice192.0.2.10Proxy A198.51.100.10Proxy B203.0.113.10Bob203.0.113.2001INVITE (no SDP)02100 Trying03INVITE04100 Trying05INVITE06180 Ringing07180 Ringing08180 Ringing09200 OK (offer)10200 OK (offer)11200 OK (offer)12ACK (answer)13ACK (answer)14ACK (answer)15RTP audio (PCMU)16BYE17BYE18BYE19200 OK (BYE)20200 OK (BYE)21200 OK (BYE)
01/21

Alice's phone sends the INVITE to Proxy A, its outbound proxy. It has no SDP: Bob will make the offer.

All steps as text
  1. Alice → Proxy A: INVITE (no SDP). Alice's phone sends the INVITE to Proxy A, its outbound proxy. It has no SDP: Bob will make the offer.
  2. Proxy A → Alice: 100 Trying. Proxy A answers 100 Trying, so Alice's phone stops retransmitting the INVITE.
  3. Proxy A → Proxy B: INVITE. Proxy A removes its own Route entry, adds its Via and a Record-Route, and forwards the INVITE.
  4. Proxy B → Proxy A: 100 Trying. Proxy B answers 100 Trying. A 100 Trying travels one hop only.
  5. Proxy B → Bob: INVITE. Proxy B finds Bob's Contact in its location service. It adds its Via and a Record-Route and sends the INVITE there.
  6. Bob → Proxy B: 180 Ringing. Bob's phone rings. The To tag in the 180 creates an early dialog.
  7. Proxy B → Proxy A: 180 Ringing. Proxy B removes its own Via and forwards the 180.
  8. Proxy A → Alice: 180 Ringing. Proxy A forwards the 180. Alice's phone plays a ringback tone.
  9. Bob → Proxy B: 200 OK (offer). Bob answers. The INVITE had no SDP, so the 200 OK carries Bob's offer.
  10. Proxy B → Proxy A: 200 OK (offer). Proxy B removes its own Via and forwards the 200 OK.
  11. Proxy A → Alice: 200 OK (offer). Proxy A forwards the 200 OK. Alice's phone reverses the Record-Route list to build the route set.
  12. Alice → Proxy A: ACK (answer). Alice's phone sends its SDP answer in the ACK. The ACK follows the route set.
  13. Proxy A → Proxy B: ACK (answer). Proxy A removes its own Route entry and forwards the ACK.
  14. Proxy B → Bob: ACK (answer). Proxy B removes its own Route entry and forwards the ACK.
  15. Alice → Bob: RTP audio (PCMU). Alice and Bob send RTP straight to each other. The proxies never see the media.
  16. Alice → Proxy A: BYE. Alice hangs up. The BYE goes to the remote target, through the route set.
  17. Proxy A → Proxy B: BYE. Proxy A removes its own Route entry and forwards the BYE.
  18. Proxy B → Bob: BYE. Proxy B removes its own Route entry and forwards the BYE.
  19. Bob → Proxy B: 200 OK (BYE). Bob's phone confirms the BYE. The dialog ends.
  20. Proxy B → Proxy A: 200 OK (BYE). Proxy B forwards the 200 OK.
  21. Proxy A → Alice: 200 OK (BYE). Proxy A forwards the 200 OK.

Three consequences:

  • The ACK must carry the answer. An ACK without SDP leaves Bob with no address and no codec for Alice.
  • Alice cannot reject the offer in the ACK. If nothing in it suits her, she must answer anyway, and then end the call with BYE or change it with a re-INVITE.
  • Bob cannot send early media: he has no offer to answer before the 200 OK. (A 183 with an offer needs 100rel and PRACK, Module 22.)

21.9 Redirect (302)

A Redirect serverRedirect server. A UAS that answers a request with a 3xx response and a list of Contact addresses to try. does not forward the INVITE. It looks up the target and returns it in the Contact header of a 3xx response. The caller then tries the new address itself:

RFC 3261 §21.3.3 · 302 Moved Temporarily
“The requesting client SHOULD retry the request at the new address(es) given by the Contact header field (Section 20.10). The Request-URI of the new request uses the value of the Contact header field in the response.”
Read the section ↗

Flow builder · a redirect, then a new INVITE

Bob answers, after a redirect

  • SIP
  • RTP media
Path
Outcome
What if
Lost packet
Forwarding
Hangs up

Alice192.0.2.10Redirect server203.0.113.30Bob203.0.113.2001INVITE02302 Moved Temporarily03ACK04INVITE (new target)05180 Ringing06200 OK07ACK08RTP audio (PCMU)09BYE10200 OK (BYE)
01/10

Alice's phone sends the INVITE for Bob's AOR to the server for biloxi.example. The SDP offer lists PCMU and PCMA.

All steps as text
  1. Alice → Redirect server: INVITE. Alice's phone sends the INVITE for Bob's AOR to the server for biloxi.example. The SDP offer lists PCMU and PCMA.
  2. Redirect server → Alice: 302 Moved Temporarily. The Redirect server finds Bob's Contact address. It sends the address back and does not forward the INVITE.
  3. Alice → Redirect server: ACK. Alice's phone confirms the final response. The ACK reuses the INVITE branch.
  4. Alice → Bob: INVITE (new target). Alice's phone sends a new INVITE straight to the Contact address. The CSeq is now 2, and the branch is new.
  5. Bob → Alice: 180 Ringing. Bob's phone rings, and Alice's phone plays a ringback tone. The To tag in the 180 creates an early dialog.
  6. Bob → Alice: 200 OK. Bob answers. The 200 OK carries the SDP answer: PCMU.
  7. Alice → Bob: ACK. Alice's phone sends the ACK, with a new branch. It goes straight to Bob's Contact address.
  8. Alice → Bob: RTP audio (PCMU). Alice and Bob send RTP straight to each other, to the addresses in the SDP.
  9. Alice → Bob: BYE. Alice hangs up. The BYE goes to the remote target, straight to the Contact address.
  10. Bob → Alice: 200 OK (BYE). Bob's phone confirms the BYE. The dialog ends.

The new INVITE keeps the Call-ID, the From tag, and the To header (still without a tag), and uses CSeq 2 and a new branch: it is a new transaction in the same call attempt (RFC 3261 §8.1.3.4). The Redirect server keeps no state for the call, and it is never in the dialog. RFC 3665 §3.6 combines a redirect with a proxy and a late offer.

21.10 Forking: parallel and sequential

When Proxy B finds more than one Contact for Bob’s AOR, it can try them all at once, or one after another:

RFC 3261 §16.6 · Request Forwarding
“A stateful proxy MAY process the set in any order. It MAY process multiple targets serially, allowing each client transaction to complete before starting the next. It MAY start client transactions with every target in parallel.”
Read the section ↗

Parallel forking rings every device. Each one that rings makes its own early dialog with Alice’s phone, with its own To tag. The first 2xx wins; Proxy B forwards it and cancels every other branch that is still ringing:

RFC 3261 §16.7 · Response Processing
“If the forwarded response was a final response, the proxy MUST generate a CANCEL request for all pending client transactions associated with this response context.”
Read the section ↗

Flow builder · parallel forking

Bob answers, with parallel forking

  • SIP
  • RTP media
Path
Outcome
What if
Lost packet
Forwarding
Hangs up

Alice192.0.2.10Proxy B203.0.113.10Desk phone203.0.113.20Mobile203.0.113.4001INVITE02100 Trying03INVITE04INVITE05180 Ringing06180 Ringing07180 Ringing08180 Ringing09200 OK10200 OK11CANCEL12200 OK (CANCEL)13487 Request Terminated14ACK15ACK16ACK17RTP audio (PCMU)18BYE19BYE20200 OK (BYE)21200 OK (BYE)
01/21

Alice's phone sends the INVITE to Proxy B, the proxy for biloxi.example. The SDP offer lists PCMU and PCMA.

All steps as text
  1. Alice → Proxy B: INVITE. Alice's phone sends the INVITE to Proxy B, the proxy for biloxi.example. The SDP offer lists PCMU and PCMA.
  2. Proxy B → Alice: 100 Trying. Proxy B answers 100 Trying, so Alice's phone stops retransmitting the INVITE.
  3. Proxy B → Desk phone: INVITE. Proxy B finds two Contacts for Bob. It forks: first a copy to the Desk phone, with its own branch.
  4. Proxy B → Mobile: INVITE. At the same time, a second copy goes to the Mobile, with another branch.
  5. Desk phone → Proxy B: 180 Ringing. The Desk phone rings. Its own To tag makes its own early dialog with Alice.
  6. Proxy B → Alice: 180 Ringing. Proxy B forwards the 180. Alice's phone now has an early dialog with this phone.
  7. Mobile → Proxy B: 180 Ringing. The Mobile rings. Its own To tag makes its own early dialog with Alice.
  8. Proxy B → Alice: 180 Ringing. Proxy B forwards the 180. Alice's phone now has two early dialogs, one with each phone.
  9. Desk phone → Proxy B: 200 OK. Bob answers on the Desk phone. The 200 OK carries its SDP answer.
  10. Proxy B → Alice: 200 OK. Proxy B forwards the 200 OK. Its To tag selects the dialog with the Desk phone.
  11. Proxy B → Mobile: CANCEL. Proxy B cancels the branch that is still ringing: the Mobile.
  12. Mobile → Proxy B: 200 OK (CANCEL). The Mobile stops ringing and answers the CANCEL.
  13. Mobile → Proxy B: 487 Request Terminated. The Mobile ends its INVITE transaction with 487.
  14. Proxy B → Mobile: ACK. Proxy B confirms the 487 on this hop. It forwards nothing to Alice yet.
  15. Alice → Proxy B: ACK. Alice's phone sends the ACK to the Desk phone, through Proxy B. The other early dialog ends.
  16. Proxy B → Desk phone: ACK. Proxy B removes its own Route entry and forwards the ACK.
  17. Alice → Desk phone: RTP audio (PCMU). Alice and Bob talk, on the Desk phone. The RTP goes straight between the two phones.
  18. Alice → Proxy B: BYE. Alice hangs up. The BYE goes to the remote target, through the route set.
  19. Proxy B → Desk phone: BYE. Proxy B removes its own Route entry and forwards the BYE.
  20. Desk phone → Proxy B: 200 OK (BYE). Bob's phone confirms the BYE. The dialog ends.
  21. Proxy B → Alice: 200 OK (BYE). Proxy B forwards the 200 OK.

Sequential forking (“hunting”) tries one device at a time, usually in the order of the q-values in the Contact headers. Proxy B gives each device a ring time, then cancels it and tries the next. The 487 from a cancelled device stays at Proxy B: Alice’s phone sees only the early dialogs, one after the other. Switch the path to Forking: sequential to compare.

A 6xx stops a forked call completely:

RFC 3261 §16.7 · Response Processing
“If a 6xx response is received, it is not immediately forwarded, but the stateful proxy SHOULD cancel all client pending transactions as described in Section 10, and it MUST NOT create any new branches in this context.”
Read the section ↗

Two devices can still both answer, if their 200 OKs cross the CANCEL. Module 9 shows how Alice’s phone handles that: it ACKs both, and ends the extra dialog with a BYE.

Common mistakes

No ACK after the 487 that follows a CANCEL

A softphone sends a CANCEL, receives the 200 OK for it, and treats the call as over. When the 487 arrives, it sends nothing. Proxy B retransmits the 487 for 32 seconds; some proxies log each one as an error, and an SBC may count the call as still open. The phone sees no problem at all.

Broken

Broken: Alice's phone never ACKs the 487

  • SIP
  • ⚠Problem
Alice192.0.2.10Proxy B203.0.113.10Bob203.0.113.2001INVITE02100 Trying03INVITE04180 Ringing05180 Ringing06CANCEL07200 OK (CANCEL)08CANCEL09200 OK (CANCEL)10487 Request Terminated11ACK12487 Request Terminated⚠13487 (retransmission)
01/13

Alice's phone calls Bob through Proxy B.

All steps as text
  1. Alice → Proxy B: INVITE. Alice's phone calls Bob through Proxy B.
  2. Proxy B → Alice: 100 Trying. Proxy B answers 100 Trying. It keeps state for the INVITE transaction.
  3. Proxy B → Bob: INVITE. Proxy B forwards the INVITE to Bob's phone.
  4. Bob → Proxy B: 180 Ringing. Bob's phone rings.
  5. Proxy B → Alice: 180 Ringing. Alice hears the ringback tone.
  6. Alice → Proxy B: CANCEL. Alice hangs up before Bob answers. The CANCEL copies the Request-URI, Call-ID, From, To, and branch of the INVITE.
  7. Proxy B → Alice: 200 OK (CANCEL). Proxy B answers the CANCEL itself. CANCEL is hop-by-hop.
  8. Proxy B → Bob: CANCEL. Proxy B sends its own CANCEL on its own hop, with the branch of its own INVITE.
  9. Bob → Proxy B: 200 OK (CANCEL). Bob's phone stops ringing and answers the CANCEL.
  10. Bob → Proxy B: 487 Request Terminated. Bob's phone ends the INVITE transaction with 487.
  11. Proxy B → Bob: ACK. Proxy B confirms the 487 on its hop. This ACK reuses the branch of the INVITE.
  12. Proxy B → Alice: 487 Request Terminated. Proxy B forwards the 487 to Alice's phone. Problem: Alice's phone sends no ACK. The CANCEL got its 200 OK, but the INVITE transaction still needs one.
  13. Proxy B → Alice: 487 (retransmission). No ACK arrives, so Proxy B sends the 487 again, and again, until Timer H fires after 32 s.

Remember: the 200 OK ends the CANCEL transaction, not the INVITE transaction. The INVITE gets its own final response, the 487, and every final response to an INVITE needs an ACK.

Local ringback while the network also sends early media

A phone plays its own ringback tone whenever it gets a 180 or a 183, and starts to play RTP only after the 200 OK. Calls to the phone network sound normal, until a number is out of service: the network plays an announcement in early media, the caller hears ringing, and the call fails with no explanation. The opposite mistake is a phone that mutes its ringback after a 183 and then gets no RTP at all: the caller hears silence and hangs up.

Problem: local ringback

Problem: the phone plays its own ringback over early media

  • SIP
  • RTP media
  • ⚠Problem
Alice192.0.2.10Proxy A198.51.100.10Carrier gateway198.51.100.8001INVITE02100 Trying03INVITE04100 Trying05183 Session Progress06183 Session Progress07RTP early media⚠08200 OK09200 OK10ACK11ACK
01/11

Alice's phone calls a phone number in the public telephone network.

All steps as text
  1. Alice → Proxy A: INVITE. Alice's phone calls a phone number in the public telephone network.
  2. Proxy A → Alice: 100 Trying. Proxy A answers 100 Trying on its hop. Alice's phone stops retransmitting.
  3. Proxy A → Carrier gateway: INVITE. Proxy A routes the number to the Carrier gateway.
  4. Carrier gateway → Proxy A: 100 Trying. The gateway answers 100 Trying to Proxy A. Proxy A does not forward it.
  5. Carrier gateway → Proxy A: 183 Session Progress. The far exchange starts to alert the callee. The gateway sends 183 with SDP for early media.
  6. Proxy A → Alice: 183 Session Progress. Proxy A forwards the 183. Alice's phone treats it like a 180 and starts its own ringback tone.
  7. Carrier gateway → Alice: RTP early media. The far network sends its ringback tone, or an announcement, as RTP. Alice's phone does not play it. Problem: Alice hears her phone's local tone instead. She misses any announcement from the network.
  8. Carrier gateway → Proxy A: 200 OK. The callee answers. The gateway sends 200 OK.
  9. Proxy A → Alice: 200 OK. Proxy A forwards the 200 OK. The same media stream now carries the conversation.
  10. Alice → Proxy A: ACK. Alice's phone confirms the 200 OK. Proxy A record-routed, so the ACK passes through it.
  11. Proxy A → Carrier gateway: ACK. Proxy A forwards the ACK to the gateway. The call is up.

Remember: after a 180 with no incoming media, play local ringback. When RTP arrives in an early dialog, play it and stop the local tone (RFC 3960 §3.2). Do not decide from the response code alone.

Late offer: an ACK without the answer

A gateway sends INVITEs without SDP. A new PBX answers with an offer in the 200 OK, as it should. The gateway sends a plain ACK, because its ACK code was written for early offers only. The call connects, and neither side hears anything: the PBX has no address to send media to.

Broken

Broken: a late offer with no answer in the ACK

  • SIP
  • Lost
  • ⚠Problem
Alice192.0.2.10Bob203.0.113.2001INVITE (no SDP)02180 Ringing03200 OK (offer)04ACK (no SDP)⚠05RTP never starts
01/05

The INVITE has no body. Gateways and B2BUAs do this when they do not know the media yet.

All steps as text
  1. Alice → Bob: INVITE (no SDP). The INVITE has no body. Gateways and B2BUAs do this when they do not know the media yet.
  2. Bob → Alice: 180 Ringing. Bob's phone rings. No SDP yet.
  3. Bob → Alice: 200 OK (offer). Bob answers the call. Because the INVITE had no offer, Bob's 200 OK must carry one.
  4. Alice → Bob: ACK (no SDP). Alice's phone sends the ACK with no body. It ignored the offer in the 200 OK. Problem: Bob's offer has no answer. Bob does not know where to send media, or which codec Alice accepts.
  5. Bob → Alice: RTP never starts. The call is up, but Bob sends no media. He has no address and no codec for Alice.

Remember: if the INVITE had no SDP, the 2xx has the offer, and the ACK must have the answer. The course’s checker calls this rule late-offer-ack.

404 for a user who exists but is offline

A proxy answers 404 whenever the location service has no binding. Bob’s phone reboots, and for a minute every caller hears “number does not exist”. Some carriers and PBXs then mark the number as invalid, or stop forwarding to voicemail, because 404 says that the user does not exist at all.

RFC 3261 §16.5 · Determining Request Targets
“If the target set remains empty after applying all of the above, the proxy MUST return an error response, which SHOULD be the 480 (Temporarily Unavailable) response.”
Read the section ↗

Remember: 404 for a user that the domain does not know; 480 for a known user with no binding. On the public Internet, consider answering both the same way, so that an attacker cannot use the difference to list your users (Module 14).

Summary

  • Registration: REGISTER to the registrar, 200 OK with every binding. On the Internet, a 401 challenge first, and a retry with credentials, CSeq + 1, and a new branch.
  • A basic call: INVITE with the offer, 180 (early dialog), 200 OK with the answer (confirmed dialog), ACK, media, BYE.
  • Proxies answer 100 Trying, add Via, and forward. The last proxy puts Bob’s Contact in the Request-URI. With Record-Route, they stay in the path of the ACK and the BYE; without it, those go straight to the Contact.
  • Hop by hop: 100 Trying, CANCEL, and the ACK for a failure response. End to end: the 2xx, its ACK, and BYE.
  • Failures: 486 busy, 480 unavailable or no answer, 408 no response, 603 declined, 404 not found. Each one is ACKed on every hop.
  • CANCEL gets a 200 OK at each hop, then the INVITE ends with 487, which still needs an ACK. If a 200 OK crosses the CANCEL, send ACK and then BYE.
  • Early media: a 183 with the SDP answer, and RTP before the answer. Play it instead of local ringback.
  • Late offer: the offer in the 200 OK, the answer in the ACK.
  • Redirect: a 302 with a new Contact, an ACK, then a new INVITE with CSeq + 1 straight to that Contact.
  • Forking: parallel rings all and cancels the rest after the first 2xx; sequential tries one at a time. Each device makes its own early dialog.