@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.
|
@@ -2359,6 +2359,35 @@ class DialboxComponent {
|
|
|
2359
2359
|
// }
|
|
2360
2360
|
// }
|
|
2361
2361
|
ngOnInit() {
|
|
2362
|
+
if (this.incomingCallData) {
|
|
2363
|
+
if (this.isCallInProgress) {
|
|
2364
|
+
this.newIncomingCalls.push(this.incomingCallData);
|
|
2365
|
+
console.log('404', this.incomingCallData);
|
|
2366
|
+
this.getUserInformation(this.incomingCallData);
|
|
2367
|
+
}
|
|
2368
|
+
else {
|
|
2369
|
+
this.isCallInProgress = true;
|
|
2370
|
+
this.isDialpadHidden = false;
|
|
2371
|
+
this.callData.phone = this.incomingCallData.parameters['From'];
|
|
2372
|
+
console.log('411', this.incomingCallData);
|
|
2373
|
+
this.getUserInformation(this.incomingCallData);
|
|
2374
|
+
this.callData.name = this.incomingCallData.customParameters.get('name');
|
|
2375
|
+
this.callData.img = this.incomingCallData.customParameters.get('image') || 'assets/images/user.jpg';
|
|
2376
|
+
this.callData.isIncomingCall = true;
|
|
2377
|
+
}
|
|
2378
|
+
this.incomingCallData.on('cancel', () => {
|
|
2379
|
+
this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== this.incomingCallData.parameters['CallSid']);
|
|
2380
|
+
if (this.incomingCallsList.length == 0) {
|
|
2381
|
+
this.isCallInProgress = false;
|
|
2382
|
+
}
|
|
2383
|
+
});
|
|
2384
|
+
this.incomingCallData.on('disconnect', () => {
|
|
2385
|
+
this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== this.incomingCallData.parameters['CallSid']);
|
|
2386
|
+
if (this.incomingCallsList.length == 0) {
|
|
2387
|
+
this.isCallInProgress = false;
|
|
2388
|
+
}
|
|
2389
|
+
});
|
|
2390
|
+
}
|
|
2362
2391
|
try {
|
|
2363
2392
|
this.token = localStorage.getItem('ext_token') || '';
|
|
2364
2393
|
//this.isCallInProgress = true;
|
|
@@ -2465,37 +2494,6 @@ class DialboxComponent {
|
|
|
2465
2494
|
catch (e) {
|
|
2466
2495
|
console.log(e);
|
|
2467
2496
|
}
|
|
2468
|
-
if (this.incomingCallData) {
|
|
2469
|
-
// this.isCallInProgress = true;
|
|
2470
|
-
// this.isDialpadHidden = false; // Show dialpad on incoming call
|
|
2471
|
-
if (this.isCallInProgress) {
|
|
2472
|
-
this.newIncomingCalls.push(this.incomingCallData);
|
|
2473
|
-
console.log('404', this.incomingCallData);
|
|
2474
|
-
this.getUserInformation(this.incomingCallData);
|
|
2475
|
-
}
|
|
2476
|
-
else {
|
|
2477
|
-
this.isCallInProgress = true;
|
|
2478
|
-
this.isDialpadHidden = false;
|
|
2479
|
-
this.callData.phone = this.incomingCallData.parameters['From'];
|
|
2480
|
-
console.log('411', this.incomingCallData);
|
|
2481
|
-
this.getUserInformation(this.incomingCallData);
|
|
2482
|
-
this.callData.name = this.incomingCallData.customParameters.get('name');
|
|
2483
|
-
this.callData.img = this.incomingCallData.customParameters.get('image') || 'assets/images/user.jpg';
|
|
2484
|
-
this.callData.isIncomingCall = true;
|
|
2485
|
-
}
|
|
2486
|
-
this.incomingCallData.on('cancel', () => {
|
|
2487
|
-
this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== this.incomingCallData.parameters['CallSid']);
|
|
2488
|
-
if (this.incomingCallsList.length == 0) {
|
|
2489
|
-
this.isCallInProgress = false;
|
|
2490
|
-
}
|
|
2491
|
-
});
|
|
2492
|
-
this.incomingCallData.on('disconnect', () => {
|
|
2493
|
-
this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== this.incomingCallData.parameters['CallSid']);
|
|
2494
|
-
if (this.incomingCallsList.length == 0) {
|
|
2495
|
-
this.isCallInProgress = false;
|
|
2496
|
-
}
|
|
2497
|
-
});
|
|
2498
|
-
}
|
|
2499
2497
|
}
|
|
2500
2498
|
getUserInformation(incomingCallData) {
|
|
2501
2499
|
// console.log('getUserInformation', incomingCallData);
|