@vgroup/dialbox 0.0.92 → 0.0.93
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.
|
@@ -2375,6 +2375,35 @@ class DialboxComponent {
|
|
|
2375
2375
|
// }
|
|
2376
2376
|
// }
|
|
2377
2377
|
ngOnInit() {
|
|
2378
|
+
if (this.incomingCallData) {
|
|
2379
|
+
if (this.isCallInProgress) {
|
|
2380
|
+
this.newIncomingCalls.push(this.incomingCallData);
|
|
2381
|
+
console.log('404', this.incomingCallData);
|
|
2382
|
+
this.getUserInformation(this.incomingCallData);
|
|
2383
|
+
}
|
|
2384
|
+
else {
|
|
2385
|
+
this.isCallInProgress = true;
|
|
2386
|
+
this.isDialpadHidden = false;
|
|
2387
|
+
this.callData.phone = this.incomingCallData.parameters['From'];
|
|
2388
|
+
console.log('411', this.incomingCallData);
|
|
2389
|
+
this.getUserInformation(this.incomingCallData);
|
|
2390
|
+
this.callData.name = this.incomingCallData.customParameters.get('name');
|
|
2391
|
+
this.callData.img = this.incomingCallData.customParameters.get('image') || 'assets/images/user.jpg';
|
|
2392
|
+
this.callData.isIncomingCall = true;
|
|
2393
|
+
}
|
|
2394
|
+
this.incomingCallData.on('cancel', () => {
|
|
2395
|
+
this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== this.incomingCallData.parameters['CallSid']);
|
|
2396
|
+
if (this.incomingCallsList.length == 0) {
|
|
2397
|
+
this.isCallInProgress = false;
|
|
2398
|
+
}
|
|
2399
|
+
});
|
|
2400
|
+
this.incomingCallData.on('disconnect', () => {
|
|
2401
|
+
this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== this.incomingCallData.parameters['CallSid']);
|
|
2402
|
+
if (this.incomingCallsList.length == 0) {
|
|
2403
|
+
this.isCallInProgress = false;
|
|
2404
|
+
}
|
|
2405
|
+
});
|
|
2406
|
+
}
|
|
2378
2407
|
try {
|
|
2379
2408
|
this.token = localStorage.getItem('ext_token') || '';
|
|
2380
2409
|
//this.isCallInProgress = true;
|
|
@@ -2481,37 +2510,6 @@ class DialboxComponent {
|
|
|
2481
2510
|
catch (e) {
|
|
2482
2511
|
console.log(e);
|
|
2483
2512
|
}
|
|
2484
|
-
if (this.incomingCallData) {
|
|
2485
|
-
// this.isCallInProgress = true;
|
|
2486
|
-
// this.isDialpadHidden = false; // Show dialpad on incoming call
|
|
2487
|
-
if (this.isCallInProgress) {
|
|
2488
|
-
this.newIncomingCalls.push(this.incomingCallData);
|
|
2489
|
-
console.log('404', this.incomingCallData);
|
|
2490
|
-
this.getUserInformation(this.incomingCallData);
|
|
2491
|
-
}
|
|
2492
|
-
else {
|
|
2493
|
-
this.isCallInProgress = true;
|
|
2494
|
-
this.isDialpadHidden = false;
|
|
2495
|
-
this.callData.phone = this.incomingCallData.parameters['From'];
|
|
2496
|
-
console.log('411', this.incomingCallData);
|
|
2497
|
-
this.getUserInformation(this.incomingCallData);
|
|
2498
|
-
this.callData.name = this.incomingCallData.customParameters.get('name');
|
|
2499
|
-
this.callData.img = this.incomingCallData.customParameters.get('image') || 'assets/images/user.jpg';
|
|
2500
|
-
this.callData.isIncomingCall = true;
|
|
2501
|
-
}
|
|
2502
|
-
this.incomingCallData.on('cancel', () => {
|
|
2503
|
-
this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== this.incomingCallData.parameters['CallSid']);
|
|
2504
|
-
if (this.incomingCallsList.length == 0) {
|
|
2505
|
-
this.isCallInProgress = false;
|
|
2506
|
-
}
|
|
2507
|
-
});
|
|
2508
|
-
this.incomingCallData.on('disconnect', () => {
|
|
2509
|
-
this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== this.incomingCallData.parameters['CallSid']);
|
|
2510
|
-
if (this.incomingCallsList.length == 0) {
|
|
2511
|
-
this.isCallInProgress = false;
|
|
2512
|
-
}
|
|
2513
|
-
});
|
|
2514
|
-
}
|
|
2515
2513
|
}
|
|
2516
2514
|
getUserInformation(incomingCallData) {
|
|
2517
2515
|
// console.log('getUserInformation', incomingCallData);
|