@vgroup/dialbox 0.0.4 → 0.0.6
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/esm2020/lib/components/call-progress/call-progress.component.mjs +433 -0
- package/esm2020/lib/components/call-progress/incoming-call/incoming-call.component.mjs +191 -0
- package/esm2020/lib/components/caller-id-dialog/caller-id-dialog.component.mjs +52 -0
- package/esm2020/lib/dialbox.component.mjs +6 -6
- package/esm2020/lib/dialbox.module.mjs +18 -3
- package/esm2020/lib/shared/global-constant.mjs +6 -0
- package/esm2020/public-api.mjs +4 -1
- package/fesm2015/vgroup-dialbox.mjs +704 -11
- package/fesm2015/vgroup-dialbox.mjs.map +1 -1
- package/fesm2020/vgroup-dialbox.mjs +687 -11
- package/fesm2020/vgroup-dialbox.mjs.map +1 -1
- package/lib/components/call-progress/call-progress.component.d.ts +79 -0
- package/lib/components/call-progress/incoming-call/incoming-call.component.d.ts +41 -0
- package/lib/components/caller-id-dialog/caller-id-dialog.component.d.ts +24 -0
- package/lib/dialbox.component.d.ts +1 -0
- package/lib/dialbox.module.d.ts +8 -5
- package/lib/shared/global-constant.d.ts +5 -0
- package/package.json +3 -2
- package/public-api.d.ts +3 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, EventEmitter, Component, Input, Output, ViewChild, NgModule } from '@angular/core';
|
|
2
|
+
import { Injectable, EventEmitter, Component, Input, Output, ViewChild, Inject, NgModule } from '@angular/core';
|
|
3
3
|
import { AsYouType } from 'libphonenumber-js';
|
|
4
|
-
import { BehaviorSubject, throwError, Subscription } from 'rxjs';
|
|
4
|
+
import { BehaviorSubject, throwError, Subscription, interval } from 'rxjs';
|
|
5
5
|
import * as i1 from '@angular/common/http';
|
|
6
6
|
import { HttpHeaders, HttpParams, HttpClientModule } from '@angular/common/http';
|
|
7
7
|
import { catchError, switchMap, map } from 'rxjs/operators';
|
|
@@ -11,6 +11,10 @@ import * as i5 from '@angular/common';
|
|
|
11
11
|
import { CommonModule } from '@angular/common';
|
|
12
12
|
import * as i6 from '@angular/forms';
|
|
13
13
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
14
|
+
import { Device } from '@twilio/voice-sdk';
|
|
15
|
+
import swal from 'sweetalert2';
|
|
16
|
+
import * as i3 from '@angular/material/dialog';
|
|
17
|
+
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
|
|
14
18
|
|
|
15
19
|
const keypad = [
|
|
16
20
|
{
|
|
@@ -2309,11 +2313,11 @@ class DialboxComponent {
|
|
|
2309
2313
|
//this.callData = call;
|
|
2310
2314
|
this.newIncomingCallData = call;
|
|
2311
2315
|
}
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2316
|
+
rejectNewIncomingCall(call) {
|
|
2317
|
+
call.reject();
|
|
2318
|
+
this.newIncomingCalls = this.newIncomingCalls.filter((item) => item.parameters['CallSid'] !== call.parameters['CallSid']);
|
|
2319
|
+
this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== call.parameters['CallSid']);
|
|
2320
|
+
}
|
|
2317
2321
|
newIncomingCallInitiated() {
|
|
2318
2322
|
this.isCallInProgress = true;
|
|
2319
2323
|
this.newIncomingCalls = [];
|
|
@@ -2371,14 +2375,681 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2371
2375
|
type: Output
|
|
2372
2376
|
}] } });
|
|
2373
2377
|
|
|
2378
|
+
class CallProgressComponent {
|
|
2379
|
+
constructor(extensionService, cdr) {
|
|
2380
|
+
this.extensionService = extensionService;
|
|
2381
|
+
this.cdr = cdr;
|
|
2382
|
+
this.endCallEvent = new EventEmitter();
|
|
2383
|
+
this.incomingCallsNewInfo = new EventEmitter();
|
|
2384
|
+
this.minimiseEvent = new EventEmitter();
|
|
2385
|
+
this.showRingAnimation = false;
|
|
2386
|
+
this.timer = '00:00';
|
|
2387
|
+
this.showKeypad = false;
|
|
2388
|
+
this.keypadVal = keypad;
|
|
2389
|
+
this.callInput = '';
|
|
2390
|
+
this.isMute = false;
|
|
2391
|
+
this.disbaleEndCallBtn = true;
|
|
2392
|
+
this.showClearBtn = false;
|
|
2393
|
+
this.isCollops = false;
|
|
2394
|
+
// Incoming call variables
|
|
2395
|
+
this.incomingCallDiv = false;
|
|
2396
|
+
//@Output() showCallProgressEvent: EventEmitter<void> = new EventEmitter<void>();
|
|
2397
|
+
this.incomingCallInitiated = new EventEmitter();
|
|
2398
|
+
this.isRecording = false;
|
|
2399
|
+
this.isPaused = false;
|
|
2400
|
+
this.timeElapsed = 0; // in seconds
|
|
2401
|
+
this.recordCall = false;
|
|
2402
|
+
this.callStatus = 'ringing';
|
|
2403
|
+
this.isMinimised = false;
|
|
2404
|
+
}
|
|
2405
|
+
ngOnInit() {
|
|
2406
|
+
console.log('Call Progress Component');
|
|
2407
|
+
}
|
|
2408
|
+
ngOnChanges(changes) {
|
|
2409
|
+
console.log('Call Progress Component ngOnChanges');
|
|
2410
|
+
if (changes['callData']) {
|
|
2411
|
+
console.log('Call Progress Component ngOnChanges callData', changes['callData']);
|
|
2412
|
+
if (changes['callData'].currentValue.isIncomingCall) {
|
|
2413
|
+
this.incomingCallDiv = true;
|
|
2414
|
+
}
|
|
2415
|
+
else {
|
|
2416
|
+
//for outgoing call
|
|
2417
|
+
this.startCall(changes['callData'].currentValue);
|
|
2418
|
+
}
|
|
2419
|
+
}
|
|
2420
|
+
if (changes['newIncomingCallData']) {
|
|
2421
|
+
try {
|
|
2422
|
+
if (changes['newIncomingCallData'].currentValue) {
|
|
2423
|
+
if (this.call && (this.call.status() == 'open')) {
|
|
2424
|
+
this.call.disconnect();
|
|
2425
|
+
this.call = changes['newIncomingCallData'].currentValue;
|
|
2426
|
+
this.call?.accept();
|
|
2427
|
+
this.callData.phone = this.call?.parameters['From'];
|
|
2428
|
+
this.callData.name = this.call?.customParameters.get('name');
|
|
2429
|
+
this.callData.img = this.call?.customParameters.get('image') || 'assets/images/user.jpg';
|
|
2430
|
+
this.incomingCallInitiated.emit();
|
|
2431
|
+
this.startTimer();
|
|
2432
|
+
}
|
|
2433
|
+
}
|
|
2434
|
+
}
|
|
2435
|
+
catch (e) {
|
|
2436
|
+
console.log(e);
|
|
2437
|
+
}
|
|
2438
|
+
}
|
|
2439
|
+
}
|
|
2440
|
+
ngAfterViewInit() { }
|
|
2441
|
+
async startCall(callData) {
|
|
2442
|
+
try {
|
|
2443
|
+
this.showRingAnimation = true;
|
|
2444
|
+
const payload = {
|
|
2445
|
+
channelId: environment.channelId,
|
|
2446
|
+
userId: localStorage.getItem('userId'),
|
|
2447
|
+
to: callData.phone,
|
|
2448
|
+
scope: 'local',
|
|
2449
|
+
fromNumber: callData.from
|
|
2450
|
+
};
|
|
2451
|
+
const response = await this.initiateCall(payload);
|
|
2452
|
+
if (response.status == 200) {
|
|
2453
|
+
const { id: callAuthId, recordCall } = await this.getCallAuthId(response);
|
|
2454
|
+
this.getUserInformation(callAuthId);
|
|
2455
|
+
this.recordCall = recordCall; // Store the recordCall value
|
|
2456
|
+
const tokenData = await this.getOutgoingCallToken(callAuthId);
|
|
2457
|
+
await this.connectToDevice(tokenData.token, callData);
|
|
2458
|
+
// Poll the status for 30-45 seconds
|
|
2459
|
+
this.pollCallStatus(callAuthId);
|
|
2460
|
+
}
|
|
2461
|
+
else if (response.status == 201) {
|
|
2462
|
+
swal("Error", response.message.join("<br/>"), "error");
|
|
2463
|
+
this.endCall();
|
|
2464
|
+
}
|
|
2465
|
+
}
|
|
2466
|
+
catch (error) {
|
|
2467
|
+
this.showRingAnimation = false;
|
|
2468
|
+
this.handleError(error);
|
|
2469
|
+
this.endCall();
|
|
2470
|
+
}
|
|
2471
|
+
}
|
|
2472
|
+
async initiateCall(payload) {
|
|
2473
|
+
return await this.extensionService.initiateCall(payload).toPromise();
|
|
2474
|
+
}
|
|
2475
|
+
async getCallAuthId(response) {
|
|
2476
|
+
return {
|
|
2477
|
+
id: response.callauth.id,
|
|
2478
|
+
recordCall: response.callauth.recordCall
|
|
2479
|
+
};
|
|
2480
|
+
}
|
|
2481
|
+
async getOutgoingCallToken(callAuthId) {
|
|
2482
|
+
return await this.extensionService.getOutgoingCallToken({ authId: callAuthId }).toPromise();
|
|
2483
|
+
}
|
|
2484
|
+
async connectToDevice(token, callData) {
|
|
2485
|
+
const options = {
|
|
2486
|
+
codecPreferences: ['opus', 'pcmu'],
|
|
2487
|
+
closeProtection: true,
|
|
2488
|
+
};
|
|
2489
|
+
this.device = new Device(token.value, options);
|
|
2490
|
+
this.call = await this.device.connect({
|
|
2491
|
+
params: {
|
|
2492
|
+
From: callData.from,
|
|
2493
|
+
To: callData.phone,
|
|
2494
|
+
Env: environment.abb,
|
|
2495
|
+
Token: token.id,
|
|
2496
|
+
Ext: callData.extNum
|
|
2497
|
+
},
|
|
2498
|
+
rtcConstraints: { audio: { deviceId: 'default' } },
|
|
2499
|
+
});
|
|
2500
|
+
this.setupEventListeners();
|
|
2501
|
+
}
|
|
2502
|
+
setupEventListeners() {
|
|
2503
|
+
this.startTimer();
|
|
2504
|
+
this.device?.on('error', (err) => {
|
|
2505
|
+
console.log(err);
|
|
2506
|
+
this.showRingAnimation = false;
|
|
2507
|
+
this.stopTimer();
|
|
2508
|
+
});
|
|
2509
|
+
this.call?.on('error', (error) => {
|
|
2510
|
+
this.showRingAnimation = false;
|
|
2511
|
+
this.stopTimer();
|
|
2512
|
+
});
|
|
2513
|
+
this.call?.on('disconnect', () => {
|
|
2514
|
+
this.endCall();
|
|
2515
|
+
});
|
|
2516
|
+
this.call?.on('ringing', () => {
|
|
2517
|
+
});
|
|
2518
|
+
this.call?.on('reject', () => {
|
|
2519
|
+
this.endCall();
|
|
2520
|
+
});
|
|
2521
|
+
this.call?.on('accept', () => {
|
|
2522
|
+
this.showRingAnimation = false;
|
|
2523
|
+
this.disbaleEndCallBtn = false;
|
|
2524
|
+
// Start recording if recordCall is true and call is accepted for 30 seconds
|
|
2525
|
+
// if (this.recordCall) {
|
|
2526
|
+
// setTimeout(() => {
|
|
2527
|
+
// if (this.isRecording) return; // If already recording, skip
|
|
2528
|
+
// this.startRecording();
|
|
2529
|
+
// }, 30000);
|
|
2530
|
+
// } else {
|
|
2531
|
+
// this.stopRecording();
|
|
2532
|
+
// }
|
|
2533
|
+
});
|
|
2534
|
+
this.call?.on('messageReceived', (message) => {
|
|
2535
|
+
});
|
|
2536
|
+
}
|
|
2537
|
+
startTimer() {
|
|
2538
|
+
let seconds = 0;
|
|
2539
|
+
this.intervalId = setInterval(() => {
|
|
2540
|
+
seconds++;
|
|
2541
|
+
this.timer = this.formatTime(seconds);
|
|
2542
|
+
}, 1000);
|
|
2543
|
+
}
|
|
2544
|
+
stopTimer() {
|
|
2545
|
+
clearInterval(this.intervalId);
|
|
2546
|
+
this.timer = '00:00';
|
|
2547
|
+
}
|
|
2548
|
+
formatTime(totalSeconds) {
|
|
2549
|
+
const minutes = Math.floor(totalSeconds / 60);
|
|
2550
|
+
const seconds = totalSeconds % 60;
|
|
2551
|
+
return `${this.pad(minutes)}:${this.pad(seconds)}`;
|
|
2552
|
+
}
|
|
2553
|
+
pad(value) {
|
|
2554
|
+
return value < 10 ? `0${value}` : `${value}`;
|
|
2555
|
+
}
|
|
2556
|
+
handleError(error) {
|
|
2557
|
+
swal("Error", error, "error");
|
|
2558
|
+
}
|
|
2559
|
+
endCall() {
|
|
2560
|
+
this.endCallEvent.emit();
|
|
2561
|
+
if (this.call) {
|
|
2562
|
+
this.call.disconnect();
|
|
2563
|
+
}
|
|
2564
|
+
this.showRingAnimation = false;
|
|
2565
|
+
this.stopTimer();
|
|
2566
|
+
this.maximiseDialpad();
|
|
2567
|
+
}
|
|
2568
|
+
toggleMute() {
|
|
2569
|
+
this.isMute = !this.isMute;
|
|
2570
|
+
this.call?.mute(this.isMute);
|
|
2571
|
+
}
|
|
2572
|
+
toggleKeypad() {
|
|
2573
|
+
this.showKeypad = !this.showKeypad;
|
|
2574
|
+
this.callInput = '';
|
|
2575
|
+
}
|
|
2576
|
+
onCallInputs(num) {
|
|
2577
|
+
try {
|
|
2578
|
+
if (Number.isInteger(num) || num == '+' || num == '*' || num == '#') {
|
|
2579
|
+
if (num == '#') {
|
|
2580
|
+
new Audio(`/assets/dial-tones/dtmf/dtmf-hash-.mp3`).play();
|
|
2581
|
+
}
|
|
2582
|
+
else if (num == '*') {
|
|
2583
|
+
new Audio(`/assets/dial-tones/dtmf/dtmf-star-.mp3`).play();
|
|
2584
|
+
}
|
|
2585
|
+
else {
|
|
2586
|
+
new Audio(`/assets/dial-tones/dtmf/dtmf-${num}-.mp3`).play();
|
|
2587
|
+
}
|
|
2588
|
+
this.callInput = this.callInput + String(num);
|
|
2589
|
+
this.showClearBtn = true;
|
|
2590
|
+
}
|
|
2591
|
+
let str = String(num);
|
|
2592
|
+
this.call?.sendDigits(str);
|
|
2593
|
+
}
|
|
2594
|
+
catch (e) {
|
|
2595
|
+
console.log(e);
|
|
2596
|
+
}
|
|
2597
|
+
}
|
|
2598
|
+
onCallInputEnter(ev) {
|
|
2599
|
+
try {
|
|
2600
|
+
this.call?.sendDigits(String(ev.key));
|
|
2601
|
+
}
|
|
2602
|
+
catch (e) {
|
|
2603
|
+
console.log(e);
|
|
2604
|
+
}
|
|
2605
|
+
}
|
|
2606
|
+
closeIncomingCall(data) {
|
|
2607
|
+
// this.incomingCallDiv = false;
|
|
2608
|
+
if (data.show) {
|
|
2609
|
+
//this.showCallProgressEvent.emit()
|
|
2610
|
+
// handle incoming call accepted
|
|
2611
|
+
this.startTimer();
|
|
2612
|
+
this.disbaleEndCallBtn = false;
|
|
2613
|
+
this.call = data.call;
|
|
2614
|
+
const incomingDetail = this.extensionService.getCallSid();
|
|
2615
|
+
this.incomingRecordCall = incomingDetail.recordCall;
|
|
2616
|
+
// Start recording if the call is answered and recording is enabled
|
|
2617
|
+
if (this.incomingRecordCall) {
|
|
2618
|
+
this.startRecording();
|
|
2619
|
+
}
|
|
2620
|
+
else {
|
|
2621
|
+
this.isRecording = false;
|
|
2622
|
+
}
|
|
2623
|
+
this.cdr.detectChanges();
|
|
2624
|
+
}
|
|
2625
|
+
else {
|
|
2626
|
+
// incoming call rejected
|
|
2627
|
+
this.endCallEvent.emit();
|
|
2628
|
+
}
|
|
2629
|
+
}
|
|
2630
|
+
clearInputs() {
|
|
2631
|
+
this.callInput = this.callInput.slice(0, -1);
|
|
2632
|
+
}
|
|
2633
|
+
minimiseDialpad() {
|
|
2634
|
+
this.minimiseEvent.emit(true);
|
|
2635
|
+
this.isMinimised = true;
|
|
2636
|
+
}
|
|
2637
|
+
maximiseDialpad() {
|
|
2638
|
+
this.minimiseEvent.emit(false);
|
|
2639
|
+
this.isMinimised = false;
|
|
2640
|
+
}
|
|
2641
|
+
toggleRecording() {
|
|
2642
|
+
if (this.isRecording) {
|
|
2643
|
+
this.stopRecording();
|
|
2644
|
+
}
|
|
2645
|
+
else {
|
|
2646
|
+
this.startRecording();
|
|
2647
|
+
}
|
|
2648
|
+
}
|
|
2649
|
+
startRecording() {
|
|
2650
|
+
let sid;
|
|
2651
|
+
const details = this.extensionService.getCallSid();
|
|
2652
|
+
this.incomingCallSid = details.callSid;
|
|
2653
|
+
this.incomingRecordCall = details.recordCall;
|
|
2654
|
+
sid = this.incomingCallSid ? this.incomingCallSid : this.callSid;
|
|
2655
|
+
// if (!this.incomingRecordCall && !this.recordCall) {
|
|
2656
|
+
// return;
|
|
2657
|
+
// }
|
|
2658
|
+
this.extensionService.getCallRecording(sid).subscribe(response => {
|
|
2659
|
+
this.isRecording = true;
|
|
2660
|
+
this.isPaused = false;
|
|
2661
|
+
this.timeElapsed = 0;
|
|
2662
|
+
this.startTimer1();
|
|
2663
|
+
}, error => {
|
|
2664
|
+
console.error('Error starting recording', error);
|
|
2665
|
+
});
|
|
2666
|
+
}
|
|
2667
|
+
stopRecording() {
|
|
2668
|
+
// if (!this.incomingRecordCall && !this.recordCall) {
|
|
2669
|
+
// return;
|
|
2670
|
+
// }
|
|
2671
|
+
this.isRecording = false;
|
|
2672
|
+
this.isPaused = false;
|
|
2673
|
+
if (this.timerSubscription) {
|
|
2674
|
+
this.timerSubscription.unsubscribe();
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
pauseRecording() {
|
|
2678
|
+
const details = this.extensionService.getCallSid();
|
|
2679
|
+
this.incomingCallSid = details.callSid;
|
|
2680
|
+
this.incomingRecordCall = details.recordCall;
|
|
2681
|
+
const sid = this.incomingCallSid ? this.incomingCallSid : this.callSid;
|
|
2682
|
+
// if (!this.incomingRecordCall && !this.recordCall) {
|
|
2683
|
+
// return;
|
|
2684
|
+
// }
|
|
2685
|
+
this.extensionService.pauseOrResumeRecording(sid, 'pause').subscribe(response => {
|
|
2686
|
+
this.stopRecordingTimer();
|
|
2687
|
+
this.isPaused = true;
|
|
2688
|
+
}, error => {
|
|
2689
|
+
console.error('Error pausing recording:', error);
|
|
2690
|
+
// Consider updating the UI to show the error state
|
|
2691
|
+
});
|
|
2692
|
+
}
|
|
2693
|
+
resumeRecording() {
|
|
2694
|
+
let sid;
|
|
2695
|
+
const details = this.extensionService.getCallSid();
|
|
2696
|
+
this.incomingCallSid = details.callSid;
|
|
2697
|
+
this.incomingRecordCall = details.recordCall;
|
|
2698
|
+
sid = this.incomingCallSid ? this.incomingCallSid : this.callSid;
|
|
2699
|
+
// if (!this.incomingRecordCall && !this.recordCall) {
|
|
2700
|
+
// return; // Skip if recording is not enabled
|
|
2701
|
+
// }
|
|
2702
|
+
this.extensionService.pauseOrResumeRecording(sid, 'resume').subscribe(response => {
|
|
2703
|
+
this.isPaused = false;
|
|
2704
|
+
this.startTimer1();
|
|
2705
|
+
}, error => {
|
|
2706
|
+
console.error('Error resuming recording', error);
|
|
2707
|
+
});
|
|
2708
|
+
}
|
|
2709
|
+
startTimer1() {
|
|
2710
|
+
this.timerSubscription = interval(1000).subscribe(() => {
|
|
2711
|
+
this.timeElapsed++;
|
|
2712
|
+
});
|
|
2713
|
+
}
|
|
2714
|
+
stopRecordingTimer() {
|
|
2715
|
+
if (this.timerSubscription) {
|
|
2716
|
+
this.timerSubscription.unsubscribe(); // Pause the timer
|
|
2717
|
+
this.timerSubscription = undefined; // Optionally reset the subscription
|
|
2718
|
+
}
|
|
2719
|
+
}
|
|
2720
|
+
getFormattedTime() {
|
|
2721
|
+
const minutes = Math.floor(this.timeElapsed / 60);
|
|
2722
|
+
const seconds = this.timeElapsed % 60;
|
|
2723
|
+
return `${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
|
|
2724
|
+
}
|
|
2725
|
+
pollCallStatus(callAuthId) {
|
|
2726
|
+
const maxTime = 30000; // Poll for up to 30 seconds
|
|
2727
|
+
const pollInterval = 3000; // Poll every 3 seconds
|
|
2728
|
+
let elapsedTime = 0;
|
|
2729
|
+
const intervalId = setInterval(async () => {
|
|
2730
|
+
elapsedTime += pollInterval;
|
|
2731
|
+
try {
|
|
2732
|
+
const statusResponse = await this.extensionService.getCallStatus(callAuthId).toPromise();
|
|
2733
|
+
if (statusResponse && statusResponse.callDetails) {
|
|
2734
|
+
this.callStatus = statusResponse.callDetails.callStatus;
|
|
2735
|
+
if (this.callStatus === 'in-progress') {
|
|
2736
|
+
this.callSid = statusResponse.callDetails.callSid;
|
|
2737
|
+
if (this.recordCall && !this.isRecording) {
|
|
2738
|
+
this.startRecording();
|
|
2739
|
+
}
|
|
2740
|
+
clearInterval(intervalId);
|
|
2741
|
+
}
|
|
2742
|
+
else if (this.callStatus === 'completed') {
|
|
2743
|
+
clearInterval(intervalId);
|
|
2744
|
+
this.endCall();
|
|
2745
|
+
this.stopRecording();
|
|
2746
|
+
}
|
|
2747
|
+
else if (this.callStatus === 'ringing') {
|
|
2748
|
+
// Continue polling; do not clear the interval yet
|
|
2749
|
+
}
|
|
2750
|
+
}
|
|
2751
|
+
}
|
|
2752
|
+
catch (error) {
|
|
2753
|
+
clearInterval(intervalId);
|
|
2754
|
+
}
|
|
2755
|
+
if (elapsedTime >= maxTime) {
|
|
2756
|
+
// console.log('Max polling time reached. Stopping poll.');
|
|
2757
|
+
clearInterval(intervalId);
|
|
2758
|
+
}
|
|
2759
|
+
}, pollInterval);
|
|
2760
|
+
}
|
|
2761
|
+
getUserInformation(id) {
|
|
2762
|
+
this.extensionService.getUserInformation(id).subscribe(response => {
|
|
2763
|
+
console.log(response);
|
|
2764
|
+
}, error => {
|
|
2765
|
+
console.error('Error starting recording', error);
|
|
2766
|
+
});
|
|
2767
|
+
}
|
|
2768
|
+
incomingCallsNewList(data) {
|
|
2769
|
+
this.newIncomingCallsList = data;
|
|
2770
|
+
this.incomingCallsNewInfo.emit(this.newIncomingCallsList);
|
|
2771
|
+
}
|
|
2772
|
+
selectedIncomingCallInfo(data) {
|
|
2773
|
+
this.selectedIncomingCall = data;
|
|
2774
|
+
}
|
|
2775
|
+
ngOnDestroy() {
|
|
2776
|
+
this.callData.dial = false;
|
|
2777
|
+
if (this.timerSubscription) {
|
|
2778
|
+
this.timerSubscription.unsubscribe();
|
|
2779
|
+
}
|
|
2780
|
+
}
|
|
2781
|
+
}
|
|
2782
|
+
CallProgressComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CallProgressComponent, deps: [{ token: ExtensionService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2783
|
+
CallProgressComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CallProgressComponent, selector: "lib-call-progress", inputs: { callData: "callData", newIncomingCallData: "newIncomingCallData", newIncomingCallsList: "newIncomingCallsList" }, outputs: { endCallEvent: "endCallEvent", incomingCallsNewInfo: "incomingCallsNewInfo", minimiseEvent: "minimiseEvent", incomingCallInitiated: "incomingCallInitiated" }, usesOnChanges: true, ngImport: i0, template: "<p>call-progress works!</p>\n", styles: [".call-container{width:385px;height:646px;margin:auto;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;box-sizing:border-box;position:relative;overflow:hidden;justify-content:center;align-items:center}.collops{height:660px!important}.incoming-call-container{width:752px!important}.call-animation{background:#fff;width:100px;height:100px;position:relative;margin:20px auto 0;border-radius:100%;border:solid 4px #fff;display:flex;align-items:center;justify-content:center}.call-animation:before{position:absolute;content:\"\";top:0;left:0;width:100%;height:100%;backface-visibility:hidden;border-radius:50%}.call-animation-play{animation:play 3s linear infinite}.call-info-wrapper{height:20px;overflow-y:auto;background:white;transition:height 1s}.open-collops{height:180px!important}.avatar-img{width:94px;height:94px;border-radius:100%}@keyframes play{0%{transform:scale(1)}15%{box-shadow:0 0 0 2px #fff6}25%{box-shadow:0 0 0 4px #fff6,0 0 0 8px #fff3}25%{box-shadow:0 0 0 8px #fff6,0 0 0 16px #fff3}50%{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3}to{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3;transform:scale(1.1);opacity:0}}.callerDetails{margin-top:8px;color:#fff;display:flex;flex-direction:column;align-items:center}.callerDetails h1{width:230px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:12px 0 0;color:#fff;text-transform:capitalize;text-align:center}.callerDetails h4{margin:0;color:#fff}.callerDetails p{margin-top:-3px;margin-bottom:0;color:#fff}.call-sec-btn{position:relative;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:25px;padding:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.call-sec-btn span{color:#cccbcb}.call-btn{width:60px;height:60px;background-color:#fff;border-radius:30px;box-sizing:border-box;border:2px solid white;margin:0 16px}.end-call-btn{background-color:#e14e4e}.end-call-btn span{color:#fff!important}.call-btn span{color:#234de8}.btn-container{display:flex;flex-wrap:wrap;padding:0 30px}.key-btn{width:50px;height:50px;background-color:transparent;text-align:center;box-sizing:border-box;margin:0 18px;font-size:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#d3d3d3;cursor:pointer;opacity:.8}.call-action-btns{text-align:center}#call-input{background-color:transparent;border:none;outline:none;text-align:center;color:#fff}.sendDigit{position:relative;text-align:center;width:80%;margin:auto;background-color:#ffffff1a;padding:2px 0;border-radius:3px}.input-clear-btn{position:absolute;right:6px;color:#fff;cursor:pointer}#minimize-btn-div{position:absolute;right:14px;top:12px;z-index:10}.minimize-btn{color:#fff;cursor:pointer}.wave-container{position:absolute;bottom:0}.waves{width:660px;position:relative;margin-bottom:-7px;height:40px;min-height:40px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}.animated-margin{transition:margin-top .5s ease}app-incoming-call{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:1001}.min-call-container{width:320px;height:124px;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;flex-direction:column;box-sizing:border-box;position:relative;overflow:hidden;margin:auto;align-items:center;padding:12px 16px;color:#fff}.min-call-animation{background:#fff;width:48px;height:48px;position:relative;margin:0 12px 0 auto;border-radius:100%;border:solid 2px #fff}.min-avatar-img{width:46px;height:46px;border-radius:100%;position:absolute;left:0;top:0}.min-callerDetails{color:#fff;display:flex;flex-direction:column;align-items:flex-start}.name{width:170px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:20px;margin:0;color:#fff}.min-callerDetails p{margin:0;color:#fff}.min-btn-container{position:relative;display:flex;width:100%;justify-content:flex-start;align-items:center;margin-top:6px}.min-call-sec-btn{width:40px;height:40px;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:20px;display:flex;align-items:center;justify-content:center;margin-right:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.min-call-sec-btn span{color:#cccbcb}.min-call-btn{width:40px;height:40px;border-radius:20px;box-sizing:border-box;border:2px solid white;display:flex;align-items:center;justify-content:center}.fullscreen{position:absolute;right:18px;top:14px;color:#e8e8e8;font-size:18px;cursor:pointer}.btn-container{display:flex;flex-wrap:wrap;padding:0 24px}.dial-btn{width:40px;height:40px;background-color:transparent;text-align:center;box-sizing:border-box;margin:4px 25px;font-size:24px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#b5b5b5;cursor:pointer}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.min-timer{width:50px;font-size:18px;margin-right:10px;border-radius:4px;height:35px;display:flex;align-items:center}.record-action-btns{display:flex;flex-direction:column;align-items:center}.record-btn-container{position:relative}.record-btn{border:none;border-radius:50%;width:50px;height:50px;display:flex;align-items:center;justify-content:center;cursor:pointer;margin:0 5px;position:relative;overflow:hidden}.record-btn.start-stop .recording-icon{width:50%;height:50%;border-radius:50%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.record-btn.start-stop.recording .recording-icon{background-color:#000}.record-btn.start-stop.recording{border:3px solid #000}.record-btn.start-stop.stopped .recording-icon{background-color:red;border:3px solid #ff0000;border-radius:50%;position:absolute}.record-btn.start-stop.stopped{border:3px solid #ff0000}.record-btn.start-stop.stopped .recording-icon{width:40%;height:40%;border-radius:0;background-color:red}.pause-resume-btns{display:flex;flex-direction:column;align-items:center;margin-top:10px}.record-btn.pause-resume{border:none;border-radius:50%;width:50px;height:50px;background:white;display:flex;align-items:center;justify-content:center;margin:5px 0}.record-btn.pause-resume .material-symbols-outlined{font-size:20px;color:#000}.timer-display{font-size:1.2em;margin-top:10px;color:#000}.w-40{width:40%}.w-60{width:60%}\n"] });
|
|
2784
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CallProgressComponent, decorators: [{
|
|
2785
|
+
type: Component,
|
|
2786
|
+
args: [{ selector: 'lib-call-progress', template: "<p>call-progress works!</p>\n", styles: [".call-container{width:385px;height:646px;margin:auto;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;box-sizing:border-box;position:relative;overflow:hidden;justify-content:center;align-items:center}.collops{height:660px!important}.incoming-call-container{width:752px!important}.call-animation{background:#fff;width:100px;height:100px;position:relative;margin:20px auto 0;border-radius:100%;border:solid 4px #fff;display:flex;align-items:center;justify-content:center}.call-animation:before{position:absolute;content:\"\";top:0;left:0;width:100%;height:100%;backface-visibility:hidden;border-radius:50%}.call-animation-play{animation:play 3s linear infinite}.call-info-wrapper{height:20px;overflow-y:auto;background:white;transition:height 1s}.open-collops{height:180px!important}.avatar-img{width:94px;height:94px;border-radius:100%}@keyframes play{0%{transform:scale(1)}15%{box-shadow:0 0 0 2px #fff6}25%{box-shadow:0 0 0 4px #fff6,0 0 0 8px #fff3}25%{box-shadow:0 0 0 8px #fff6,0 0 0 16px #fff3}50%{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3}to{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3;transform:scale(1.1);opacity:0}}.callerDetails{margin-top:8px;color:#fff;display:flex;flex-direction:column;align-items:center}.callerDetails h1{width:230px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:12px 0 0;color:#fff;text-transform:capitalize;text-align:center}.callerDetails h4{margin:0;color:#fff}.callerDetails p{margin-top:-3px;margin-bottom:0;color:#fff}.call-sec-btn{position:relative;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:25px;padding:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.call-sec-btn span{color:#cccbcb}.call-btn{width:60px;height:60px;background-color:#fff;border-radius:30px;box-sizing:border-box;border:2px solid white;margin:0 16px}.end-call-btn{background-color:#e14e4e}.end-call-btn span{color:#fff!important}.call-btn span{color:#234de8}.btn-container{display:flex;flex-wrap:wrap;padding:0 30px}.key-btn{width:50px;height:50px;background-color:transparent;text-align:center;box-sizing:border-box;margin:0 18px;font-size:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#d3d3d3;cursor:pointer;opacity:.8}.call-action-btns{text-align:center}#call-input{background-color:transparent;border:none;outline:none;text-align:center;color:#fff}.sendDigit{position:relative;text-align:center;width:80%;margin:auto;background-color:#ffffff1a;padding:2px 0;border-radius:3px}.input-clear-btn{position:absolute;right:6px;color:#fff;cursor:pointer}#minimize-btn-div{position:absolute;right:14px;top:12px;z-index:10}.minimize-btn{color:#fff;cursor:pointer}.wave-container{position:absolute;bottom:0}.waves{width:660px;position:relative;margin-bottom:-7px;height:40px;min-height:40px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}.animated-margin{transition:margin-top .5s ease}app-incoming-call{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:1001}.min-call-container{width:320px;height:124px;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;flex-direction:column;box-sizing:border-box;position:relative;overflow:hidden;margin:auto;align-items:center;padding:12px 16px;color:#fff}.min-call-animation{background:#fff;width:48px;height:48px;position:relative;margin:0 12px 0 auto;border-radius:100%;border:solid 2px #fff}.min-avatar-img{width:46px;height:46px;border-radius:100%;position:absolute;left:0;top:0}.min-callerDetails{color:#fff;display:flex;flex-direction:column;align-items:flex-start}.name{width:170px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:20px;margin:0;color:#fff}.min-callerDetails p{margin:0;color:#fff}.min-btn-container{position:relative;display:flex;width:100%;justify-content:flex-start;align-items:center;margin-top:6px}.min-call-sec-btn{width:40px;height:40px;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:20px;display:flex;align-items:center;justify-content:center;margin-right:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.min-call-sec-btn span{color:#cccbcb}.min-call-btn{width:40px;height:40px;border-radius:20px;box-sizing:border-box;border:2px solid white;display:flex;align-items:center;justify-content:center}.fullscreen{position:absolute;right:18px;top:14px;color:#e8e8e8;font-size:18px;cursor:pointer}.btn-container{display:flex;flex-wrap:wrap;padding:0 24px}.dial-btn{width:40px;height:40px;background-color:transparent;text-align:center;box-sizing:border-box;margin:4px 25px;font-size:24px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#b5b5b5;cursor:pointer}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.min-timer{width:50px;font-size:18px;margin-right:10px;border-radius:4px;height:35px;display:flex;align-items:center}.record-action-btns{display:flex;flex-direction:column;align-items:center}.record-btn-container{position:relative}.record-btn{border:none;border-radius:50%;width:50px;height:50px;display:flex;align-items:center;justify-content:center;cursor:pointer;margin:0 5px;position:relative;overflow:hidden}.record-btn.start-stop .recording-icon{width:50%;height:50%;border-radius:50%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.record-btn.start-stop.recording .recording-icon{background-color:#000}.record-btn.start-stop.recording{border:3px solid #000}.record-btn.start-stop.stopped .recording-icon{background-color:red;border:3px solid #ff0000;border-radius:50%;position:absolute}.record-btn.start-stop.stopped{border:3px solid #ff0000}.record-btn.start-stop.stopped .recording-icon{width:40%;height:40%;border-radius:0;background-color:red}.pause-resume-btns{display:flex;flex-direction:column;align-items:center;margin-top:10px}.record-btn.pause-resume{border:none;border-radius:50%;width:50px;height:50px;background:white;display:flex;align-items:center;justify-content:center;margin:5px 0}.record-btn.pause-resume .material-symbols-outlined{font-size:20px;color:#000}.timer-display{font-size:1.2em;margin-top:10px;color:#000}.w-40{width:40%}.w-60{width:60%}\n"] }]
|
|
2787
|
+
}], ctorParameters: function () { return [{ type: ExtensionService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { callData: [{
|
|
2788
|
+
type: Input
|
|
2789
|
+
}], newIncomingCallData: [{
|
|
2790
|
+
type: Input
|
|
2791
|
+
}], newIncomingCallsList: [{
|
|
2792
|
+
type: Input
|
|
2793
|
+
}], endCallEvent: [{
|
|
2794
|
+
type: Output
|
|
2795
|
+
}], incomingCallsNewInfo: [{
|
|
2796
|
+
type: Output
|
|
2797
|
+
}], minimiseEvent: [{
|
|
2798
|
+
type: Output
|
|
2799
|
+
}], incomingCallInitiated: [{
|
|
2800
|
+
type: Output
|
|
2801
|
+
}] } });
|
|
2802
|
+
|
|
2803
|
+
const GlobalConstant = {
|
|
2804
|
+
ErrorMsg500: "Unable to process request. Please try again later.",
|
|
2805
|
+
isSMSVisible: true,
|
|
2806
|
+
dedicatedNumText: 'C2C Number'
|
|
2807
|
+
};
|
|
2808
|
+
|
|
2809
|
+
class IncomingCallComponent {
|
|
2810
|
+
constructor(extensionService, twilioService) {
|
|
2811
|
+
this.extensionService = extensionService;
|
|
2812
|
+
this.twilioService = twilioService;
|
|
2813
|
+
this.showRingAnimation = true;
|
|
2814
|
+
this.selectedIncomingCall = {};
|
|
2815
|
+
this.twilioAuthId = '';
|
|
2816
|
+
this.dedicatedNum = '';
|
|
2817
|
+
this.recordCall = false;
|
|
2818
|
+
this.shouldRecordCall = false;
|
|
2819
|
+
this.isClickExpand = false;
|
|
2820
|
+
this.disbaleEndCallBtn = true;
|
|
2821
|
+
this.closeIncomingCallDiv = new EventEmitter();
|
|
2822
|
+
this.incomingCallsNewList = new EventEmitter();
|
|
2823
|
+
this.selectedIncomingCallInfo = new EventEmitter();
|
|
2824
|
+
this.isMute = false;
|
|
2825
|
+
}
|
|
2826
|
+
ngOnInit() {
|
|
2827
|
+
try {
|
|
2828
|
+
this.twilioService.currentCall.subscribe(call => {
|
|
2829
|
+
if (call) {
|
|
2830
|
+
this.twilioCallData = call;
|
|
2831
|
+
this.twilioAuthId = call.customParameters.get('twilioAuthId') || '';
|
|
2832
|
+
if (!call.parameters) {
|
|
2833
|
+
call.parameters = {};
|
|
2834
|
+
}
|
|
2835
|
+
this.sendIPforIncomingCall(this.twilioAuthId, '');
|
|
2836
|
+
call.on('cancel', () => {
|
|
2837
|
+
if (this.incomingCallData && this.incomingCallData.parameters && this.incomingCallData.parameters.CallSid) {
|
|
2838
|
+
this.newIncomingCallsList = this.newIncomingCallsList.filter((item) => item.parameters && item.parameters.CallSid !== this.incomingCallData.parameters.CallSid);
|
|
2839
|
+
}
|
|
2840
|
+
this.rejectCallFromList(call);
|
|
2841
|
+
});
|
|
2842
|
+
call.on('disconnect', () => {
|
|
2843
|
+
if (this.incomingCallData && this.incomingCallData.parameters && this.incomingCallData.parameters.CallSid) {
|
|
2844
|
+
this.newIncomingCallsList = this.newIncomingCallsList.filter((item) => item.parameters && item.parameters.CallSid !== this.incomingCallData.parameters.CallSid);
|
|
2845
|
+
}
|
|
2846
|
+
this.rejectCallFromList(call);
|
|
2847
|
+
});
|
|
2848
|
+
}
|
|
2849
|
+
});
|
|
2850
|
+
}
|
|
2851
|
+
catch (e) {
|
|
2852
|
+
console.log(e);
|
|
2853
|
+
}
|
|
2854
|
+
}
|
|
2855
|
+
acceptCallFromList(data) {
|
|
2856
|
+
console.log(data, 'checking dii');
|
|
2857
|
+
data.accept();
|
|
2858
|
+
// data.parameters['isCallConnected'] = true;
|
|
2859
|
+
data.isCallConnected = true;
|
|
2860
|
+
this.sendIPforIncomingCall(data.customParameters.get('twilioAuthId'), 'answered').then(() => {
|
|
2861
|
+
if (this.shouldRecordCall) { // default recording
|
|
2862
|
+
this.extensionService.setCallSid(this.CallSid, this.recordCall);
|
|
2863
|
+
this.closeIncomingCallWrapper(1);
|
|
2864
|
+
}
|
|
2865
|
+
else { // manual recording
|
|
2866
|
+
this.extensionService.setCallSid(this.CallSid, this.recordCall);
|
|
2867
|
+
this.closeIncomingCallWrapper(1);
|
|
2868
|
+
}
|
|
2869
|
+
});
|
|
2870
|
+
}
|
|
2871
|
+
rejectCallFromList(data) {
|
|
2872
|
+
if (!data)
|
|
2873
|
+
return;
|
|
2874
|
+
if (data.reject)
|
|
2875
|
+
data.reject();
|
|
2876
|
+
if (data.disconnect)
|
|
2877
|
+
data.disconnect();
|
|
2878
|
+
if (data.parameters) {
|
|
2879
|
+
data.parameters['isCallConnected'] = false; // Should be false when rejecting
|
|
2880
|
+
}
|
|
2881
|
+
if (data.customParameters) {
|
|
2882
|
+
this.sendIPforIncomingCall(data.customParameters.get('twilioAuthId'), 'answered');
|
|
2883
|
+
}
|
|
2884
|
+
if (this.newIncomingCallsList && data && data.parameters && data.parameters.CallSid) {
|
|
2885
|
+
this.newIncomingCallsList = this.newIncomingCallsList.filter((item) => item.parameters && item.parameters.CallSid !== data.parameters.CallSid);
|
|
2886
|
+
this.incomingCallsNewList.emit(this.newIncomingCallsList);
|
|
2887
|
+
if (this.newIncomingCallsList.length == 0) {
|
|
2888
|
+
this.closeIncomingCallDiv.emit({ show: 0, call: data });
|
|
2889
|
+
}
|
|
2890
|
+
}
|
|
2891
|
+
}
|
|
2892
|
+
closeIncomingCallWrapper(val) {
|
|
2893
|
+
this.closeIncomingCallDiv.emit({ show: val, call: this.twilioCallData });
|
|
2894
|
+
}
|
|
2895
|
+
toggleMute(data) {
|
|
2896
|
+
this.isMute = !this.isMute;
|
|
2897
|
+
data.mute(this.isMute);
|
|
2898
|
+
}
|
|
2899
|
+
sendIPforIncomingCall(recordId, callstatus) {
|
|
2900
|
+
return new Promise((resolve, reject) => {
|
|
2901
|
+
this.extensionService.getIPDetailsForCall(recordId, callstatus).subscribe((res) => {
|
|
2902
|
+
const resp = res;
|
|
2903
|
+
if (res.status == 200) {
|
|
2904
|
+
if (resp.callAuth) {
|
|
2905
|
+
this.CallSid = resp.callAuth.callSid;
|
|
2906
|
+
this.recordCall = resp.callAuth.recordCall;
|
|
2907
|
+
// Handle the recordCall flag
|
|
2908
|
+
if (resp.callAuth.recordCall) {
|
|
2909
|
+
this.shouldRecordCall = true;
|
|
2910
|
+
}
|
|
2911
|
+
else {
|
|
2912
|
+
this.shouldRecordCall = false;
|
|
2913
|
+
}
|
|
2914
|
+
}
|
|
2915
|
+
else {
|
|
2916
|
+
// swal("Error", "Missing call authentication details.", "error");
|
|
2917
|
+
}
|
|
2918
|
+
resolve();
|
|
2919
|
+
}
|
|
2920
|
+
else {
|
|
2921
|
+
swal("Error", resp.message.join("<br/>"), "error");
|
|
2922
|
+
resolve();
|
|
2923
|
+
}
|
|
2924
|
+
}, (error) => {
|
|
2925
|
+
swal("Error", GlobalConstant.ErrorMsg500, "error");
|
|
2926
|
+
resolve();
|
|
2927
|
+
});
|
|
2928
|
+
});
|
|
2929
|
+
}
|
|
2930
|
+
onUserInfoByCallSid() {
|
|
2931
|
+
if (this.selectedIncomingCall && this.selectedIncomingCall.userInfo) {
|
|
2932
|
+
}
|
|
2933
|
+
return this.selectedIncomingCall ? Object.keys(this.selectedIncomingCall).length ? true : false : false;
|
|
2934
|
+
}
|
|
2935
|
+
onClickExpand(data) {
|
|
2936
|
+
if (this.selectedIncomingCall === data && this.isClickExpand) {
|
|
2937
|
+
this.isClickExpand = false;
|
|
2938
|
+
this.selectedIncomingCall = null;
|
|
2939
|
+
this.selectedIncomingCallInfo.emit({});
|
|
2940
|
+
return;
|
|
2941
|
+
}
|
|
2942
|
+
this.isClickExpand = true;
|
|
2943
|
+
this.selectedIncomingCall = data;
|
|
2944
|
+
if (this.selectedIncomingCall) {
|
|
2945
|
+
this.selectedIncomingCall['isClickExpand'] = true;
|
|
2946
|
+
if (this.newIncomingCallsList && this.newIncomingCallsList.length > 0) {
|
|
2947
|
+
this.newIncomingCallsList.forEach((call) => {
|
|
2948
|
+
if (call !== this.selectedIncomingCall) {
|
|
2949
|
+
call['isClickExpand'] = false;
|
|
2950
|
+
}
|
|
2951
|
+
});
|
|
2952
|
+
}
|
|
2953
|
+
this.selectedIncomingCallInfo.emit(this.selectedIncomingCall);
|
|
2954
|
+
if (!this.selectedIncomingCall.userInfo || this.selectedIncomingCall.userInfo.status == 201) {
|
|
2955
|
+
this.getUserInformation(this.selectedIncomingCall);
|
|
2956
|
+
}
|
|
2957
|
+
}
|
|
2958
|
+
}
|
|
2959
|
+
getUserInformation(incomingCallData) {
|
|
2960
|
+
let data = this.fromEntries(Array.from(incomingCallData.customParameters.entries()));
|
|
2961
|
+
this.extensionService.getUserInformation(data['twilioAuthId']).subscribe(response => {
|
|
2962
|
+
setTimeout(() => {
|
|
2963
|
+
incomingCallData['userInfo'] = response;
|
|
2964
|
+
}, 5000);
|
|
2965
|
+
}, error => {
|
|
2966
|
+
console.error('Error starting recording', error);
|
|
2967
|
+
});
|
|
2968
|
+
}
|
|
2969
|
+
fromEntries(entries) {
|
|
2970
|
+
return entries.reduce((acc, [key, value]) => {
|
|
2971
|
+
acc[key] = value;
|
|
2972
|
+
return acc;
|
|
2973
|
+
}, {});
|
|
2974
|
+
}
|
|
2975
|
+
}
|
|
2976
|
+
IncomingCallComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IncomingCallComponent, deps: [{ token: ExtensionService }, { token: TwilioService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2977
|
+
IncomingCallComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: IncomingCallComponent, selector: "lib-incoming-call", inputs: { incomingCallData: "incomingCallData", newIncomingCallsList: "newIncomingCallsList" }, outputs: { closeIncomingCallDiv: "closeIncomingCallDiv", incomingCallsNewList: "incomingCallsNewList", selectedIncomingCallInfo: "selectedIncomingCallInfo" }, ngImport: i0, template: "<div class=\"call-container\" style=\"width: 100%;\" *ngIf=\"newIncomingCallsList.length > 0\">\n <div class=\"collops\">\n <div class=\"d-flex w-100\">\n <div class=\"d-flex flex-column container-fluid\">\n <div class=\"callToNum\">Incoming call <br/><span>{{dedicatedNum}}</span></div>\n <ng-container *ngFor=\"let data of newIncomingCallsList\">\n <div class=\"p-2 \">\n <div class=\"call-info-wrapper w-100 d-flex align-items-center\">\n <div class=\"img\">\n <img class=\"avatar-img-wrapper\" [src]=\"incomingCallData.img\" alt=\"\" width=\"45\" />\n </div>\n <div class=\"d-flex justify-content-between w-100 align-items-center mr-2\">\n <div class=\"callerDetails-wrapper\">\n <h5 class=\"break-word\">{{data?.userInfo?.c2cInformation?.name || '-'}}</h5>\n <p class=\"break-word\">{{data.userInfo?.displayNum ? data.userInfo?.c2cInformation.number : data.userInfo?.c2cInformation.number }}</p>\n </div> \n <div class=\"d-flex align-items-center\">\n <button class=\"call-btn-wrapper receive-btn\" [disabled]=\"!data?.parameters?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(data)\"> call </span>\n </button>\n <button class=\"call-btn-wrapper mute-btn\" *ngIf=\"data?.parameters?.isCallConnected\" [disabled]=\"disbaleEndCallBtn\" (click)=\"toggleMute(data)\" [ngClass]=\"{'active-mute': isMute}\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"call-btn-wrapper reject-btn\">\n <span class=\"material-symbols-outlined\" (click)=\"rejectCallFromList(data)\"> call_end </span>\n </button>\n <div class=\"togglearrow-arrow me-2\" id=\"togglearrow\" (click)=\"onClickExpand(data)\"><i class=\"fa fa-angle-right\"></i></div>\n </div>\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n <div class=\"call-container p-3 text-white model-content\" *ngIf=\"isClickExpand\"> \n <div class=\"mb-2\" style=\"width: 100%; height: 100%;\">\n <div class=\"call-animation\" [ngClass]=\"{'call-animation-play': showRingAnimation}\">\n <img class=\"avatar-img\" [src]=\"incomingCallData.img\" alt=\"\" width=\"100\" />\n </div>\n <div class=\"text-center\">\n <h3 class=\"text-white\">{{selectedIncomingCall?.userInfo?.c2cInformation?.name || '-'}}</h3>\n </div>\n <div class=\"f-13\">\n <div class=\"row mb-3\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Subject:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.subject || '-'}}</div>\n </div> \n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Email:</div>\n <div>{{selectedIncomingCall?.userInfo?.c2cInformation?.email || '-'}}</div>\n </div> \n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Number:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.number}}</div>\n </div>\n <div class=\"col-6\">\n <div class=\"\">Language:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.language || '-'}}</div>\n </div>\n </div>\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Extension:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.extension || '-'}}</div>\n </div>\n </div>\n\n <div class=\"row mb-3\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Image:</div>\n <div class=\"text-ellipsis\">\n <ng-container *ngIf=\"selectedIncomingCall?.userInfo?.c2cInformation?.image && selectedIncomingCall?.userInfo?.c2cInformation?.image !== '-'; else noImage\">\n <img src=\"{{selectedIncomingCall?.userInfo?.c2cInformation?.image}}\" alt=\"\" width=\"42\" height=\"42\" class=\"ml-2\"/>\n </ng-container>\n <ng-template #noImage>\n <span class=\"ml-2\">No Image Available</span>\n </ng-template>\n </div>\n </div> \n </div>\n\n <div class=\" mb-4\">\n <div class=\"\">\n <div class=\"\">Message:</div>\n <div class=\"text-ellipsis\">{{selectedIncomingCall?.userInfo?.c2cInformation?.message || '-'}}</div>\n </div>\n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Point Name:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.pointName || '-'}}</div>\n </div>\n <div class=\"col-6 mb-2\">\n <div class=\"\">Source Name:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.sourceName || '-'}}</div>\n </div>\n </div>\n </div>\n <div class=\"call-action-btns mt-0\">\n <button class=\"call-btn receive-btn\" *ngIf=\"!selectedIncomingCall?.parameters?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(selectedIncomingCall)\"> call </span>\n </button>\n <button class=\"call-btn mute-btn\" *ngIf=\"selectedIncomingCall?.parameters?.isCallConnected\" [disabled]=\"disbaleEndCallBtn\" (click)=\"toggleMute(selectedIncomingCall)\" [ngClass]=\"{'active-mute': isMute}\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"call-btn reject-btn\">\n <span class=\"material-symbols-outlined\" (click)=\"rejectCallFromList(selectedIncomingCall)\"> call_end </span>\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"wave-container\">\n <svg class=\"waves\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 24 150 28\" preserveAspectRatio=\"none\" shape-rendering=\"auto\" [ngStyle]=\"{'width': '756px'}\">\n <defs>\n <path id=\"gentle-wave\" d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\" />\n </defs>\n <g class=\"parallax\">\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"0\" fill=\"rgba(255,255,255,0.7)\" />\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"3\" fill=\"rgba(255,255,255,0.5)\" /> \n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\n </g>\n </svg>\n </div>\n</div>", styles: [".call-container{width:385px;height:646px;margin:auto;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;box-sizing:border-box;position:relative;overflow:hidden;justify-content:center;align-items:center}.collops{display:flex;flex-direction:column;width:100%;height:100%}.container-fluid{width:680px;height:100%;margin-top:10px}.model-content{background-color:#0d6efd;border-radius:20px;width:645px}.calls-side-by-side{position:fixed;top:0;width:30%;height:498px;z-index:1050;pointer-events:auto;display:flex;align-items:flex-start;left:-10rem;transform:translate(.2rem);transition:left 1s ease-in-out}.move{left:41vw!important}.f-13{font-size:13px!important}.call-animation{background:#fff;width:100px;height:100px;position:relative;margin:20px auto;border-radius:100%;border:solid 4px #fff}.call-animation:before{position:absolute;content:\"\";top:0;left:0;width:100%;height:100%;backface-visibility:hidden;border-radius:50%}.avatar-img-wrapper{border-radius:100%;margin:0 5px}.call-btn-wrapper{height:38px;background-color:#fff;border-radius:30px;margin:0 4px;opacity:.9;width:40px;span {color: white; line-height: unset !important;}}.hold-btn{background-color:#bebebe26;border:none}.hold-btn span,.mute-btn span{color:#fff!important}.active-hold{background-color:#fff!important}.active-hold span{color:#000!important}.active-mute{background-color:transparent}.call-info-wrapper{border:1px solid white;border-radius:7px;padding:8px 1px!important;word-break:break-all}.call-animation-play{animation:play 3s linear infinite}.avatar-img{width:94px;height:94px;border-radius:100%;position:absolute;left:0;top:0}@keyframes play{0%{transform:scale(1)}15%{box-shadow:0 0 0 2px #fff6}25%{box-shadow:0 0 0 4px #fff6,0 0 0 8px #fff3}25%{box-shadow:0 0 0 8px #fff6,0 0 0 16px #fff3}50%{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3}to{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3;transform:scale(1.1);opacity:0}}.callerDetails{margin-top:8px;color:#fff;display:flex;flex-direction:column;align-items:center}.callerDetails h1{margin:12px 0 0;color:#fff}.callerDetails-wrapper{margin:0 5px;color:#fff;display:flex;flex-direction:column}.callerDetails-wrapper h3,.callerDetails-wrapper h5{margin:0;color:#fff}.togglearrow-arrow{left:100%;background-color:#fff;width:25px;height:25px;text-align:center;cursor:pointer;border:1px solid #ccc;border-radius:50%;line-height:22px}.callerDetails h4{margin:0;color:#fff}.callerDetails p,.callerDetails-wrapper p{margin-top:-3px;margin-bottom:0;color:#fff}.call-sec-btn{position:relative;width:50px;height:50px;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:25px;padding:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.call-sec-btn span{color:#cccbcb}.call-btn{width:48px;height:45px;background-color:#fff;border-radius:30px;box-sizing:border-box;margin:0 8px;opacity:.9}.call-btn:hover{opacity:1}.call-btn span{color:#fff;line-height:unset!important}.receive-btn{background-color:#28a745;border:2px solid #28a745}.mute-btn{position:relative;border:none;background-color:#bebebe26}.reject-btn{background-color:#e03131;border:2px solid #e03131}.btn-container{display:flex;flex-wrap:wrap;padding:0 30px}.key-btn{width:50px;height:50px;background-color:transparent;text-align:center;box-sizing:border-box;margin:0 18px;font-size:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#d3d3d3;cursor:pointer;opacity:.8}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.call-action-btns{text-align:center;margin-top:240px}#call-input{background-color:transparent;border:none;outline:none;text-align:center;color:#fff}.wave-container{position:absolute;bottom:0}.waves{width:660px;position:relative;margin-bottom:-7px;height:40px;min-height:40px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}.animated-margin{transition:margin-top .5s ease}.callToNum{color:#fff;font-weight:400;text-align:center}.callToNum span{font-weight:600}.text-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;display:block}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
2978
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IncomingCallComponent, decorators: [{
|
|
2979
|
+
type: Component,
|
|
2980
|
+
args: [{ selector: 'lib-incoming-call', template: "<div class=\"call-container\" style=\"width: 100%;\" *ngIf=\"newIncomingCallsList.length > 0\">\n <div class=\"collops\">\n <div class=\"d-flex w-100\">\n <div class=\"d-flex flex-column container-fluid\">\n <div class=\"callToNum\">Incoming call <br/><span>{{dedicatedNum}}</span></div>\n <ng-container *ngFor=\"let data of newIncomingCallsList\">\n <div class=\"p-2 \">\n <div class=\"call-info-wrapper w-100 d-flex align-items-center\">\n <div class=\"img\">\n <img class=\"avatar-img-wrapper\" [src]=\"incomingCallData.img\" alt=\"\" width=\"45\" />\n </div>\n <div class=\"d-flex justify-content-between w-100 align-items-center mr-2\">\n <div class=\"callerDetails-wrapper\">\n <h5 class=\"break-word\">{{data?.userInfo?.c2cInformation?.name || '-'}}</h5>\n <p class=\"break-word\">{{data.userInfo?.displayNum ? data.userInfo?.c2cInformation.number : data.userInfo?.c2cInformation.number }}</p>\n </div> \n <div class=\"d-flex align-items-center\">\n <button class=\"call-btn-wrapper receive-btn\" [disabled]=\"!data?.parameters?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(data)\"> call </span>\n </button>\n <button class=\"call-btn-wrapper mute-btn\" *ngIf=\"data?.parameters?.isCallConnected\" [disabled]=\"disbaleEndCallBtn\" (click)=\"toggleMute(data)\" [ngClass]=\"{'active-mute': isMute}\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"call-btn-wrapper reject-btn\">\n <span class=\"material-symbols-outlined\" (click)=\"rejectCallFromList(data)\"> call_end </span>\n </button>\n <div class=\"togglearrow-arrow me-2\" id=\"togglearrow\" (click)=\"onClickExpand(data)\"><i class=\"fa fa-angle-right\"></i></div>\n </div>\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n <div class=\"call-container p-3 text-white model-content\" *ngIf=\"isClickExpand\"> \n <div class=\"mb-2\" style=\"width: 100%; height: 100%;\">\n <div class=\"call-animation\" [ngClass]=\"{'call-animation-play': showRingAnimation}\">\n <img class=\"avatar-img\" [src]=\"incomingCallData.img\" alt=\"\" width=\"100\" />\n </div>\n <div class=\"text-center\">\n <h3 class=\"text-white\">{{selectedIncomingCall?.userInfo?.c2cInformation?.name || '-'}}</h3>\n </div>\n <div class=\"f-13\">\n <div class=\"row mb-3\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Subject:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.subject || '-'}}</div>\n </div> \n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Email:</div>\n <div>{{selectedIncomingCall?.userInfo?.c2cInformation?.email || '-'}}</div>\n </div> \n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Number:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.number}}</div>\n </div>\n <div class=\"col-6\">\n <div class=\"\">Language:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.language || '-'}}</div>\n </div>\n </div>\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Extension:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.extension || '-'}}</div>\n </div>\n </div>\n\n <div class=\"row mb-3\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Image:</div>\n <div class=\"text-ellipsis\">\n <ng-container *ngIf=\"selectedIncomingCall?.userInfo?.c2cInformation?.image && selectedIncomingCall?.userInfo?.c2cInformation?.image !== '-'; else noImage\">\n <img src=\"{{selectedIncomingCall?.userInfo?.c2cInformation?.image}}\" alt=\"\" width=\"42\" height=\"42\" class=\"ml-2\"/>\n </ng-container>\n <ng-template #noImage>\n <span class=\"ml-2\">No Image Available</span>\n </ng-template>\n </div>\n </div> \n </div>\n\n <div class=\" mb-4\">\n <div class=\"\">\n <div class=\"\">Message:</div>\n <div class=\"text-ellipsis\">{{selectedIncomingCall?.userInfo?.c2cInformation?.message || '-'}}</div>\n </div>\n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Point Name:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.pointName || '-'}}</div>\n </div>\n <div class=\"col-6 mb-2\">\n <div class=\"\">Source Name:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.sourceName || '-'}}</div>\n </div>\n </div>\n </div>\n <div class=\"call-action-btns mt-0\">\n <button class=\"call-btn receive-btn\" *ngIf=\"!selectedIncomingCall?.parameters?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(selectedIncomingCall)\"> call </span>\n </button>\n <button class=\"call-btn mute-btn\" *ngIf=\"selectedIncomingCall?.parameters?.isCallConnected\" [disabled]=\"disbaleEndCallBtn\" (click)=\"toggleMute(selectedIncomingCall)\" [ngClass]=\"{'active-mute': isMute}\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"call-btn reject-btn\">\n <span class=\"material-symbols-outlined\" (click)=\"rejectCallFromList(selectedIncomingCall)\"> call_end </span>\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"wave-container\">\n <svg class=\"waves\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 24 150 28\" preserveAspectRatio=\"none\" shape-rendering=\"auto\" [ngStyle]=\"{'width': '756px'}\">\n <defs>\n <path id=\"gentle-wave\" d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\" />\n </defs>\n <g class=\"parallax\">\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"0\" fill=\"rgba(255,255,255,0.7)\" />\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"3\" fill=\"rgba(255,255,255,0.5)\" /> \n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\n </g>\n </svg>\n </div>\n</div>", styles: [".call-container{width:385px;height:646px;margin:auto;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;box-sizing:border-box;position:relative;overflow:hidden;justify-content:center;align-items:center}.collops{display:flex;flex-direction:column;width:100%;height:100%}.container-fluid{width:680px;height:100%;margin-top:10px}.model-content{background-color:#0d6efd;border-radius:20px;width:645px}.calls-side-by-side{position:fixed;top:0;width:30%;height:498px;z-index:1050;pointer-events:auto;display:flex;align-items:flex-start;left:-10rem;transform:translate(.2rem);transition:left 1s ease-in-out}.move{left:41vw!important}.f-13{font-size:13px!important}.call-animation{background:#fff;width:100px;height:100px;position:relative;margin:20px auto;border-radius:100%;border:solid 4px #fff}.call-animation:before{position:absolute;content:\"\";top:0;left:0;width:100%;height:100%;backface-visibility:hidden;border-radius:50%}.avatar-img-wrapper{border-radius:100%;margin:0 5px}.call-btn-wrapper{height:38px;background-color:#fff;border-radius:30px;margin:0 4px;opacity:.9;width:40px;span {color: white; line-height: unset !important;}}.hold-btn{background-color:#bebebe26;border:none}.hold-btn span,.mute-btn span{color:#fff!important}.active-hold{background-color:#fff!important}.active-hold span{color:#000!important}.active-mute{background-color:transparent}.call-info-wrapper{border:1px solid white;border-radius:7px;padding:8px 1px!important;word-break:break-all}.call-animation-play{animation:play 3s linear infinite}.avatar-img{width:94px;height:94px;border-radius:100%;position:absolute;left:0;top:0}@keyframes play{0%{transform:scale(1)}15%{box-shadow:0 0 0 2px #fff6}25%{box-shadow:0 0 0 4px #fff6,0 0 0 8px #fff3}25%{box-shadow:0 0 0 8px #fff6,0 0 0 16px #fff3}50%{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3}to{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3;transform:scale(1.1);opacity:0}}.callerDetails{margin-top:8px;color:#fff;display:flex;flex-direction:column;align-items:center}.callerDetails h1{margin:12px 0 0;color:#fff}.callerDetails-wrapper{margin:0 5px;color:#fff;display:flex;flex-direction:column}.callerDetails-wrapper h3,.callerDetails-wrapper h5{margin:0;color:#fff}.togglearrow-arrow{left:100%;background-color:#fff;width:25px;height:25px;text-align:center;cursor:pointer;border:1px solid #ccc;border-radius:50%;line-height:22px}.callerDetails h4{margin:0;color:#fff}.callerDetails p,.callerDetails-wrapper p{margin-top:-3px;margin-bottom:0;color:#fff}.call-sec-btn{position:relative;width:50px;height:50px;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:25px;padding:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.call-sec-btn span{color:#cccbcb}.call-btn{width:48px;height:45px;background-color:#fff;border-radius:30px;box-sizing:border-box;margin:0 8px;opacity:.9}.call-btn:hover{opacity:1}.call-btn span{color:#fff;line-height:unset!important}.receive-btn{background-color:#28a745;border:2px solid #28a745}.mute-btn{position:relative;border:none;background-color:#bebebe26}.reject-btn{background-color:#e03131;border:2px solid #e03131}.btn-container{display:flex;flex-wrap:wrap;padding:0 30px}.key-btn{width:50px;height:50px;background-color:transparent;text-align:center;box-sizing:border-box;margin:0 18px;font-size:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#d3d3d3;cursor:pointer;opacity:.8}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.call-action-btns{text-align:center;margin-top:240px}#call-input{background-color:transparent;border:none;outline:none;text-align:center;color:#fff}.wave-container{position:absolute;bottom:0}.waves{width:660px;position:relative;margin-bottom:-7px;height:40px;min-height:40px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}.animated-margin{transition:margin-top .5s ease}.callToNum{color:#fff;font-weight:400;text-align:center}.callToNum span{font-weight:600}.text-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;display:block}\n"] }]
|
|
2981
|
+
}], ctorParameters: function () { return [{ type: ExtensionService }, { type: TwilioService }]; }, propDecorators: { incomingCallData: [{
|
|
2982
|
+
type: Input
|
|
2983
|
+
}], newIncomingCallsList: [{
|
|
2984
|
+
type: Input
|
|
2985
|
+
}], closeIncomingCallDiv: [{
|
|
2986
|
+
type: Output
|
|
2987
|
+
}], incomingCallsNewList: [{
|
|
2988
|
+
type: Output
|
|
2989
|
+
}], selectedIncomingCallInfo: [{
|
|
2990
|
+
type: Output
|
|
2991
|
+
}] } });
|
|
2992
|
+
|
|
2993
|
+
class CallerIdDialogComponent {
|
|
2994
|
+
constructor(router, twilServ, dialogRef, data) {
|
|
2995
|
+
this.router = router;
|
|
2996
|
+
this.twilServ = twilServ;
|
|
2997
|
+
this.dialogRef = dialogRef;
|
|
2998
|
+
this.data = data;
|
|
2999
|
+
this.storedTheme = localStorage.getItem('theme-color') || 'blue';
|
|
3000
|
+
this.alertToggle = true;
|
|
3001
|
+
this.token = '';
|
|
3002
|
+
}
|
|
3003
|
+
ngOnInit() {
|
|
3004
|
+
this.alertToggle = (localStorage.getItem('alertToggle') == 'true') ? true : false;
|
|
3005
|
+
this.token = localStorage.getItem('ext_token') || '';
|
|
3006
|
+
}
|
|
3007
|
+
onConfirm() {
|
|
3008
|
+
this.dialogRef.close(true);
|
|
3009
|
+
}
|
|
3010
|
+
onCancel() {
|
|
3011
|
+
this.dialogRef.close(false);
|
|
3012
|
+
}
|
|
3013
|
+
redirectToCallingPreference() {
|
|
3014
|
+
this.router.navigateByUrl('/extension/caller-id/' + this.token);
|
|
3015
|
+
this.dialogRef.close({ event: 'redirect', alertToggle: this.alertToggle });
|
|
3016
|
+
}
|
|
3017
|
+
proceed() {
|
|
3018
|
+
this.dialogRef.close({ event: 'proceed', alertToggle: this.alertToggle });
|
|
3019
|
+
}
|
|
3020
|
+
closeModal() {
|
|
3021
|
+
this.dialogRef.close();
|
|
3022
|
+
}
|
|
3023
|
+
hideMessage(ev) {
|
|
3024
|
+
this.twilServ.toggleCallerIdAlert.next(ev.target.checked);
|
|
3025
|
+
let val = ev.target.checked ? 'true' : 'false';
|
|
3026
|
+
localStorage.setItem('isAlertEnable', val);
|
|
3027
|
+
}
|
|
3028
|
+
}
|
|
3029
|
+
CallerIdDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CallerIdDialogComponent, deps: [{ token: i4.Router }, { token: TwilioService }, { token: i3.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
3030
|
+
CallerIdDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CallerIdDialogComponent, selector: "lib-caller-id-dialog", ngImport: i0, template: "<!-- <div class=\"main-theme {{storedTheme}}\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\"> Caller ID Not Set</h5>\n <button class=\"close\" (click)=\"closeModal()\">\n <span>x</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <p class=\"mb-1\"><strong>There is no caller ID set in your account</strong> <br /></p>\n <p>The receiver will not be able to identify your call or call you back</p>\n <div class=\"d-flex align-items-center justify-content-center\">\n <input type=\"checkbox\" checked (change)=\"hideMessage($event)\" [(ngModel)]=\"alertToggle\" class=\"mr-2\">\n <label for=\"\" class=\"mb-0 text-muted\">I do not want to see this message again</label>\n </div>\n <button class=\"btn btn-black-outline\" (click)=\"doNotShowAgain()\">Do not show this message again</button>\n </div>\n <div class=\"modal-footer border-top d-flex justify-content-between\">\n <button class=\"btn btn-black-outline\" (click)=\"redirectToCallingPreference()\">Click to set caller ID</button>\n \n <button class=\"btn btn-blue ms-2\" (click)=\"proceed()\">Proceed without Caller ID</button>\n </div>\n</div> -->", styles: [""] });
|
|
3031
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CallerIdDialogComponent, decorators: [{
|
|
3032
|
+
type: Component,
|
|
3033
|
+
args: [{ selector: 'lib-caller-id-dialog', template: "<!-- <div class=\"main-theme {{storedTheme}}\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\"> Caller ID Not Set</h5>\n <button class=\"close\" (click)=\"closeModal()\">\n <span>x</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <p class=\"mb-1\"><strong>There is no caller ID set in your account</strong> <br /></p>\n <p>The receiver will not be able to identify your call or call you back</p>\n <div class=\"d-flex align-items-center justify-content-center\">\n <input type=\"checkbox\" checked (change)=\"hideMessage($event)\" [(ngModel)]=\"alertToggle\" class=\"mr-2\">\n <label for=\"\" class=\"mb-0 text-muted\">I do not want to see this message again</label>\n </div>\n <button class=\"btn btn-black-outline\" (click)=\"doNotShowAgain()\">Do not show this message again</button>\n </div>\n <div class=\"modal-footer border-top d-flex justify-content-between\">\n <button class=\"btn btn-black-outline\" (click)=\"redirectToCallingPreference()\">Click to set caller ID</button>\n \n <button class=\"btn btn-blue ms-2\" (click)=\"proceed()\">Proceed without Caller ID</button>\n </div>\n</div> -->" }]
|
|
3034
|
+
}], ctorParameters: function () { return [{ type: i4.Router }, { type: TwilioService }, { type: i3.MatDialogRef }, { type: undefined, decorators: [{
|
|
3035
|
+
type: Inject,
|
|
3036
|
+
args: [MAT_DIALOG_DATA]
|
|
3037
|
+
}] }]; } });
|
|
3038
|
+
|
|
2374
3039
|
class DialboxModule {
|
|
2375
3040
|
}
|
|
2376
3041
|
DialboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DialboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2377
|
-
DialboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: DialboxModule, declarations: [DialboxComponent
|
|
3042
|
+
DialboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: DialboxModule, declarations: [DialboxComponent,
|
|
3043
|
+
CallProgressComponent,
|
|
3044
|
+
CallerIdDialogComponent,
|
|
3045
|
+
IncomingCallComponent], imports: [CommonModule,
|
|
2378
3046
|
FormsModule,
|
|
2379
3047
|
ReactiveFormsModule,
|
|
2380
3048
|
HttpClientModule,
|
|
2381
|
-
RouterLink], exports: [DialboxComponent
|
|
3049
|
+
RouterLink], exports: [DialboxComponent,
|
|
3050
|
+
CallProgressComponent,
|
|
3051
|
+
CallerIdDialogComponent,
|
|
3052
|
+
IncomingCallComponent] });
|
|
2382
3053
|
DialboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DialboxModule, imports: [CommonModule,
|
|
2383
3054
|
FormsModule,
|
|
2384
3055
|
ReactiveFormsModule,
|
|
@@ -2388,6 +3059,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2388
3059
|
args: [{
|
|
2389
3060
|
declarations: [
|
|
2390
3061
|
DialboxComponent,
|
|
3062
|
+
CallProgressComponent,
|
|
3063
|
+
CallerIdDialogComponent,
|
|
3064
|
+
IncomingCallComponent,
|
|
2391
3065
|
],
|
|
2392
3066
|
imports: [
|
|
2393
3067
|
CommonModule,
|
|
@@ -2398,6 +3072,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2398
3072
|
],
|
|
2399
3073
|
exports: [
|
|
2400
3074
|
DialboxComponent,
|
|
3075
|
+
CallProgressComponent,
|
|
3076
|
+
CallerIdDialogComponent,
|
|
3077
|
+
IncomingCallComponent,
|
|
2401
3078
|
]
|
|
2402
3079
|
}]
|
|
2403
3080
|
}] });
|
|
@@ -2405,7 +3082,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2405
3082
|
/*
|
|
2406
3083
|
* Public API Surface of dialbox
|
|
2407
3084
|
*/
|
|
2408
|
-
// Components
|
|
2409
3085
|
// export * from './lib/components/dialpad/dialpad.component';
|
|
2410
3086
|
// export * from './lib/components/dial-button/dial-button.component';
|
|
2411
3087
|
// // Services
|
|
@@ -2424,5 +3100,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2424
3100
|
* Generated bundle index. Do not edit.
|
|
2425
3101
|
*/
|
|
2426
3102
|
|
|
2427
|
-
export { DialboxComponent, DialboxModule };
|
|
3103
|
+
export { CallProgressComponent, CallerIdDialogComponent, DialboxComponent, DialboxModule, IncomingCallComponent };
|
|
2428
3104
|
//# sourceMappingURL=vgroup-dialbox.mjs.map
|