@convirza/dialer-sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1841 -0
- package/dist/api/CallHistoryAPI.d.ts +16 -0
- package/dist/api/DialerAPI.d.ts +52 -0
- package/dist/api/PhoneNumbersAPI.d.ts +21 -0
- package/dist/constants/api-config.d.ts +12 -0
- package/dist/constants/countries.d.ts +7 -0
- package/dist/constants/index.d.ts +30 -0
- package/dist/constants/sip-config.d.ts +14 -0
- package/dist/core/ConvirzaDialer.d.ts +40 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.esm.js +1 -0
- package/dist/index.umd.js +1 -0
- package/dist/init.d.ts +4 -0
- package/dist/media/AudioDeviceManager.d.ts +34 -0
- package/dist/media/CallQualityMonitor.d.ts +41 -0
- package/dist/services/CallHistoryService.d.ts +41 -0
- package/dist/sip/SipAdapter.d.ts +99 -0
- package/dist/storage/CallHistoryStore.d.ts +16 -0
- package/dist/types/call-history.d.ts +29 -0
- package/dist/types/index.d.ts +55 -0
- package/dist/types/phone-numbers.d.ts +22 -0
- package/dist/ui/ConvirzaDialerElement.d.ts +250 -0
- package/dist/ui/ConvirzaDialerElement.styles.d.ts +2 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/validators.d.ts +4 -0
- package/package.json +70 -0
package/dist/init.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface AudioDevice {
|
|
2
|
+
deviceId: string;
|
|
3
|
+
label: string;
|
|
4
|
+
kind: 'audioinput' | 'audiooutput';
|
|
5
|
+
}
|
|
6
|
+
export interface DevicePreferences {
|
|
7
|
+
microphoneId: string | null;
|
|
8
|
+
speakerId: string | null;
|
|
9
|
+
}
|
|
10
|
+
export interface AudioDeviceManagerOptions {
|
|
11
|
+
onDevicesChanged?: (devices: AudioDevice[]) => void;
|
|
12
|
+
onMicrophoneChanged?: (deviceId: string) => void;
|
|
13
|
+
onSpeakerChanged?: (deviceId: string) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare class AudioDeviceManager {
|
|
16
|
+
private static readonly STORAGE_KEY;
|
|
17
|
+
private devices;
|
|
18
|
+
private onDevicesChangedCb;
|
|
19
|
+
private onMicrophoneChangedCb;
|
|
20
|
+
private onSpeakerChangedCb;
|
|
21
|
+
private deviceChangeHandler;
|
|
22
|
+
constructor(options?: AudioDeviceManagerOptions);
|
|
23
|
+
destroy(): void;
|
|
24
|
+
private handleDeviceChange;
|
|
25
|
+
enumerateDevices(): Promise<AudioDevice[]>;
|
|
26
|
+
refreshDevices(): Promise<AudioDevice[]>;
|
|
27
|
+
getMicrophones(): AudioDevice[];
|
|
28
|
+
getSpeakers(): AudioDevice[];
|
|
29
|
+
setOnDevicesChanged(callback: (devices: AudioDevice[]) => void): void;
|
|
30
|
+
savePreferences(prefs: DevicePreferences): void;
|
|
31
|
+
loadPreferences(): DevicePreferences;
|
|
32
|
+
applyAudioOutputDevice(audioElement: HTMLAudioElement, deviceId: string): Promise<void>;
|
|
33
|
+
getAudioConstraints(microphoneId: string | null): Promise<MediaStreamConstraints>;
|
|
34
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface CallQualityMetrics {
|
|
2
|
+
bitrate: number;
|
|
3
|
+
packetLoss: number;
|
|
4
|
+
jitter: number;
|
|
5
|
+
latency: number;
|
|
6
|
+
audioLevel: number;
|
|
7
|
+
quality: 'excellent' | 'good' | 'fair' | 'poor';
|
|
8
|
+
}
|
|
9
|
+
export interface CallQualityThresholds {
|
|
10
|
+
excellent: {
|
|
11
|
+
packetLoss: number;
|
|
12
|
+
jitter: number;
|
|
13
|
+
latency: number;
|
|
14
|
+
};
|
|
15
|
+
good: {
|
|
16
|
+
packetLoss: number;
|
|
17
|
+
jitter: number;
|
|
18
|
+
latency: number;
|
|
19
|
+
};
|
|
20
|
+
fair: {
|
|
21
|
+
packetLoss: number;
|
|
22
|
+
jitter: number;
|
|
23
|
+
latency: number;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export declare class CallQualityMonitor {
|
|
27
|
+
private peerConnection;
|
|
28
|
+
private intervalId;
|
|
29
|
+
private onQualityChange;
|
|
30
|
+
private lastMetrics;
|
|
31
|
+
private thresholds;
|
|
32
|
+
private previousBytesReceived;
|
|
33
|
+
private previousTimestamp;
|
|
34
|
+
constructor(thresholds?: CallQualityThresholds);
|
|
35
|
+
start(peerConnection: RTCPeerConnection, interval?: number): void;
|
|
36
|
+
stop(): void;
|
|
37
|
+
setOnQualityChange(callback: (metrics: CallQualityMetrics) => void): void;
|
|
38
|
+
getLastMetrics(): CallQualityMetrics | null;
|
|
39
|
+
private collectMetrics;
|
|
40
|
+
private calculateQuality;
|
|
41
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { CallRecord, CallDirection, CallDisposition } from '../types/call-history.js';
|
|
2
|
+
/**
|
|
3
|
+
* Service layer orchestrating IndexedDB cache and backend API
|
|
4
|
+
* Handles sync, fallback, and persistence strategy
|
|
5
|
+
*/
|
|
6
|
+
export declare class CallHistoryService {
|
|
7
|
+
private store;
|
|
8
|
+
private api;
|
|
9
|
+
private userId;
|
|
10
|
+
private sipDomain;
|
|
11
|
+
private initialized;
|
|
12
|
+
constructor();
|
|
13
|
+
init(userId: string, sipDomain: string, apiUrl?: string, authToken?: string): Promise<void>;
|
|
14
|
+
setAuthToken(token: string): void;
|
|
15
|
+
private ensureInitialized;
|
|
16
|
+
addCall(params: {
|
|
17
|
+
callId: string;
|
|
18
|
+
phoneNumber: string;
|
|
19
|
+
callerIdNumber: string;
|
|
20
|
+
callerIdName?: string;
|
|
21
|
+
direction: CallDirection;
|
|
22
|
+
disposition: CallDisposition;
|
|
23
|
+
startedAt: number;
|
|
24
|
+
endedAt?: number;
|
|
25
|
+
durationSeconds: number;
|
|
26
|
+
recordingUrl?: string;
|
|
27
|
+
}): Promise<void>;
|
|
28
|
+
getHistory(limit?: number): Promise<CallRecord[]>;
|
|
29
|
+
sync(): Promise<void>;
|
|
30
|
+
updateCall(callId: string, updates: {
|
|
31
|
+
endedAt?: number;
|
|
32
|
+
durationSeconds?: number;
|
|
33
|
+
}): Promise<void>;
|
|
34
|
+
clear(): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Force clear IndexedDB cache and re-sync from backend
|
|
37
|
+
* Useful for debugging stale data issues
|
|
38
|
+
*/
|
|
39
|
+
clearCache(): Promise<void>;
|
|
40
|
+
destroy(): void;
|
|
41
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { AudioDevice } from '../media/AudioDeviceManager.js';
|
|
2
|
+
import { CallQualityMetrics } from '../media/CallQualityMonitor.js';
|
|
3
|
+
export interface SipConfig {
|
|
4
|
+
sipUsername: string;
|
|
5
|
+
sipPassword: string;
|
|
6
|
+
sipDomain: string;
|
|
7
|
+
wsServers: string[];
|
|
8
|
+
displayName?: string;
|
|
9
|
+
iceServers?: RTCIceServer[];
|
|
10
|
+
microphoneId?: string;
|
|
11
|
+
speakerId?: string;
|
|
12
|
+
apiUrl?: string;
|
|
13
|
+
authToken?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface SipCallbacks {
|
|
16
|
+
onRegistered?: () => void;
|
|
17
|
+
onUnregistered?: () => void;
|
|
18
|
+
onRegistrationFailed?: (cause?: string) => void;
|
|
19
|
+
onTransportError?: (error: Error) => void;
|
|
20
|
+
onConnecting?: () => void;
|
|
21
|
+
onCallRinging?: () => void;
|
|
22
|
+
onCallAnswered?: () => void;
|
|
23
|
+
onCallEnded?: (reason?: string) => void;
|
|
24
|
+
onCallFailed?: (error: Error) => void;
|
|
25
|
+
onIncomingCall?: (phoneNumber: string, callerName?: string) => void;
|
|
26
|
+
onRemoteHold?: (isOnHold: boolean) => void;
|
|
27
|
+
onQualityChange?: (metrics: CallQualityMetrics) => void;
|
|
28
|
+
onRecordingStateChange?: (recording: boolean) => void;
|
|
29
|
+
onTransferSucceeded?: () => void;
|
|
30
|
+
onTransferFailed?: (reason: string) => void;
|
|
31
|
+
onDevicesChanged?: (devices: AudioDevice[]) => void;
|
|
32
|
+
onError?: (error: Error) => void;
|
|
33
|
+
}
|
|
34
|
+
export declare class SipAdapter {
|
|
35
|
+
private userAgent;
|
|
36
|
+
private currentSession;
|
|
37
|
+
private registerer;
|
|
38
|
+
private config;
|
|
39
|
+
private callbacks;
|
|
40
|
+
private audioElement;
|
|
41
|
+
private isMuted;
|
|
42
|
+
private audioDeviceManager;
|
|
43
|
+
private qualityMonitor;
|
|
44
|
+
private localHangup;
|
|
45
|
+
private currentCallUuid;
|
|
46
|
+
private currentCallIsChannelUuid;
|
|
47
|
+
private currentCallSipCallId;
|
|
48
|
+
private reconnectAttempts;
|
|
49
|
+
private reconnectTimer;
|
|
50
|
+
private iceDisconnectedTimer;
|
|
51
|
+
constructor(config: SipConfig, callbacks?: SipCallbacks);
|
|
52
|
+
private setupQualityMonitor;
|
|
53
|
+
private getLocalAudioConstraints;
|
|
54
|
+
private setupAudioElement;
|
|
55
|
+
connect(): Promise<void>;
|
|
56
|
+
disconnect(): Promise<void>;
|
|
57
|
+
call(phoneNumber: string, options?: {
|
|
58
|
+
callerId?: string;
|
|
59
|
+
callerIdName?: string;
|
|
60
|
+
}): Promise<void>;
|
|
61
|
+
endCall(): Promise<void>;
|
|
62
|
+
mute(enable?: boolean): boolean;
|
|
63
|
+
hold(enable?: boolean): Promise<void>;
|
|
64
|
+
sendDTMF(digit: string): void;
|
|
65
|
+
startRecording(): void;
|
|
66
|
+
stopRecording(): void;
|
|
67
|
+
park(parkExtension: string): Promise<void>;
|
|
68
|
+
private handleIncomingCall;
|
|
69
|
+
answerCall(): Promise<void>;
|
|
70
|
+
rejectCall(): Promise<void>;
|
|
71
|
+
private setupRemoteMedia;
|
|
72
|
+
private stopLocalTracks;
|
|
73
|
+
private cleanupSession;
|
|
74
|
+
private startQualityMonitoring;
|
|
75
|
+
get isConnected(): boolean;
|
|
76
|
+
get hasActiveCall(): boolean;
|
|
77
|
+
setMicrophone(deviceId: string): Promise<void>;
|
|
78
|
+
setSpeaker(deviceId: string): Promise<void>;
|
|
79
|
+
getAudioDevices(): Promise<{
|
|
80
|
+
microphones: Array<{
|
|
81
|
+
deviceId: string;
|
|
82
|
+
label: string;
|
|
83
|
+
}>;
|
|
84
|
+
speakers: Array<{
|
|
85
|
+
deviceId: string;
|
|
86
|
+
label: string;
|
|
87
|
+
}>;
|
|
88
|
+
}>;
|
|
89
|
+
getCallUuid(): string | null;
|
|
90
|
+
getCurrentDevices(): {
|
|
91
|
+
microphoneId: string | null;
|
|
92
|
+
speakerId: string | null;
|
|
93
|
+
};
|
|
94
|
+
getCallQuality(): CallQualityMetrics | null;
|
|
95
|
+
blindTransfer(target: string): Promise<void>;
|
|
96
|
+
private monitorPeerConnection;
|
|
97
|
+
private scheduleReconnect;
|
|
98
|
+
reconnect(): void;
|
|
99
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CallRecord } from '../types/call-history.js';
|
|
2
|
+
/**
|
|
3
|
+
* IndexedDB wrapper for call history
|
|
4
|
+
* Provides local cache with structured queries
|
|
5
|
+
*/
|
|
6
|
+
export declare class CallHistoryStore {
|
|
7
|
+
private db;
|
|
8
|
+
init(): Promise<void>;
|
|
9
|
+
add(call: Omit<CallRecord, 'id'>): Promise<number>;
|
|
10
|
+
getAll(userId: string, sipDomain: string, limit?: number): Promise<CallRecord[]>;
|
|
11
|
+
getByCallId(callId: string): Promise<CallRecord | null>;
|
|
12
|
+
update(id: number, updates: Partial<CallRecord>): Promise<void>;
|
|
13
|
+
replaceAll(userId: string, sipDomain: string, calls: CallRecord[]): Promise<void>;
|
|
14
|
+
clear(): Promise<void>;
|
|
15
|
+
close(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type CallDirection = 'inbound' | 'outbound';
|
|
2
|
+
export type CallDisposition = 'answered' | 'missed' | 'rejected' | 'failed';
|
|
3
|
+
export interface CallRecord {
|
|
4
|
+
id?: number;
|
|
5
|
+
callId: string;
|
|
6
|
+
userId: string;
|
|
7
|
+
sipDomain: string;
|
|
8
|
+
callerIdNumber: string;
|
|
9
|
+
callerIdName?: string;
|
|
10
|
+
phoneNumber: string;
|
|
11
|
+
direction: CallDirection;
|
|
12
|
+
disposition: CallDisposition;
|
|
13
|
+
startedAt: number;
|
|
14
|
+
endedAt?: number;
|
|
15
|
+
durationSeconds: number;
|
|
16
|
+
recordingUrl?: string;
|
|
17
|
+
createdAt: number;
|
|
18
|
+
}
|
|
19
|
+
export interface CallHistoryResponse {
|
|
20
|
+
calls: CallRecord[];
|
|
21
|
+
total: number;
|
|
22
|
+
hasMore: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface CallHistoryQueryParams {
|
|
25
|
+
userId: string;
|
|
26
|
+
sipDomain: string;
|
|
27
|
+
limit?: number;
|
|
28
|
+
offset?: number;
|
|
29
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export type WidgetPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
2
|
+
export type CallStatus = 'idle' | 'dialing' | 'ringing' | 'connected' | 'ended' | 'error';
|
|
3
|
+
export type WidgetState = 'collapsed' | 'expanded';
|
|
4
|
+
export type ThemeMode = 'light' | 'dark';
|
|
5
|
+
export interface DialerConfig {
|
|
6
|
+
apiUrl: string;
|
|
7
|
+
sipDomain: string;
|
|
8
|
+
sipUsername: string;
|
|
9
|
+
sipPassword: string;
|
|
10
|
+
wsServers: string[];
|
|
11
|
+
authToken?: string;
|
|
12
|
+
iceServers?: RTCIceServer[];
|
|
13
|
+
position?: WidgetPosition;
|
|
14
|
+
zIndex?: number;
|
|
15
|
+
defaultState?: WidgetState;
|
|
16
|
+
primaryColor?: string;
|
|
17
|
+
accentColor?: string;
|
|
18
|
+
theme?: ThemeMode;
|
|
19
|
+
brandName?: string;
|
|
20
|
+
brandLogo?: string;
|
|
21
|
+
apiBaseUrl?: string;
|
|
22
|
+
domainId?: number;
|
|
23
|
+
firstName?: string;
|
|
24
|
+
lastName?: string;
|
|
25
|
+
email?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface CallOptions {
|
|
28
|
+
displayName?: string;
|
|
29
|
+
callerId?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface CallSession {
|
|
32
|
+
phoneNumber: string;
|
|
33
|
+
status: CallStatus;
|
|
34
|
+
duration: number;
|
|
35
|
+
onAnswered: (callback: () => void) => void;
|
|
36
|
+
onEnded: (callback: (duration: number) => void) => void;
|
|
37
|
+
end: () => void;
|
|
38
|
+
}
|
|
39
|
+
export interface CallMetadata {
|
|
40
|
+
phoneNumber: string;
|
|
41
|
+
startTime: number;
|
|
42
|
+
endTime?: number;
|
|
43
|
+
duration: number;
|
|
44
|
+
status: CallStatus;
|
|
45
|
+
errorMessage?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface DialerEvents {
|
|
48
|
+
onOpen?: () => void;
|
|
49
|
+
onClose?: () => void;
|
|
50
|
+
onCallStarted?: (phoneNumber: string) => void;
|
|
51
|
+
onCallEnded?: (phoneNumber: string, duration: number) => void;
|
|
52
|
+
onStateChange?: (oldState: CallStatus, newState: CallStatus, metadata?: CallMetadata) => void;
|
|
53
|
+
}
|
|
54
|
+
export type { CallRecord, CallDirection, CallDisposition, CallHistoryResponse, CallHistoryQueryParams, } from './call-history.js';
|
|
55
|
+
export type { PhoneNumberCapabilities, OrderedPhoneNumber, OrderedPhoneNumbersResponse } from './phone-numbers.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface PhoneNumberCapabilities {
|
|
2
|
+
voice?: boolean;
|
|
3
|
+
sms?: boolean;
|
|
4
|
+
mms?: boolean;
|
|
5
|
+
cnam?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface OrderedPhoneNumber {
|
|
8
|
+
number_id: number;
|
|
9
|
+
number: string;
|
|
10
|
+
number_str: string;
|
|
11
|
+
number_type: string;
|
|
12
|
+
city?: string;
|
|
13
|
+
state?: string;
|
|
14
|
+
number_status: string;
|
|
15
|
+
assigned_user_name?: string;
|
|
16
|
+
capabilities?: PhoneNumberCapabilities;
|
|
17
|
+
created_at?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface OrderedPhoneNumbersResponse {
|
|
20
|
+
items: OrderedPhoneNumber[];
|
|
21
|
+
total: number;
|
|
22
|
+
}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { CallOptions, CallSession } from '../types/index.js';
|
|
2
|
+
export declare class ConvirzaDialerElement extends HTMLElement {
|
|
3
|
+
private shadow;
|
|
4
|
+
private config;
|
|
5
|
+
private callStatus;
|
|
6
|
+
private currentCall;
|
|
7
|
+
private durationInterval;
|
|
8
|
+
private isMuted;
|
|
9
|
+
private isOnHold;
|
|
10
|
+
private isRecording;
|
|
11
|
+
private phoneInputValue;
|
|
12
|
+
private selectedCountry;
|
|
13
|
+
private showCountryDropdown;
|
|
14
|
+
private longPressTimer;
|
|
15
|
+
private longPressTriggered;
|
|
16
|
+
private boundHandlers;
|
|
17
|
+
private isInitialized;
|
|
18
|
+
private currentView;
|
|
19
|
+
private currentHistoryTab;
|
|
20
|
+
private callHistory;
|
|
21
|
+
private selectedHistoryItem;
|
|
22
|
+
private readonly STORAGE_KEY;
|
|
23
|
+
private sipAdapter;
|
|
24
|
+
private incomingCallNumber;
|
|
25
|
+
private incomingCallName;
|
|
26
|
+
private showInCallKeypad;
|
|
27
|
+
private dialedDigits;
|
|
28
|
+
private audioDevices;
|
|
29
|
+
private callQuality;
|
|
30
|
+
private isDragging;
|
|
31
|
+
private dragOffset;
|
|
32
|
+
private fabPosition;
|
|
33
|
+
private parkAccounts;
|
|
34
|
+
private parkApiUrl;
|
|
35
|
+
private parkPollInterval;
|
|
36
|
+
private parkPollTimer;
|
|
37
|
+
private authToken;
|
|
38
|
+
private showRetrieveModal;
|
|
39
|
+
private retrieveModalData;
|
|
40
|
+
private isParking;
|
|
41
|
+
private parkingSlot;
|
|
42
|
+
private parkValidationTimer;
|
|
43
|
+
private parkValidationAttempts;
|
|
44
|
+
private errorDismissTimer;
|
|
45
|
+
private dragStartTime;
|
|
46
|
+
private hasMoved;
|
|
47
|
+
private ringbackTone;
|
|
48
|
+
private callConnectedTime;
|
|
49
|
+
private dialTone;
|
|
50
|
+
private renderScheduled;
|
|
51
|
+
private sharedAudioContext;
|
|
52
|
+
private ringbackBlobUrl;
|
|
53
|
+
private dialToneBlobUrl;
|
|
54
|
+
private dialToneBuffer;
|
|
55
|
+
private callHistoryService;
|
|
56
|
+
private currentCallId;
|
|
57
|
+
private callHistorySaved;
|
|
58
|
+
private showTransferView;
|
|
59
|
+
private transferTarget;
|
|
60
|
+
private isTransferring;
|
|
61
|
+
private domainExtensions;
|
|
62
|
+
private _activeNotification;
|
|
63
|
+
private _onOnline;
|
|
64
|
+
private _onOffline;
|
|
65
|
+
private phoneNumbersAPI;
|
|
66
|
+
private orderedPhoneNumbers;
|
|
67
|
+
private selectedPhoneNumber;
|
|
68
|
+
private showPhoneNumberDropdown;
|
|
69
|
+
private loadingPhoneNumbers;
|
|
70
|
+
private phoneNumbersError;
|
|
71
|
+
static get observedAttributes(): string[];
|
|
72
|
+
constructor();
|
|
73
|
+
private setupAudioTones;
|
|
74
|
+
private bufferToWave;
|
|
75
|
+
connectedCallback(): Promise<void>;
|
|
76
|
+
private initializePosition;
|
|
77
|
+
disconnectedCallback(): void;
|
|
78
|
+
private cleanup;
|
|
79
|
+
attributeChangedCallback(_name: string, oldValue: string, newValue: string): void;
|
|
80
|
+
private updateConfig;
|
|
81
|
+
private isDialerEnabled;
|
|
82
|
+
private autoConfigureFromAccessToken;
|
|
83
|
+
private autoConfigureFromRefreshToken;
|
|
84
|
+
private initializeSip;
|
|
85
|
+
private initializeCallHistory;
|
|
86
|
+
private loadCallHistory;
|
|
87
|
+
private mapDirectionToType;
|
|
88
|
+
private mapDispositionToString;
|
|
89
|
+
private generateCallId;
|
|
90
|
+
private isValidTransition;
|
|
91
|
+
private transitionState;
|
|
92
|
+
private needsUIRebuild;
|
|
93
|
+
private getCallMetadata;
|
|
94
|
+
private persistCallState;
|
|
95
|
+
private restoreCallState;
|
|
96
|
+
placeCall(phoneNumber: string, options?: CallOptions): CallSession;
|
|
97
|
+
open(): void;
|
|
98
|
+
close(): void;
|
|
99
|
+
toggle(): void;
|
|
100
|
+
setTheme(options: {
|
|
101
|
+
theme?: 'dark' | 'light';
|
|
102
|
+
primaryColor?: string;
|
|
103
|
+
accentColor?: string;
|
|
104
|
+
brandName?: string;
|
|
105
|
+
brandLogo?: string;
|
|
106
|
+
}): void;
|
|
107
|
+
/**
|
|
108
|
+
* Clear call history cache and reload from backend
|
|
109
|
+
*/
|
|
110
|
+
clearCallHistoryCache(): Promise<void>;
|
|
111
|
+
mute(enable?: boolean): boolean;
|
|
112
|
+
hold(enable?: boolean): boolean;
|
|
113
|
+
startRecording(): void;
|
|
114
|
+
stopRecording(): void;
|
|
115
|
+
private toggleRecording;
|
|
116
|
+
private parkCall;
|
|
117
|
+
private validateParkSuccess;
|
|
118
|
+
private confirmRetrieveParkedCall;
|
|
119
|
+
private cancelRetrieve;
|
|
120
|
+
private confirmRetrieve;
|
|
121
|
+
private retrieveParkedCall;
|
|
122
|
+
private initiateCall;
|
|
123
|
+
private handleCallEnded;
|
|
124
|
+
private addToCallHistory;
|
|
125
|
+
private getFilteredHistory;
|
|
126
|
+
private switchView;
|
|
127
|
+
private updateMainView;
|
|
128
|
+
private updatePhoneInput;
|
|
129
|
+
private switchHistoryTab;
|
|
130
|
+
private updateHistoryView;
|
|
131
|
+
private startDurationTimer;
|
|
132
|
+
private handleIncomingCall;
|
|
133
|
+
answerIncomingCall(): void;
|
|
134
|
+
rejectIncomingCall(): void;
|
|
135
|
+
toggleInCallKeypad(): void;
|
|
136
|
+
notifyCallAnswered(): void;
|
|
137
|
+
notifyCallRinging(): void;
|
|
138
|
+
private playRingbackTone;
|
|
139
|
+
private stopRingbackTone;
|
|
140
|
+
private playDialTone;
|
|
141
|
+
private playDTMFTone;
|
|
142
|
+
endCall(): void;
|
|
143
|
+
sendDTMF(digit: string): void;
|
|
144
|
+
private formatPhoneNumber;
|
|
145
|
+
private formatPhoneNumberDisplay;
|
|
146
|
+
/**
|
|
147
|
+
* Format phone input as user types (without country code - that's in the dropdown)
|
|
148
|
+
* Progressively formats: (825) 252-5065
|
|
149
|
+
*/
|
|
150
|
+
private formatPhoneInputDisplay;
|
|
151
|
+
private formatDuration;
|
|
152
|
+
private formatCallTime;
|
|
153
|
+
private render;
|
|
154
|
+
private needsFullRender;
|
|
155
|
+
private performRender;
|
|
156
|
+
private performSelectiveUpdate;
|
|
157
|
+
private updateExpandedContent;
|
|
158
|
+
private updateDialedDigitsDisplay;
|
|
159
|
+
private updateActiveCallUI;
|
|
160
|
+
private updateModalOverlays;
|
|
161
|
+
private updateButtonStates;
|
|
162
|
+
private toggleCountryDropdown;
|
|
163
|
+
private selectCountry;
|
|
164
|
+
private renderCollapsed;
|
|
165
|
+
private renderExpanded;
|
|
166
|
+
private renderCountryDropdown;
|
|
167
|
+
private renderCountryBackdrop;
|
|
168
|
+
private renderDialpad;
|
|
169
|
+
private escapeHtml;
|
|
170
|
+
private renderTransferPanel;
|
|
171
|
+
private renderActiveCall;
|
|
172
|
+
private renderHistory;
|
|
173
|
+
private renderDialerDisabled;
|
|
174
|
+
private renderEmptyHistory;
|
|
175
|
+
private renderHistoryItem;
|
|
176
|
+
private renderCallBackButton;
|
|
177
|
+
private renderBottomNav;
|
|
178
|
+
private renderFooter;
|
|
179
|
+
private renderIncomingCallModal;
|
|
180
|
+
private renderRetrieveModal;
|
|
181
|
+
private renderAccount;
|
|
182
|
+
private renderPark;
|
|
183
|
+
private renderEmptyPark;
|
|
184
|
+
private renderParkedCall;
|
|
185
|
+
private renderParkItem;
|
|
186
|
+
private formatParkedDuration;
|
|
187
|
+
private setupEventListeners;
|
|
188
|
+
private setupDragHandlers;
|
|
189
|
+
private attachDragHandlers;
|
|
190
|
+
private adjustPositionForPanel;
|
|
191
|
+
private refreshAudioDevicesQuietly;
|
|
192
|
+
private refreshAudioDevices;
|
|
193
|
+
private updateAccountDeviceSelectors;
|
|
194
|
+
private setMicrophone;
|
|
195
|
+
private setSpeaker;
|
|
196
|
+
/**
|
|
197
|
+
* Start polling park slots API (REST fallback - not used in SUBSCRIBE test)
|
|
198
|
+
*/
|
|
199
|
+
private startParkSlotPolling;
|
|
200
|
+
/**
|
|
201
|
+
* Stop polling park slots API
|
|
202
|
+
*/
|
|
203
|
+
private stopParkSlotPolling;
|
|
204
|
+
/**
|
|
205
|
+
* Update history item selection state without full re-render
|
|
206
|
+
*/
|
|
207
|
+
private updateHistorySelection;
|
|
208
|
+
/**
|
|
209
|
+
* Fetch park slots from backend API
|
|
210
|
+
*/
|
|
211
|
+
private fetchParkSlots;
|
|
212
|
+
private fetchDomainExtensions;
|
|
213
|
+
private fetchOrderedPhoneNumbers;
|
|
214
|
+
/**
|
|
215
|
+
* Toggle dropdown visibility (open/close)
|
|
216
|
+
*/
|
|
217
|
+
/**
|
|
218
|
+
* Render dropdown content (items only, not wrapper)
|
|
219
|
+
*/
|
|
220
|
+
private renderPhoneNumberDropdownItems;
|
|
221
|
+
/**
|
|
222
|
+
* Update dropdown DOM based on showPhoneNumberDropdown state
|
|
223
|
+
*/
|
|
224
|
+
private updatePhoneNumberDropdownDOM;
|
|
225
|
+
private togglePhoneNumberDropdown;
|
|
226
|
+
/**
|
|
227
|
+
* Open the dropdown (show phone number list)
|
|
228
|
+
*/
|
|
229
|
+
private openPhoneNumberDropdown;
|
|
230
|
+
/**
|
|
231
|
+
* Close the dropdown (hide phone number list)
|
|
232
|
+
*/
|
|
233
|
+
private closePhoneNumberDropdown;
|
|
234
|
+
/**
|
|
235
|
+
* Select a phone number from the dropdown
|
|
236
|
+
*/
|
|
237
|
+
private selectPhoneNumber;
|
|
238
|
+
/**
|
|
239
|
+
* Stop loading spinner and update UI
|
|
240
|
+
*/
|
|
241
|
+
private stopPhoneNumbersLoading;
|
|
242
|
+
/**
|
|
243
|
+
* Start loading spinner
|
|
244
|
+
*/
|
|
245
|
+
private startPhoneNumbersLoading;
|
|
246
|
+
private executeTransfer;
|
|
247
|
+
private requestNotificationPermission;
|
|
248
|
+
private showIncomingCallNotification;
|
|
249
|
+
private dismissIncomingCallNotification;
|
|
250
|
+
}
|