Categories
Blog Knowledge Base Technical

Sip Call Messaging

It’s important to remember that:

Proxies and other servers can be involved: The messages may pass through one or more SIP proxy servers that help route the requests.

Provisional responses like 100 Trying and 180 Ringing provide valuable updates to the UAC during the potentially long process of call establishment.

SDP negotiation within the INVITE and 200 OK is essential for establishing compatible media parameters between the endpoints.

SIP handles the signaling only: RTP or similar protocols manage the actual media transmission during the active call phase.

Phase 1: Call Setup

The goal of the call setup phase is to establish communication between the caller (UAC, often the ‘Alice’ phone) and the called party (UAS, the ‘Bob’ phone). This involves locating the recipient and negotiating the technical parameters for the media stream (voice data) that will be used during the conversation.

  1. INVITE: The process begins when the caller’s UAC sends a SIP INVITE message. This message details the intent to start a session and contains the Session Description Protocol (SDP) body. SDP lists the caller’s media capabilities, such as supported voice codecs (e.g., G.711, G.729), IP address, and port number for receiving audio.
  2. 100 Trying: Upon receiving the INVITE, the server or the recipient’s phone immediately responds with a 100 Trying provisional response. This stops the UAC from retransmitting the INVITE, acknowledging that the request is being processed.
  3. 180 Ringing: When Bob’s phone actually starts alerting the user, it sends a 180 Ringing message. This tells Alice’s UAC that the destination phone is successfully ringing, which is often translated into a local ringback tone for the caller.
  4. 200 OK: Once Bob answers the phone, his UAS sends a final success response, 200 OK. Crucially, this message also contains Bob’s SDP information (codecs, IP, port) in response to Alice’s initial offering.
  5. ACK: The setup is completed when the caller sends a SIP ACK message. This confirms that Alice received the 200 OK and that both parties now agree on the session parameters.

Phase 2: Session Established (Media Flow)

Once the ACK message is sent, the SIP signalling path has successfully done its job: both endpoints know how to send audio data to each other. Now, the actual conversation can take place.

Notice that the control path (where SIP messages flow) is often separate from the data path (the conversation itself).

During the conversation:

  • RTP: The actual voice packets are not sent using SIP. Instead, they flow directly between the endpoints (or via media relays) using the Real-time Transport Protocol (RTP). RTP is designed for low-latency transmission, ensuring that voice data is received in time for a coherent conversation. The specifics of this flow—which IP address to send packets to, and which codec to use—were the parameters negotiated in the setup phase via SDP.
  • SIP Inactivity: In most simple calls, SIP messaging remains silent during the session established phase.

Phase 3: Call Teardown

This final phase occurs when either user decides to hang up, which formally ends the conversation and releases the associated network resources.

The teardown process is remarkably simple and consists of two main steps, regardless of which party terminates the call.

  1. BYE: When a user hangs up (in this example, Alice), her device sends a SIP BYE message. This is a clear signal to the other endpoint (Bob’s device) that the session is now over. This message travels along the same signalling path used during call setup.
  2. 200 OK: Bob’s UAC receives the BYE message, immediately stops sending RTP packets, and responds with a 200 OK final success response. This response acknowledges receipt of the BYE and completes the session termination. Both devices then return to an idle state.