Understanding “SIP Diversion”

Krishnakumar PG
3 min readJun 3, 2024

--

SIP Trunking has revolutionized the way we communicate over the internet. By offering cost savings, flexibility, scalability, and advanced features, it’s no wonder why businesses are increasingly adopting this technology.

As we gain a deeper understanding of SIP, one crucial headers that often gets overlooked is “Diversion”. What happens when a call needs to be redirected? That’s where the SIP Diversion header comes in — a crucial component that enables us to redirect calls with ease and precision.

What is a SIP Diversion Header?

The SIP Diversion header is a field that can be added to a SIP message to indicate that a call has been redirected from another destination. It provides valuable information such as the original number, the reason for redirection, the identity of the redirecting party, privacy preferences, and the history of redirections. The header supports three parameters: counter, screened, and privacy.

Structure of a Diversion Header:

Diversion: “sip:redirected_number@redirecting_server”; “reason=unconditional”; “counter=1"; “screened=no”; “privacy=off”

SIP Diversion Header Breakdown:

“sip:redirected_number@redirecting_server”: This part of the header specifies the redirected number and the server that performed the redirection. For example, if a call is redirected to a different number by a redirecting server, this portion would indicate the new number and the server’s address.

“reason=unconditional”: This parameter indicates the reason for the redirection. In this example, “unconditional” suggests that the call was redirected without any specific conditions or criteria.

“counter=1": The counter parameter denotes the total number of diversions that have occurred. In this case, it indicates that this is the first diversion that has taken place.

screened=no”: The screened parameter indicates whether the diversion number is user-provided (“no”) or network-provided (“yes”). In this instance, “no” suggests that the user provided the redirected number.

privacy=off”: The privacy parameter showcases how privacy has been applied to the diversion information. In this example, “off” indicates that no privacy measures have been applied.

Benefits of Using the SIP Diversion Header:

  • Improved Call Routing and Billing Accuracy: By including the original number in the SIP Diversion header, calls can be accurately routed to the correct destination, ensuring billing is based on the original number.
  • Enhanced Caller Experience: The SIP Diversion header informs the caller about the reason and source of redirection, allowing them to accept or reject the call. This transparency improves the caller’s experience and satisfaction.
  • Enable Advanced Features and Services: The SIP Diversion header enables the implementation of features such as call recording, call screening, call queuing, call back, and call analytics, enhancing the functionality of SIP Trunking.

Challenges of Using the SIP Diversion Header:

  • Compatibility and Interoperability: Not all SIP devices and networks support the SIP Diversion header or use the same format and syntax, leading to potential errors or security breaches.
  • Privacy and Security Concerns: The SIP Diversion header may reveal sensitive information about the caller, callee, and redirecting party. Encryption, authentication, and authorization mechanisms are necessary to protect this information.
  • Complexity and Overhead: The SIP Diversion header adds complexity and overhead to the SIP Trunking system, impacting performance, efficiency, and reliability. It requires additional resources and maintenance.

Using the SIP Diversion Header Effectively:

When crafting your SIP Diversion header, it’s essential to follow established standards like RFC 5806, RFC 3326 and RFC 3261. Make sure to include the right parameters and values such as reason, privacy, screen, counter, limit, and history. Additionally, testing and troubleshooting the SIP Trunk is essential to ensure the SIP Diversion header is working properly.

Conclusion:

SIP Diversion header plays a vital role in call redirection in SIP Trunking. While it offers benefits such as improved call routing, enhanced caller experience, and advanced features, it also presents challenges related to compatibility, privacy, and complexity. By following standards, using appropriate parameters, and conducting thorough testing, businesses can effectively leverage the SIP Diversion header to optimize their SIP Trunking experience.

--

--