mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage
synced 2026-04-14 20:12:25 +00:00
fix: build errors — JsSIP types, LeadActivity fields, telephony config
- 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) <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import JsSIP from 'jssip';
|
import JsSIP from 'jssip';
|
||||||
|
type RTCSession = any;
|
||||||
|
|
||||||
// Lightweight SIP client for supervisor barge sessions.
|
// Lightweight SIP client for supervisor barge sessions.
|
||||||
// Separate from the agent's sip-client.ts — different lifecycle.
|
// Separate from the agent's sip-client.ts — different lifecycle.
|
||||||
@@ -27,13 +28,11 @@ type SupervisorSipConfig = {
|
|||||||
|
|
||||||
class SupervisorSipClient {
|
class SupervisorSipClient {
|
||||||
private ua: JsSIP.UA | null = null;
|
private ua: JsSIP.UA | null = null;
|
||||||
private session: JsSIP.RTCSession | null = null;
|
private session: RTCSession | null = null;
|
||||||
private config: SupervisorSipConfig | null = null;
|
|
||||||
private listeners = new Map<string, Set<EventCallback>>();
|
private listeners = new Map<string, Set<EventCallback>>();
|
||||||
private audioElement: HTMLAudioElement | null = null;
|
private audioElement: HTMLAudioElement | null = null;
|
||||||
|
|
||||||
init(config: SupervisorSipConfig): void {
|
init(config: SupervisorSipConfig): void {
|
||||||
this.config = config;
|
|
||||||
this.cleanup();
|
this.cleanup();
|
||||||
|
|
||||||
// Hidden audio element for remote call audio
|
// Hidden audio element for remote call audio
|
||||||
@@ -67,7 +66,7 @@ class SupervisorSipClient {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.ua.on('newRTCSession', (data: any) => {
|
this.ua.on('newRTCSession', (data: any) => {
|
||||||
const rtcSession = data.session as JsSIP.RTCSession;
|
const rtcSession = data.session as RTCSession;
|
||||||
if (rtcSession.direction !== 'incoming') return;
|
if (rtcSession.direction !== 'incoming') return;
|
||||||
|
|
||||||
console.log('[SupervisorSIP] Incoming call — auto-answering');
|
console.log('[SupervisorSIP] Incoming call — auto-answering');
|
||||||
|
|||||||
@@ -559,7 +559,7 @@ export const Patient360Page = () => {
|
|||||||
`mutation($data: LeadActivityCreateInput!) { createLeadActivity(data: $data) { id } }`,
|
`mutation($data: LeadActivityCreateInput!) { createLeadActivity(data: $data) { id } }`,
|
||||||
{ data: { name: `Note — ${fullName}`, activityType: 'NOTE_ADDED', summary: noteText.trim(), occurredAt: new Date().toISOString(), leadId: leadInfo.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('');
|
setNoteText('');
|
||||||
notify.success('Note Added');
|
notify.success('Note Added');
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ export const TelephonySettingsPage = () => {
|
|||||||
did: data.ozonetel?.did ?? '',
|
did: data.ozonetel?.did ?? '',
|
||||||
sipId: data.ozonetel?.sipId ?? '',
|
sipId: data.ozonetel?.sipId ?? '',
|
||||||
campaignName: data.ozonetel?.campaignName ?? '',
|
campaignName: data.ozonetel?.campaignName ?? '',
|
||||||
|
adminUsername: data.ozonetel?.adminUsername ?? '',
|
||||||
|
adminPassword: data.ozonetel?.adminPassword ?? '',
|
||||||
},
|
},
|
||||||
sip: {
|
sip: {
|
||||||
domain: data.sip?.domain ?? 'blr-pub-rtc4.ozonetel.com',
|
domain: data.sip?.domain ?? 'blr-pub-rtc4.ozonetel.com',
|
||||||
|
|||||||
Reference in New Issue
Block a user