@vgroup/dialbox 0.2.88 → 0.2.90
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.
|
@@ -3107,49 +3107,59 @@ class DialboxComponent {
|
|
|
3107
3107
|
// Ensure Twilio is initialized even when dialpad starts hidden,
|
|
3108
3108
|
// so we can auto-open on incoming calls.
|
|
3109
3109
|
this.initializeTwilio();
|
|
3110
|
+
this.incomeingCallSocketService.connect();
|
|
3110
3111
|
try {
|
|
3111
|
-
this.incomeingCallSocketService.connect();
|
|
3112
3112
|
this.incomeingCallSocketService.listen().subscribe((incomingCallData) => {
|
|
3113
|
+
const data = JSON.parse(incomingCallData.data);
|
|
3113
3114
|
console.log("WS Event Received:", incomingCallData);
|
|
3114
3115
|
console.log("WS Event Received:", incomingCallData.data);
|
|
3115
|
-
if (
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
this.getUserInformation(incomingCallData);
|
|
3124
|
-
}
|
|
3125
|
-
else {
|
|
3126
|
-
incomingCallData['isFirstCall'] = true;
|
|
3127
|
-
console.log('dd1');
|
|
3128
|
-
this.isCallInProgress = true;
|
|
3129
|
-
this.isDialpadHidden = false;
|
|
3130
|
-
this.callData.phone = incomingCallData.parameters['From'];
|
|
3131
|
-
console.log('dd2');
|
|
3132
|
-
this.getUserInformation(incomingCallData);
|
|
3133
|
-
this.callData.name = incomingCallData.customParameters.get('name');
|
|
3134
|
-
this.callData.img = incomingCallData.customParameters.get('image') || 'assets/images/user.jpg';
|
|
3135
|
-
this.callData.isIncomingCall = true;
|
|
3136
|
-
}
|
|
3137
|
-
incomingCallData.on('cancel', () => {
|
|
3138
|
-
this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== incomingCallData.parameters['CallSid']);
|
|
3139
|
-
// if(this.incomingCallsList.length == 0){
|
|
3140
|
-
// console.log('dd3')
|
|
3141
|
-
// this.isCallInProgress = false;
|
|
3142
|
-
// }
|
|
3143
|
-
});
|
|
3144
|
-
incomingCallData.on('disconnect', () => {
|
|
3145
|
-
this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== incomingCallData.parameters['CallSid']);
|
|
3146
|
-
// if(this.incomingCallsList.length == 0){
|
|
3147
|
-
// console.log('dd4')
|
|
3148
|
-
// this.isCallInProgress = false;
|
|
3149
|
-
// }
|
|
3150
|
-
});
|
|
3151
|
-
}
|
|
3116
|
+
if (data[0]) {
|
|
3117
|
+
// this.showIncomingCallPopup(incoming, data/
|
|
3118
|
+
this.isCallInProgress = true;
|
|
3119
|
+
this.isDialpadHidden = false;
|
|
3120
|
+
this.callData.phone = data[0].from;
|
|
3121
|
+
this.callData.name = "";
|
|
3122
|
+
this.callData.img = "assets/images/user.jpg";
|
|
3123
|
+
this.callData.isIncomingCall = true;
|
|
3152
3124
|
}
|
|
3125
|
+
// this.initializeTwilio();
|
|
3126
|
+
// if (incomingCallData.type === "/incoming/call") {
|
|
3127
|
+
// if (incomingCallData) {
|
|
3128
|
+
// if (this.autoOpenOnIncoming && this._isDialpadHidden) {
|
|
3129
|
+
// this._isDialpadHidden = false;
|
|
3130
|
+
// }
|
|
3131
|
+
// if (this.isCallInProgress) {
|
|
3132
|
+
// this.newIncomingCalls.push(incomingCallData);
|
|
3133
|
+
// console.log('325', incomingCallData)
|
|
3134
|
+
// this.getUserInformation(incomingCallData);
|
|
3135
|
+
// } else {
|
|
3136
|
+
// incomingCallData['isFirstCall'] = true;
|
|
3137
|
+
// console.log('dd1')
|
|
3138
|
+
// this.isCallInProgress = true;
|
|
3139
|
+
// this.isDialpadHidden = false;
|
|
3140
|
+
// this.callData.phone = incomingCallData.parameters['From'];
|
|
3141
|
+
// console.log('dd2')
|
|
3142
|
+
// this.getUserInformation(incomingCallData);
|
|
3143
|
+
// this.callData.name = incomingCallData.customParameters.get('name');
|
|
3144
|
+
// this.callData.img = incomingCallData.customParameters.get('image') || 'assets/images/user.jpg';
|
|
3145
|
+
// this.callData.isIncomingCall = true;
|
|
3146
|
+
// }
|
|
3147
|
+
// incomingCallData.on('cancel', () => {
|
|
3148
|
+
// this.incomingCallsList = this.incomingCallsList.filter((item: any) => item.parameters['CallSid'] !== incomingCallData.parameters['CallSid']);
|
|
3149
|
+
// // if(this.incomingCallsList.length == 0){
|
|
3150
|
+
// // console.log('dd3')
|
|
3151
|
+
// // this.isCallInProgress = false;
|
|
3152
|
+
// // }
|
|
3153
|
+
// });
|
|
3154
|
+
// incomingCallData.on('disconnect', () => {
|
|
3155
|
+
// this.incomingCallsList = this.incomingCallsList.filter((item: any) => item.parameters['CallSid'] !== incomingCallData.parameters['CallSid']);
|
|
3156
|
+
// // if(this.incomingCallsList.length == 0){
|
|
3157
|
+
// // console.log('dd4')
|
|
3158
|
+
// // this.isCallInProgress = false;
|
|
3159
|
+
// // }
|
|
3160
|
+
// });
|
|
3161
|
+
// }
|
|
3162
|
+
// }
|
|
3153
3163
|
});
|
|
3154
3164
|
this.token = localStorage.getItem('ext_token') || '';
|
|
3155
3165
|
//this.isCallInProgress = true;
|
|
@@ -3289,6 +3299,10 @@ class DialboxComponent {
|
|
|
3289
3299
|
this.registerDragElement();
|
|
3290
3300
|
}
|
|
3291
3301
|
ngOnChanges(changes) {
|
|
3302
|
+
if (changes['deviceId']) {
|
|
3303
|
+
localStorage.setItem('deviceId', changes['deviceId'].currentValue);
|
|
3304
|
+
console.log('Set deviceId in localStorage:', changes['deviceId'].currentValue);
|
|
3305
|
+
}
|
|
3292
3306
|
if (changes['isDialpadHidden'] && !this.isDialpadHidden) {
|
|
3293
3307
|
this.getContactList();
|
|
3294
3308
|
this.getUserCallSetting();
|