@snugdesk/avaya-ipo-widget 0.2.2

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/index.d.ts ADDED
@@ -0,0 +1,794 @@
1
+ import * as i0 from '@angular/core';
2
+ import { NgZone, OnInit, OnDestroy, EventEmitter, ChangeDetectorRef, AfterViewInit, ElementRef, OnChanges, SimpleChanges } from '@angular/core';
3
+ import * as i14 from '@angular/forms';
4
+ import { FormGroup, FormBuilder } from '@angular/forms';
5
+ import * as rxjs from 'rxjs';
6
+ import { BehaviorSubject, Subject } from 'rxjs';
7
+ import { HttpClient } from '@angular/common/http';
8
+ import { SnugdeskAuthenticationService } from '@snugdesk/core';
9
+ import * as i19 from 'ngx-intl-tel-input';
10
+ import { CountryISO, SearchCountryField } from 'ngx-intl-tel-input';
11
+ import * as i13 from '@angular/common';
12
+ import * as i15 from '@angular/material/form-field';
13
+ import * as i16 from '@angular/material/input';
14
+ import * as i17 from '@angular/material/icon';
15
+ import * as i18 from '@angular/material/button';
16
+
17
+ interface RemoteMedia {
18
+ callId: string;
19
+ stream: MediaStream;
20
+ }
21
+ declare class AvayaIPOService {
22
+ zone: NgZone;
23
+ private http;
24
+ private cli;
25
+ remoteStream: RemoteMedia | null;
26
+ readonly remoteStream$: BehaviorSubject<RemoteMedia>;
27
+ localStream: MediaStream | null;
28
+ incomingCallSubject: Subject<{
29
+ callId: string;
30
+ farEndNumber: string;
31
+ }>;
32
+ callTerminateSubject: Subject<{
33
+ callId: string;
34
+ reason: any;
35
+ }>;
36
+ outgoingDialSubject: BehaviorSubject<{
37
+ dialed: string;
38
+ }>;
39
+ private ringAudio;
40
+ private lastIncomingCall;
41
+ callStateSubject: Subject<{
42
+ callId: string;
43
+ state: string;
44
+ }>;
45
+ transferStatusSubject: Subject<{
46
+ callId?: string;
47
+ success: boolean;
48
+ message: string;
49
+ }>;
50
+ private transferInProgressCallId;
51
+ private callSlots;
52
+ activeCallsMap: Map<string, any>;
53
+ activeCallId: string | null;
54
+ currentcallId: string | null;
55
+ getLastIncomingCall(): {
56
+ callId: string;
57
+ farEndNumber: string;
58
+ } | null;
59
+ clearLastIncomingCall(): void;
60
+ notifyOutgoingDial(dialed: string): void;
61
+ clearOutgoingDial(): void;
62
+ getActiveCallCount(): number;
63
+ setLastIncomingCall(callId: string, farEndNumber: string): void;
64
+ private startRingTone;
65
+ private stopRingTone;
66
+ private agentId;
67
+ private loginStatusSubject;
68
+ loginStatus$: rxjs.Observable<boolean>;
69
+ private readonly DOM_TAGS;
70
+ private configTemplate;
71
+ private readonly agentStatusApiUrl;
72
+ private readonly CALL_HISTORY_API_URL;
73
+ private prewarmedStream?;
74
+ private isSafari;
75
+ private _rpcPatched;
76
+ private _rpcMessageListenerWs?;
77
+ private isLoggedIn;
78
+ private initAttempts;
79
+ constructor(zone: NgZone, http: HttpClient);
80
+ setConfigValues(opts: {
81
+ serviceType?: string;
82
+ gatewayIp?: string;
83
+ gatewayPort?: string;
84
+ stunIp?: string;
85
+ stunPort?: string;
86
+ turnIp?: string;
87
+ turnPort?: string;
88
+ }): void;
89
+ init(): void;
90
+ logIn(username: string, password: string, attempt?: number): void;
91
+ private logCliCapabilities;
92
+ logOut(): void;
93
+ logout(): void;
94
+ getAlternateServerConfig(): any;
95
+ getDeviceList(): void;
96
+ setDeviceIds(deviceIds: any): void;
97
+ makeCall(destination: string): Promise<'1' | '2' | '3' | null>;
98
+ dropCall(): void;
99
+ doMute(): void;
100
+ doUnMute(): void;
101
+ doHold(): void;
102
+ doUnHold(): void;
103
+ pauseVideo(): void;
104
+ playVideo(): void;
105
+ transferCall(target: string, type: string): void;
106
+ sendDTMF(digit: string | number): void;
107
+ answerCall(): void;
108
+ addVideo(): void;
109
+ removeVideo(): void;
110
+ clearCallSlot(): void;
111
+ setAgentId(id: string): void;
112
+ agentIdle(): void;
113
+ agentBusy(): void;
114
+ agentAutoRelease(): void;
115
+ handleConfigChange: (res_configChange: any) => void;
116
+ handleRegistrationChange: (res_registrationChange: any) => void;
117
+ handleTokenRenewal: (res_tokenRenewal: any) => void;
118
+ assignToFirstAvailableSlot(callId: string, callObj: any): void;
119
+ getSlotForCallId(callId: string): '1' | '2' | '3' | null;
120
+ releaseCallById(callId: string): void;
121
+ handleCallState(callObj: any): void;
122
+ swapLines(): void;
123
+ swapToSlot(targetSlot: '1' | '2' | '3'): void;
124
+ dropCallBySlot(targetSlot: '1' | '2' | '3'): void;
125
+ logCall(callData: any): rxjs.Observable<Object>;
126
+ getActiveCallId(): string | null;
127
+ initLocalMic(): Promise<void>;
128
+ private patchRpcForTransfers;
129
+ makeCallWithCustomData(destination: string, dataToSend: string): Promise<'1' | '2' | '3' | null>;
130
+ transferCallWithTag(target: string, type: 'Attended' | 'Blind'): void;
131
+ consumeTransferInProgress(callId: string): boolean;
132
+ private _doPatch;
133
+ /** Pre-warm microphone so AWL always has a local stream when it tries addStream() */
134
+ prewarmMic(): Promise<MediaStream>;
135
+ static ɵfac: i0.ɵɵFactoryDeclaration<AvayaIPOService, never>;
136
+ static ɵprov: i0.ɵɵInjectableDeclaration<AvayaIPOService>;
137
+ }
138
+
139
+ declare class CountryService {
140
+ private httpClient;
141
+ private countriesData;
142
+ private static readonly COUNTRY_ENDPOINT;
143
+ constructor(httpClient: HttpClient);
144
+ getAllCountries(): Promise<any[]>;
145
+ getCountryFromCallingCode(countryCallingCode: string): Promise<any | undefined>;
146
+ getCountryFromCountryCode(countryCode: string): Promise<any | undefined>;
147
+ static ɵfac: i0.ɵɵFactoryDeclaration<CountryService, never>;
148
+ static ɵprov: i0.ɵɵInjectableDeclaration<CountryService>;
149
+ }
150
+
151
+ declare class PhoneNumberLookupService {
152
+ private httpClient;
153
+ constructor(httpClient: HttpClient);
154
+ lookupPhoneNumber(phoneNumber: string, hlr?: boolean): Promise<Object>;
155
+ private normalizeForLookup;
156
+ static ɵfac: i0.ɵɵFactoryDeclaration<PhoneNumberLookupService, never>;
157
+ static ɵprov: i0.ɵɵInjectableDeclaration<PhoneNumberLookupService>;
158
+ }
159
+
160
+ declare class AuthenticationService {
161
+ private snugdeskAuthService;
162
+ tenant$: BehaviorSubject<any>;
163
+ user$: BehaviorSubject<any>;
164
+ isAuthenticated$: BehaviorSubject<boolean>;
165
+ constructor(snugdeskAuthService: SnugdeskAuthenticationService);
166
+ isAuthenticated(): boolean;
167
+ getAuthSessionToken(): string | null;
168
+ getAuthDomainToken(): string | null;
169
+ getDecodedAuthDomainToken(): any;
170
+ getTenantId(): string;
171
+ getDecodedAuthSessionToken(): any;
172
+ getUserId(): string;
173
+ static ɵfac: i0.ɵɵFactoryDeclaration<AuthenticationService, never>;
174
+ static ɵprov: i0.ɵɵInjectableDeclaration<AuthenticationService>;
175
+ }
176
+
177
+ declare class EntitiesSearchService {
178
+ private http;
179
+ private authenticationService;
180
+ private nameCache;
181
+ constructor(http: HttpClient, authenticationService: AuthenticationService);
182
+ fetchContacts(tenantId: string, size?: number, searchAfter?: [string, string]): Promise<any>;
183
+ searchByPhone(tenantId: string, phoneNumber: string, size?: number): Promise<any>;
184
+ searchEntities(tenantId: string, query: string, size?: number, from?: number): Promise<any>;
185
+ getCachedName(tenantId: string, phoneNumber: string): string | null;
186
+ lookupNameByPhone(tenantId: string, phoneNumber: string, size?: number): Promise<string | null>;
187
+ private postEntities;
188
+ private cacheKey;
189
+ private ensureWildcard;
190
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntitiesSearchService, never>;
191
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntitiesSearchService>;
192
+ }
193
+
194
+ declare class AvayaIPOWidgetComponent implements OnInit, OnDestroy {
195
+ private formBuilder;
196
+ private avayaIPOService;
197
+ private cdr;
198
+ private countryService;
199
+ private phoneNumberLookupService;
200
+ private entitiesSearchService;
201
+ private snugdeskAuthService;
202
+ hostDarkMode: boolean;
203
+ private readonly STORAGE_KEY;
204
+ isVisible: boolean;
205
+ configurationMode?: string;
206
+ avayaIPOServerIP?: string;
207
+ avayaIPOServerPort?: number;
208
+ avayaIPOServerStunServerIP?: string;
209
+ avayaIPOServerStunServerPort?: number;
210
+ avayaIPOServerTurnServerIP?: string;
211
+ avayaIPOServerTurnServerPort?: number;
212
+ token?: string;
213
+ tenantId: string;
214
+ userId: string;
215
+ notificationEvent: EventEmitter<number>;
216
+ readonly avayaLogoUrl: string;
217
+ isReconnectingInProgress: boolean;
218
+ isFailoverInProgress: boolean;
219
+ isFailbackInProgress: boolean;
220
+ showLoginForm: boolean;
221
+ showLoginLoader: boolean;
222
+ hasAvayaSocketError: boolean;
223
+ hasAvayaLoginError: boolean;
224
+ hasAvayaLoginFailedGeneral: boolean;
225
+ hasAvayaLoginConflictError: boolean;
226
+ hasAvayaDeviceError: boolean;
227
+ private awlScriptPromise?;
228
+ loginForm: FormGroup;
229
+ activeTab: 'history' | 'contacts' | 'keypad' | 'settings';
230
+ private loginSub?;
231
+ private incomingCallSub?;
232
+ private callStateSub?;
233
+ hideTabs: boolean;
234
+ darkModeEnabled: boolean;
235
+ activeCallNumber: string | null;
236
+ incomingCallName: string | null;
237
+ incomingNameResolved: boolean;
238
+ activeCallName: string | null;
239
+ authErrorMessage: string;
240
+ authLoading: boolean;
241
+ private hasInitialized;
242
+ private callLogIndex;
243
+ private pendingDisconnectSide;
244
+ private callStartTimes;
245
+ constructor(formBuilder: FormBuilder, avayaIPOService: AvayaIPOService, cdr: ChangeDetectorRef, countryService: CountryService, phoneNumberLookupService: PhoneNumberLookupService, entitiesSearchService: EntitiesSearchService, snugdeskAuthService: SnugdeskAuthenticationService);
246
+ ngOnInit(): Promise<void>;
247
+ private initAfterAuth;
248
+ private authenticateWithToken;
249
+ onAuthLoginClick(): Promise<void>;
250
+ onLogin(): void;
251
+ onLogout(): void;
252
+ private handleLoginStatus;
253
+ selectTab(tab: 'history' | 'contacts' | 'keypad' | 'settings'): void;
254
+ onHistoryMakeCall(payload: {
255
+ dialOut: string;
256
+ name?: string;
257
+ }): void;
258
+ onPhoneMakeCall(phoneNumber: string): void;
259
+ onContactsMakeCall(payload: {
260
+ dialOut: string;
261
+ name?: string;
262
+ }): void;
263
+ onPhoneEndCall(): void;
264
+ onDeviceChange(change: {
265
+ audioInputId: string;
266
+ audioOutputId: string;
267
+ videoInputId?: string;
268
+ }): void;
269
+ onThemeToggle(enabled: boolean): void;
270
+ onCallScreenChange(active: boolean): void;
271
+ private triggerCall;
272
+ ngOnDestroy(): void;
273
+ private getLookupPhoneNumber;
274
+ private getOpenSearchCallerName;
275
+ private normalizePhoneForSearch;
276
+ private persistSession;
277
+ private restoreSession;
278
+ private restoreThemePreference;
279
+ private clearSession;
280
+ private loadAwlScript;
281
+ static ɵfac: i0.ɵɵFactoryDeclaration<AvayaIPOWidgetComponent, never>;
282
+ static ɵcmp: i0.ɵɵComponentDeclaration<AvayaIPOWidgetComponent, "snugdesk-avaya-ipo-widget", never, { "isVisible": { "alias": "isVisible"; "required": false; }; "configurationMode": { "alias": "configurationMode"; "required": false; }; "avayaIPOServerIP": { "alias": "avayaIPOServerIP"; "required": false; }; "avayaIPOServerPort": { "alias": "avayaIPOServerPort"; "required": false; }; "avayaIPOServerStunServerIP": { "alias": "avayaIPOServerStunServerIP"; "required": false; }; "avayaIPOServerStunServerPort": { "alias": "avayaIPOServerStunServerPort"; "required": false; }; "avayaIPOServerTurnServerIP": { "alias": "avayaIPOServerTurnServerIP"; "required": false; }; "avayaIPOServerTurnServerPort": { "alias": "avayaIPOServerTurnServerPort"; "required": false; }; "token": { "alias": "token"; "required": false; }; "tenantId": { "alias": "tenantId"; "required": false; }; "userId": { "alias": "userId"; "required": false; }; }, { "notificationEvent": "notificationEvent"; }, never, never, false, never>;
283
+ }
284
+
285
+ declare class CallHistoryComponent implements OnInit {
286
+ private http;
287
+ private cdr;
288
+ mode: 'dial' | 'transfer';
289
+ tenantId?: string;
290
+ agentId?: string;
291
+ makeCallEv: EventEmitter<{
292
+ dialOut: string;
293
+ name?: string;
294
+ }>;
295
+ transferEv: EventEmitter<any>;
296
+ private readonly CALL_HISTORY_API_URL;
297
+ showHistoryLoader: boolean;
298
+ callHistory: any[];
299
+ searchTerm: string;
300
+ recentCallactiveTab: 'recentCall' | 'missedCall';
301
+ selectedCall: any;
302
+ constructor(http: HttpClient, cdr: ChangeDetectorRef);
303
+ ngOnInit(): Promise<void>;
304
+ recentSelectTab(tab: 'recentCall' | 'missedCall'): void;
305
+ loadCallHistory(): Promise<void>;
306
+ getCallHistory(tenantId: string, agentId: string): Promise<any>;
307
+ makeCall(phoneNumber: string, name?: string): void;
308
+ get callerDropped(): any[];
309
+ get filteredRecent(): any[];
310
+ get groupedRecent(): Array<{
311
+ label: string;
312
+ items: any[];
313
+ }>;
314
+ get filteredMissed(): any[];
315
+ get groupedMissed(): Array<{
316
+ label: string;
317
+ items: any[];
318
+ }>;
319
+ onSelectCall(item: any): void;
320
+ closeDetails(): void;
321
+ selectFromHistory(item: any): void;
322
+ private resolveDialable;
323
+ private resolveName;
324
+ private formatDialOutFromInput;
325
+ private getTenantIdFromSession;
326
+ private getUserIdFromSession;
327
+ getPhoneDisplay(item: any): string;
328
+ getPhoneBadge(item: any): string;
329
+ private getInitials;
330
+ private groupByDate;
331
+ private formatDateLabel;
332
+ static ɵfac: i0.ɵɵFactoryDeclaration<CallHistoryComponent, never>;
333
+ static ɵcmp: i0.ɵɵComponentDeclaration<CallHistoryComponent, "app-call-history", never, { "mode": { "alias": "mode"; "required": false; }; "tenantId": { "alias": "tenantId"; "required": false; }; "agentId": { "alias": "agentId"; "required": false; }; }, { "makeCallEv": "makeCallEv"; "transferEv": "transferEv"; }, never, never, false, never>;
334
+ }
335
+
336
+ type TranscriptLine = {
337
+ speaker?: string;
338
+ text?: string;
339
+ };
340
+ declare class CallDetailsComponent {
341
+ private http;
342
+ call: any;
343
+ transcriptLines: TranscriptLine[];
344
+ summaryText: string;
345
+ customerSentiment: string;
346
+ isTranscribing: boolean;
347
+ transcriptionError: string;
348
+ isTranscriptFullscreen: boolean;
349
+ hasGeneratedTranscript: boolean;
350
+ private readonly ANALYZE_CALL_API;
351
+ constructor(http: HttpClient);
352
+ getBadge(): string;
353
+ getDisplayName(): string;
354
+ getPhone(): string;
355
+ getTranscriptSpeaker(line: TranscriptLine): string;
356
+ runTranscription(): Promise<void>;
357
+ private normalizeTranscript;
358
+ getSentimentEmoji(): string;
359
+ private parseSpeakerLine;
360
+ toggleTranscriptFullscreen(): void;
361
+ private getRecordingFilename;
362
+ static ɵfac: i0.ɵɵFactoryDeclaration<CallDetailsComponent, never>;
363
+ static ɵcmp: i0.ɵɵComponentDeclaration<CallDetailsComponent, "app-call-details", never, { "call": { "alias": "call"; "required": false; }; }, {}, never, never, false, never>;
364
+ }
365
+
366
+ type ContactItem = {
367
+ id: string;
368
+ name: string;
369
+ phone: string;
370
+ entity: any;
371
+ };
372
+ declare class ContactsComponent implements OnInit, AfterViewInit {
373
+ private entitiesSearchService;
374
+ tenantId?: string;
375
+ listEl?: ElementRef<HTMLElement>;
376
+ makeCallEv: EventEmitter<{
377
+ dialOut: string;
378
+ name?: string;
379
+ }>;
380
+ contacts: ContactItem[];
381
+ groupedContacts: Array<{
382
+ label: string;
383
+ items: ContactItem[];
384
+ }>;
385
+ selectedContact: ContactItem | null;
386
+ searchTerm: string;
387
+ isLoading: boolean;
388
+ error: string;
389
+ private searchToken;
390
+ private pageSize;
391
+ private nextFrom;
392
+ private searchAfter?;
393
+ private hasMore;
394
+ isLoadingMore: boolean;
395
+ constructor(entitiesSearchService: EntitiesSearchService);
396
+ ngOnInit(): void;
397
+ ngAfterViewInit(): void;
398
+ private resetAndLoad;
399
+ loadNextPage(): Promise<void>;
400
+ onSearchChange(value: string): void;
401
+ private groupContacts;
402
+ private applySearch;
403
+ openContact(contact: ContactItem): void;
404
+ closeContact(): void;
405
+ onCallContact(contact: ContactItem, ev?: Event): void;
406
+ private searchContacts;
407
+ onListScroll(event: Event): void;
408
+ private ensureFill;
409
+ private getGroupLabel;
410
+ private getPageSize;
411
+ static ɵfac: i0.ɵɵFactoryDeclaration<ContactsComponent, never>;
412
+ static ɵcmp: i0.ɵɵComponentDeclaration<ContactsComponent, "app-contacts", never, { "tenantId": { "alias": "tenantId"; "required": false; }; }, { "makeCallEv": "makeCallEv"; }, never, never, false, never>;
413
+ }
414
+
415
+ declare class ContactCardComponent {
416
+ name: string;
417
+ phone: string;
418
+ call: EventEmitter<Event>;
419
+ get initials(): string;
420
+ onCall(ev: Event): void;
421
+ static ɵfac: i0.ɵɵFactoryDeclaration<ContactCardComponent, never>;
422
+ static ɵcmp: i0.ɵɵComponentDeclaration<ContactCardComponent, "app-contact-card", never, { "name": { "alias": "name"; "required": false; }; "phone": { "alias": "phone"; "required": false; }; }, { "call": "call"; }, never, never, false, never>;
423
+ }
424
+
425
+ declare class ContactDetailsComponent {
426
+ contact: any;
427
+ getDisplayName(): string;
428
+ getPrimaryPhone(): string;
429
+ getEmails(): string[];
430
+ getPhoneNumbers(): string[];
431
+ getInitials(): string;
432
+ static ɵfac: i0.ɵɵFactoryDeclaration<ContactDetailsComponent, never>;
433
+ static ɵcmp: i0.ɵɵComponentDeclaration<ContactDetailsComponent, "app-contact-details", never, { "contact": { "alias": "contact"; "required": false; }; }, {}, never, never, false, never>;
434
+ }
435
+
436
+ declare class SettingsComponent implements OnInit, OnDestroy {
437
+ selectedAudioInputId?: string;
438
+ selectedAudioOutputId?: string;
439
+ extensionId?: string;
440
+ darkMode: boolean;
441
+ change: EventEmitter<{
442
+ audioInputId: string;
443
+ audioOutputId: string;
444
+ videoInputId?: string;
445
+ }>;
446
+ darkModeChange: EventEmitter<boolean>;
447
+ logout: EventEmitter<void>;
448
+ audioInputs: MediaDeviceInfo[];
449
+ audioOutputs: MediaDeviceInfo[];
450
+ ngOnInit(): void;
451
+ onLogout(): void;
452
+ onToggleDarkMode(): void;
453
+ ngOnDestroy(): void;
454
+ private handleDeviceChange;
455
+ private refreshDeviceList;
456
+ onMicChange(deviceId: string | undefined): void;
457
+ onSpeakerChange(deviceId: string | undefined): void;
458
+ private emitDeviceChange;
459
+ trackByDeviceId(index: number, device: MediaDeviceInfo): string;
460
+ static ɵfac: i0.ɵɵFactoryDeclaration<SettingsComponent, never>;
461
+ static ɵcmp: i0.ɵɵComponentDeclaration<SettingsComponent, "app-settings", never, { "selectedAudioInputId": { "alias": "selectedAudioInputId"; "required": false; }; "selectedAudioOutputId": { "alias": "selectedAudioOutputId"; "required": false; }; "extensionId": { "alias": "extensionId"; "required": false; }; "darkMode": { "alias": "darkMode"; "required": false; }; }, { "change": "change"; "darkModeChange": "darkModeChange"; "logout": "logout"; }, never, never, false, never>;
462
+ }
463
+
464
+ declare class AvayaIpoLoginComponent {
465
+ loginForm: FormGroup;
466
+ showLoginLoader: boolean;
467
+ hasAvayaSocketError: boolean;
468
+ hasAvayaLoginError: boolean;
469
+ hasAvayaLoginFailedGeneral: boolean;
470
+ hasAvayaLoginConflictError: boolean;
471
+ hasAvayaDeviceError: boolean;
472
+ login: EventEmitter<void>;
473
+ showLoginPassword: boolean;
474
+ onLoginClick(): void;
475
+ restrictNumeric(evt: KeyboardEvent): boolean;
476
+ static ɵfac: i0.ɵɵFactoryDeclaration<AvayaIpoLoginComponent, never>;
477
+ static ɵcmp: i0.ɵɵComponentDeclaration<AvayaIpoLoginComponent, "app-avaya-ipo-login", never, { "loginForm": { "alias": "loginForm"; "required": false; }; "showLoginLoader": { "alias": "showLoginLoader"; "required": false; }; "hasAvayaSocketError": { "alias": "hasAvayaSocketError"; "required": false; }; "hasAvayaLoginError": { "alias": "hasAvayaLoginError"; "required": false; }; "hasAvayaLoginFailedGeneral": { "alias": "hasAvayaLoginFailedGeneral"; "required": false; }; "hasAvayaLoginConflictError": { "alias": "hasAvayaLoginConflictError"; "required": false; }; "hasAvayaDeviceError": { "alias": "hasAvayaDeviceError"; "required": false; }; }, { "login": "login"; }, never, never, false, never>;
478
+ }
479
+
480
+ interface CallMetadata {
481
+ tenantId: string;
482
+ agentId: string;
483
+ phoneNumber: string;
484
+ callId: string;
485
+ }
486
+
487
+ interface RecordingSession {
488
+ audioContext: AudioContext;
489
+ recordingStream: MediaStreamAudioDestinationNode;
490
+ recorder?: MediaRecorder | null;
491
+ metadata: CallMetadata;
492
+ stopping: boolean;
493
+ chunkIndex: number;
494
+ chunkTimer?: number;
495
+ }
496
+ declare class RecordingManagerService {
497
+ private http;
498
+ private sessions;
499
+ private readonly MIME_TYPE_PREFERRED;
500
+ private readonly MIME_TYPE_FALLBACK;
501
+ private readonly CHUNK_DURATION_MS;
502
+ private readonly AUDIO_CONTEXT_CLOSE_DELAY_MS;
503
+ private readonly CALL_HISTORY_API_URL;
504
+ constructor(http: HttpClient);
505
+ startRecording(localMediaStream: MediaStream, remoteMediaStream: MediaStream, metadata: CallMetadata): RecordingSession | undefined;
506
+ getSession(callId: string): RecordingSession | undefined;
507
+ stopRecording(callId: string): void;
508
+ private startNextChunk;
509
+ private uploadCallRecording;
510
+ private convertBlobToBase64;
511
+ private generateFilename;
512
+ private generateChunkFilename;
513
+ private normalizePhoneNumberForUpload;
514
+ static ɵfac: i0.ɵɵFactoryDeclaration<RecordingManagerService, never>;
515
+ static ɵprov: i0.ɵɵInjectableDeclaration<RecordingManagerService>;
516
+ }
517
+
518
+ type TranscriptMessage = {
519
+ callId: string;
520
+ text: string;
521
+ isFinal: boolean;
522
+ ts: number;
523
+ speaker?: string;
524
+ };
525
+ declare class TranscriptionStreamService implements OnDestroy {
526
+ private session;
527
+ private transcriptSubject;
528
+ readonly transcript$: rxjs.Observable<TranscriptMessage>;
529
+ private readonly SAMPLE_RATE;
530
+ private readonly BUFFER_SIZE;
531
+ private readonly SILENCE_RMS_THRESHOLD;
532
+ private readonly VOICE_RMS_THRESHOLD;
533
+ private readonly NOISE_FLOOR_MULTIPLIER;
534
+ private readonly NOISE_FLOOR_SMOOTHING;
535
+ private readonly CHUNK_INTERVAL_MS;
536
+ private readonly CUSTOM_WS_URL;
537
+ private readonly CUSTOM_WS_MIME_TYPE;
538
+ private readonly LANGUAGE_CODE;
539
+ private readonly ALT_LANGUAGE_CODES;
540
+ private readonly TRANSCRIPTION_MODEL;
541
+ constructor();
542
+ ngOnDestroy(): void;
543
+ startSession(callId: string, localStream: MediaStream, remoteStream: MediaStream, allowSendBinary?: boolean): Promise<void>;
544
+ stopSession(callId: string): void;
545
+ enableBinary(callId: string): void;
546
+ setStreamMuted(callId: string, label: 'agent' | 'customer', muted: boolean): void;
547
+ private mixToMono;
548
+ private calculateRms;
549
+ private encodePcm16;
550
+ private downsampleBuffer;
551
+ private queueAudio;
552
+ private flushPendingAudio;
553
+ private mergeChunks;
554
+ private handleTranscriptPayload;
555
+ private parseSpeakerLine;
556
+ private createStreamSession;
557
+ static ɵfac: i0.ɵɵFactoryDeclaration<TranscriptionStreamService, never>;
558
+ static ɵprov: i0.ɵɵInjectableDeclaration<TranscriptionStreamService>;
559
+ }
560
+
561
+ declare class PhoneComponent implements OnInit, AfterViewInit, OnChanges, OnDestroy {
562
+ private cdr;
563
+ private formBuilder;
564
+ private avayaIpoService;
565
+ private authenticationService;
566
+ private recordingManagerService;
567
+ private transcriptionStreamService;
568
+ contacts: any[];
569
+ tenantId?: string;
570
+ agentId?: string;
571
+ callScreenChange: EventEmitter<boolean>;
572
+ private _isActiveCall;
573
+ set isActiveCall(value: boolean);
574
+ get isActiveCall(): boolean;
575
+ activeCallNumber: string | null;
576
+ incomingCallName?: string | null;
577
+ incomingNameResolved: boolean;
578
+ activeCallName?: string | null;
579
+ serverIp?: string;
580
+ serverPort?: number;
581
+ stunIp?: string;
582
+ stunPort?: number;
583
+ turnIp?: string;
584
+ turnPort?: number;
585
+ configurationMode?: string;
586
+ makeCallEv: EventEmitter<string>;
587
+ endCallEv: EventEmitter<void>;
588
+ audioElement: any;
589
+ private callStateSub?;
590
+ private endToneTimeout?;
591
+ private suppressHangupToneOnce;
592
+ private transferStatusSub?;
593
+ private remoteStreamSub?;
594
+ private callTerminateSub?;
595
+ private outgoingDialSub?;
596
+ private transcriptionSub?;
597
+ private lastRemoteStream;
598
+ private lastLocalStream;
599
+ private currentCallId;
600
+ private pendingOutgoing;
601
+ private transcriptionActiveCallId;
602
+ private pendingTranscriptionCallId;
603
+ private pendingTranscriptionAllowBinary;
604
+ private lastPartialIndex;
605
+ private pendingIncomingCall;
606
+ dialForm: FormGroup;
607
+ directoryForm: FormGroup;
608
+ showDirectoryPhonebook: boolean;
609
+ isTransferMode: boolean;
610
+ isAddCallMode: boolean;
611
+ directoryTab: 'contacts' | 'dialpad';
612
+ directoryNumber: string;
613
+ contactSearch: string;
614
+ directoryDigits: {
615
+ digit: string;
616
+ letters: string;
617
+ }[];
618
+ incomingCallSubscription: any;
619
+ incomingCallNumber: string | undefined;
620
+ isMuted: boolean;
621
+ isHeld: boolean;
622
+ activeCallDuration: number;
623
+ callStatusText: string;
624
+ transferError: string;
625
+ transferSuccess: string;
626
+ transferPending: boolean;
627
+ private transferErrorTimeout?;
628
+ private activeCallTimer?;
629
+ private muteToggleInProgress;
630
+ private holdToggleInProgress;
631
+ isKeypadOpen: boolean;
632
+ isTranscriptionOpen: boolean;
633
+ transcriptText: string;
634
+ transcriptSegments: Array<{
635
+ ts: number;
636
+ text: string;
637
+ speaker?: string;
638
+ }>;
639
+ private transcriptStartedAt;
640
+ private transcriptEndedAt;
641
+ autoDownloadSummaryOnEnd: boolean;
642
+ summaryText: string;
643
+ dtmfBuffer: string;
644
+ private phoneUtil;
645
+ CountryISO: typeof CountryISO;
646
+ SearchCountryField: typeof SearchCountryField;
647
+ isRinging: boolean;
648
+ audio: any;
649
+ get isConnecting(): boolean;
650
+ constructor(cdr: ChangeDetectorRef, formBuilder: FormBuilder, avayaIpoService: AvayaIPOService, authenticationService: AuthenticationService, recordingManagerService: RecordingManagerService, transcriptionStreamService: TranscriptionStreamService);
651
+ ngOnInit(): void;
652
+ ngOnChanges(changes: SimpleChanges): void;
653
+ ngAfterViewInit(): void;
654
+ ngOnDestroy(): void;
655
+ makeCall(): void;
656
+ onClear(): void;
657
+ handleKeyboardInput: (event: KeyboardEvent) => void;
658
+ handleKeypadInput(digit: string): void;
659
+ private updatePhoneControl;
660
+ private formatE164;
661
+ private formatDialOut;
662
+ declineAvayaCall(): void;
663
+ acceptAvayaCAll(): void;
664
+ onEndActiveCall(): void;
665
+ private playHangupToneAndThenIdle;
666
+ private finishDisconnectWithoutTone;
667
+ private handleIncomingCall;
668
+ onActiveOpenContacts(): void;
669
+ onActiveOpenKeypad(): void;
670
+ closeKeypad(): void;
671
+ private startTranscriptionForCall;
672
+ private applyTranscriptUpdate;
673
+ getTranscriptSpeakerLabel(segment: {
674
+ speaker?: string;
675
+ }): string;
676
+ getTranscriptBubbleClass(segment: {
677
+ speaker?: string;
678
+ }): string;
679
+ get customerTranscriptSegments(): Array<{
680
+ ts: number;
681
+ text: string;
682
+ }>;
683
+ get agentTranscriptSegments(): Array<{
684
+ ts: number;
685
+ text: string;
686
+ }>;
687
+ openTranscription(): void;
688
+ closeTranscription(): void;
689
+ private stopTranscription;
690
+ private generateAndDownloadSummary;
691
+ private buildExtractiveSummary;
692
+ private splitSentences;
693
+ private extractActionItems;
694
+ private extractKeyInfo;
695
+ private downloadBlobFile;
696
+ private fmtHMS;
697
+ onClosePhonebook(): void;
698
+ onContactsLoaded(list: any[]): void;
699
+ get filteredContacts(): any[];
700
+ onSelectContact(contact: any): void;
701
+ toggleMute(): void;
702
+ toggleHold(): void;
703
+ onTransferCall(): void;
704
+ private emitCallScreenState;
705
+ private startCallTimer;
706
+ private stopCallTimer;
707
+ onIdleToggleDirectory(): void;
708
+ onIdleClear(): void;
709
+ onIdleMakeCall(): void;
710
+ onIdleKeypadInput(digit: string): void;
711
+ onIdleKeyboardInput(ev: KeyboardEvent): void;
712
+ setDirectoryTab(tab: 'contacts' | 'dialpad'): void;
713
+ onDirectoryKeypad(digit: string): void;
714
+ onDirectoryBackspace(): void;
715
+ onDirectoryUseNumber(): void;
716
+ onDirectoryClear(): void;
717
+ onDtmfDigit(digit: string): void;
718
+ onDtmfBackspace(): void;
719
+ private updateDirectoryControl;
720
+ private formatDialOutFromInput;
721
+ private formatTransferTargetFromInput;
722
+ private startRecordingForCall;
723
+ static ɵfac: i0.ɵɵFactoryDeclaration<PhoneComponent, never>;
724
+ static ɵcmp: i0.ɵɵComponentDeclaration<PhoneComponent, "app-phone", never, { "contacts": { "alias": "contacts"; "required": false; }; "tenantId": { "alias": "tenantId"; "required": false; }; "agentId": { "alias": "agentId"; "required": false; }; "isActiveCall": { "alias": "isActiveCall"; "required": false; }; "activeCallNumber": { "alias": "activeCallNumber"; "required": false; }; "incomingCallName": { "alias": "incomingCallName"; "required": false; }; "incomingNameResolved": { "alias": "incomingNameResolved"; "required": false; }; "activeCallName": { "alias": "activeCallName"; "required": false; }; "serverIp": { "alias": "serverIp"; "required": false; }; "serverPort": { "alias": "serverPort"; "required": false; }; "stunIp": { "alias": "stunIp"; "required": false; }; "stunPort": { "alias": "stunPort"; "required": false; }; "turnIp": { "alias": "turnIp"; "required": false; }; "turnPort": { "alias": "turnPort"; "required": false; }; "configurationMode": { "alias": "configurationMode"; "required": false; }; }, { "callScreenChange": "callScreenChange"; "makeCallEv": "makeCallEv"; "endCallEv": "endCallEv"; }, never, never, false, never>;
725
+ }
726
+
727
+ declare class PhoneIdleComponent {
728
+ dialForm: FormGroup;
729
+ contacts: any[];
730
+ showDirectoryPhonebook: boolean;
731
+ isRinging: boolean;
732
+ CountryISO: typeof CountryISO;
733
+ SearchCountryField: typeof SearchCountryField;
734
+ toggleDirectory: EventEmitter<void>;
735
+ clear: EventEmitter<void>;
736
+ makeCall: EventEmitter<void>;
737
+ keypadInput: EventEmitter<string>;
738
+ keyboardInput: EventEmitter<KeyboardEvent>;
739
+ getContactBadge(contact: any): string;
740
+ onToggleDirectory(): void;
741
+ onClear(): void;
742
+ onMakeCall(): void;
743
+ onKeypadInput(d: string): void;
744
+ onKeyboardInput(ev: KeyboardEvent): void;
745
+ static ɵfac: i0.ɵɵFactoryDeclaration<PhoneIdleComponent, never>;
746
+ static ɵcmp: i0.ɵɵComponentDeclaration<PhoneIdleComponent, "app-phone-idle", never, { "dialForm": { "alias": "dialForm"; "required": false; }; "contacts": { "alias": "contacts"; "required": false; }; "showDirectoryPhonebook": { "alias": "showDirectoryPhonebook"; "required": false; }; "isRinging": { "alias": "isRinging"; "required": false; }; "CountryISO": { "alias": "CountryISO"; "required": false; }; "SearchCountryField": { "alias": "SearchCountryField"; "required": false; }; }, { "toggleDirectory": "toggleDirectory"; "clear": "clear"; "makeCall": "makeCall"; "keypadInput": "keypadInput"; "keyboardInput": "keyboardInput"; }, never, never, false, never>;
747
+ }
748
+
749
+ declare class PhoneIncomingComponent {
750
+ incomingAvatarUrl: string;
751
+ incomingCallName?: string;
752
+ incomingNameResolved: boolean;
753
+ incomingCallNumber: string | undefined;
754
+ accept: EventEmitter<void>;
755
+ decline: EventEmitter<void>;
756
+ static ɵfac: i0.ɵɵFactoryDeclaration<PhoneIncomingComponent, never>;
757
+ static ɵcmp: i0.ɵɵComponentDeclaration<PhoneIncomingComponent, "app-phone-incoming", never, { "incomingCallName": { "alias": "incomingCallName"; "required": false; }; "incomingNameResolved": { "alias": "incomingNameResolved"; "required": false; }; "incomingCallNumber": { "alias": "incomingCallNumber"; "required": false; }; }, { "accept": "accept"; "decline": "decline"; }, never, never, false, never>;
758
+ }
759
+
760
+ declare class PhoneActiveComponent implements OnInit {
761
+ private entitiesSearchService;
762
+ tenantId?: string;
763
+ activeAvatarUrl: string;
764
+ activeCallName?: string;
765
+ activeCallNumber: string | null;
766
+ activeCallDuration: number;
767
+ callStatusText: string;
768
+ isConnecting: boolean;
769
+ isMuted: boolean;
770
+ isHeld: boolean;
771
+ endCall: EventEmitter<void>;
772
+ toggleMute: EventEmitter<void>;
773
+ toggleHold: EventEmitter<void>;
774
+ transfer: EventEmitter<void>;
775
+ openContacts: EventEmitter<void>;
776
+ openKeypad: EventEmitter<void>;
777
+ startTranscription: EventEmitter<void>;
778
+ contactsLoaded: EventEmitter<any[]>;
779
+ private isLoadingContacts;
780
+ constructor(entitiesSearchService: EntitiesSearchService);
781
+ ngOnInit(): void;
782
+ fetchContacts(): Promise<void>;
783
+ formatDuration(totalSeconds: number): string;
784
+ static ɵfac: i0.ɵɵFactoryDeclaration<PhoneActiveComponent, never>;
785
+ static ɵcmp: i0.ɵɵComponentDeclaration<PhoneActiveComponent, "app-phone-active", never, { "tenantId": { "alias": "tenantId"; "required": false; }; "activeCallName": { "alias": "activeCallName"; "required": false; }; "activeCallNumber": { "alias": "activeCallNumber"; "required": false; }; "activeCallDuration": { "alias": "activeCallDuration"; "required": false; }; "callStatusText": { "alias": "callStatusText"; "required": false; }; "isConnecting": { "alias": "isConnecting"; "required": false; }; "isMuted": { "alias": "isMuted"; "required": false; }; "isHeld": { "alias": "isHeld"; "required": false; }; }, { "endCall": "endCall"; "toggleMute": "toggleMute"; "toggleHold": "toggleHold"; "transfer": "transfer"; "openContacts": "openContacts"; "openKeypad": "openKeypad"; "startTranscription": "startTranscription"; "contactsLoaded": "contactsLoaded"; }, never, never, false, never>;
786
+ }
787
+
788
+ declare class AvayaIPOWidgetModule {
789
+ static ɵfac: i0.ɵɵFactoryDeclaration<AvayaIPOWidgetModule, never>;
790
+ static ɵmod: i0.ɵɵNgModuleDeclaration<AvayaIPOWidgetModule, [typeof AvayaIPOWidgetComponent, typeof CallHistoryComponent, typeof CallDetailsComponent, typeof ContactsComponent, typeof ContactCardComponent, typeof ContactDetailsComponent, typeof SettingsComponent, typeof AvayaIpoLoginComponent, typeof PhoneComponent, typeof PhoneIdleComponent, typeof PhoneIncomingComponent, typeof PhoneActiveComponent], [typeof i13.CommonModule, typeof i14.FormsModule, typeof i14.ReactiveFormsModule, typeof i15.MatFormFieldModule, typeof i16.MatInputModule, typeof i17.MatIconModule, typeof i18.MatButtonModule, typeof i19.NgxIntlTelInputModule], [typeof AvayaIPOWidgetComponent]>;
791
+ static ɵinj: i0.ɵɵInjectorDeclaration<AvayaIPOWidgetModule>;
792
+ }
793
+
794
+ export { AvayaIPOWidgetComponent, AvayaIPOWidgetModule };