sipsorcery-org / sipsorcery

A WebRTC, SIP and VoIP library for C# and .NET. Designed for real-time communications apps.
https://sipsorcery-org.github.io/sipsorcery
Other
1.47k stars 442 forks source link

Registration with SIPWebSocketChannel #999

Closed kovenko closed 9 months ago

kovenko commented 1 year ago

Hi! JsSip + Asterisk works. How to have Registration with SIPWebSocketChannel?

const int SipWebsocketListenPort = 4324; const string Username = "77_3"; const string Password = "12345"; const string Domain = "wss://77_3@domain.com:4324/ws"; const int Expiry = 120; SIPTransport _sipTransport;

_sipTransport = new SIPTransport(); _sipTransport.AddSIPChannel(new SIPWebSocketChannel(IPAddress.Any, SipWebsocketListenPort)); var regUserAgent = new SIPRegistrationUserAgent(_sipTransport, Username, Password, Domain, Expiry); regUserAgent.Start();

Could not resolve wss://77_3@domain.com/ws.

sipsorcery commented 9 months ago

When specifying SIP URIs you don't use the HTTP URI format and //. Your URI should be:

wss:77_3@domain.com:4324