From 636badfa315b37829b9aba44a9e4b31ebca0c504 Mon Sep 17 00:00:00 2001 From: saridsa2 Date: Sun, 12 Apr 2026 16:32:02 +0530 Subject: [PATCH] =?UTF-8?q?fix:=20build=20errors=20=E2=80=94=20JsSIP=20typ?= =?UTF-8?q?es,=20LeadActivity=20fields,=20telephony=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - supervisor-sip-client: use RTCSession as any (JsSIP types mismatch) - patient-360: add missing LeadActivity fields (createdAt, channel, etc) - telephony-settings: add adminUsername/adminPassword to loadConfig Co-Authored-By: Claude Opus 4.6 (1M context) --- src/lib/supervisor-sip-client.ts | 7 +++---- src/pages/patient-360.tsx | 2 +- src/pages/telephony-settings.tsx | 2 ++ 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lib/supervisor-sip-client.ts b/src/lib/supervisor-sip-client.ts index dbcdde8..d5f0959 100644 --- a/src/lib/supervisor-sip-client.ts +++ b/src/lib/supervisor-sip-client.ts @@ -1,4 +1,5 @@ import JsSIP from 'jssip'; +type RTCSession = any; // Lightweight SIP client for supervisor barge sessions. // Separate from the agent's sip-client.ts — different lifecycle. @@ -27,13 +28,11 @@ type SupervisorSipConfig = { class SupervisorSipClient { private ua: JsSIP.UA | null = null; - private session: JsSIP.RTCSession | null = null; - private config: SupervisorSipConfig | null = null; + private session: RTCSession | null = null; private listeners = new Map>(); private audioElement: HTMLAudioElement | null = null; init(config: SupervisorSipConfig): void { - this.config = config; this.cleanup(); // Hidden audio element for remote call audio @@ -67,7 +66,7 @@ class SupervisorSipClient { }); this.ua.on('newRTCSession', (data: any) => { - const rtcSession = data.session as JsSIP.RTCSession; + const rtcSession = data.session as RTCSession; if (rtcSession.direction !== 'incoming') return; console.log('[SupervisorSIP] Incoming call — auto-answering'); diff --git a/src/pages/patient-360.tsx b/src/pages/patient-360.tsx index 251737c..2e1a978 100644 --- a/src/pages/patient-360.tsx +++ b/src/pages/patient-360.tsx @@ -559,7 +559,7 @@ export const Patient360Page = () => { `mutation($data: LeadActivityCreateInput!) { createLeadActivity(data: $data) { id } }`, { data: { name: `Note — ${fullName}`, activityType: 'NOTE_ADDED', summary: noteText.trim(), occurredAt: new Date().toISOString(), leadId: leadInfo.id } }, ); - setActivities(prev => [{ id: crypto.randomUUID(), activityType: 'NOTE_ADDED' as LeadActivityType, summary: noteText.trim(), occurredAt: new Date().toISOString(), performedBy: null, previousValue: null, newValue: noteText.trim(), leadId: leadInfo.id }, ...prev]); + setActivities(prev => [{ id: crypto.randomUUID(), createdAt: new Date().toISOString(), activityType: 'NOTE_ADDED' as LeadActivityType, summary: noteText.trim(), occurredAt: new Date().toISOString(), performedBy: null, previousValue: null, newValue: noteText.trim(), channel: null, durationSeconds: null, outcome: null, leadId: leadInfo.id }, ...prev]); setNoteText(''); notify.success('Note Added'); } catch { diff --git a/src/pages/telephony-settings.tsx b/src/pages/telephony-settings.tsx index 0f67bec..2a8d616 100644 --- a/src/pages/telephony-settings.tsx +++ b/src/pages/telephony-settings.tsx @@ -36,6 +36,8 @@ export const TelephonySettingsPage = () => { did: data.ozonetel?.did ?? '', sipId: data.ozonetel?.sipId ?? '', campaignName: data.ozonetel?.campaignName ?? '', + adminUsername: data.ozonetel?.adminUsername ?? '', + adminPassword: data.ozonetel?.adminPassword ?? '', }, sip: { domain: data.sip?.domain ?? 'blr-pub-rtc4.ozonetel.com',