SIP Forking: Types and Use Cases

Krishnakumar PG
3 min read6 days ago

Forking is a fundamental feature in the Session Initiation Protocol (SIP) used in VoIP communications. It allows a single call to ring multiple devices simultaneously or sequentially, ensuring calls are answered promptly.

SIP forking is an essential concept for both beginners and seasoned professionals involved in SIP-based communication systems. Forking allows a single SIP INVITE request to be sent to multiple endpoints, enabling features like simultaneous ringing on multiple devices. This can be particularly useful in environments where calls need to be managed flexibly and efficiently. Let’s dive into the specifics of SIP forking, its types, and its practical applications.

What is SIP Forking?

Imagine you’re trying to reach someone by phone, but instead of just calling their desk phone, your call rings their desk phone, mobile phone, and softphone on their computer all at once. This is SIP forking in action. SIP forking ensures that a single call attempt can reach multiple devices, increasing the chances that the call will be answered promptly.

Types of SIP Forking

Parallel Forking: In parallel forking, a SIP proxy server sends the same call invitation (INVITE) to multiple endpoints (e.g., desk phone, mobile phone) simultaneously. Each endpoint generates a “180 Ringing” response. The first endpoint to answer sends a “200 OK” response, establishing the session. Any remaining “200 OK” responses will be discarded, and “CANCEL” messages are sent to the other endpoints.

  • Called Devices: Desk phone (UA2), Mobile phone (UA3)
  • Process: Both devices ring. UA2 answers first, sending a “200 OK”. The call is established with UA2, and UA3 receives a “CANCEL”.

Sequential Forking: In sequential forking, the proxy server sends the INVITE to one endpoint first. If that endpoint is busy or unavailable, the proxy sends the INVITE to the next endpoint. This continues until the call is answered or all options are exhausted.

  • Called Devices: Desk phone (UA2), Mobile phone (UA3)
  • Process: INVITE is sent to UA2 first. If UA2 is unavailable, the INVITE is sent to UA3.

Branch-IDs and Tags:

  • Branch IDs in the Via header help proxies match responses to forked requests. Without them, proxies can’t understand the responses.
  • Tags, added by UACs, distinguish between multiple final responses from different UASs since a UAS can’t tell if a request was forked.
  • Proxies may also add tags when generating final responses, but they don’t insert tags into forwarded requests or responses.
  • If multiple proxy servers fork a request, each proxy adds its own unique IDs to the branches it creates.

Use Cases of SIP Forking:

  • Simultaneous Ringing: Allows a user’s desk phone, mobile phone, and softphone to ring at the same time, ensuring that calls are not missed regardless of the user’s location.
  • Failover Mechanism: If the primary device is unreachable, the call can be redirected to a secondary device, enhancing reliability.
  • Call Centre: Incoming calls can be forked to multiple available agents, ensuring quick connection times and efficient handling of customer inquiries.
  • Redundant proxies: Forking between redundant proxy servers can ensure reliability.

SIP forking is a powerful feature in SIP communication, enabling simultaneous ringing, failover mechanisms, and efficient call handling in environments like call centers. Understanding the differences between parallel and sequential forking, along with their use cases, helps in designing robust and reliable SIP-based communication systems.

What do you want us to cover next? Let me know in the comments.

Happy SIPing!

--

--