Search code examples
c#sipvoip

How to hold SIPSorcery VOIP call in C#?


I am using SIPSorcery dll to dial and receive call using C# WPF application. Call and receive are working without any issues. I would like to implement hold feature in my call. I have checked all the methods in SIPSorcery dll I am not sure if there is feature to hold a call in SIP sorcery. Is it possible to hold the call in SIPSorcery? If possible, how can i do that in my windows application?


Solution

  • The typical way to use SIP to put a call on hold is to send a re-INVITE request and add an a=recvonly attribute to the SDP offer. For an example of the SIP flow see Music On Hold example RFC https://www.rfc-editor.org/rfc/rfc7088#section-2.8.3.

    One example in the sipsorcery code where a SIP re-INVITE is used is https://github.com/sipsorcery/sipsorcery/blob/master/sipsorcery-core/SIPSorcery.Servers.Cores/SIPApplicationServer/SIPDialogueManager.cs line 676.