fix: prevent StrictMode double-mount from killing SIP WebSocket connection

This commit is contained in:
2026-03-17 20:08:22 +05:30
parent b2cc3d7012
commit d54d54f5f3
3 changed files with 30 additions and 5 deletions

View File

@@ -15,15 +15,26 @@ export class SIPClient {
) {}
connect(): void {
// Enable JsSIP debug logging to diagnose connection issues
JsSIP.debug.enable('JsSIP:*');
const socket = new JsSIP.WebSocketInterface(this.config.wsServer);
// Extract SIP ID from URI for authorization_user
// URI format: sip:521814@blr-pub-rtc4.ozonetel.com
const sipId = this.config.uri.replace('sip:', '').split('@')[0];
const configuration: UAConfiguration = {
sockets: [socket],
uri: this.config.uri,
password: this.config.password,
authorization_user: sipId,
display_name: this.config.displayName,
register: true,
register_expires: 120,
session_timers: false,
connection_recovery_min_interval: 2,
connection_recovery_max_interval: 30,
};
this.ua = new JsSIP.UA(configuration);