@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.
|
@@ -3077,49 +3077,59 @@ class DialboxComponent {
|
|
|
3077
3077
|
// Ensure Twilio is initialized even when dialpad starts hidden,
|
|
3078
3078
|
// so we can auto-open on incoming calls.
|
|
3079
3079
|
this.initializeTwilio();
|
|
3080
|
+
this.incomeingCallSocketService.connect();
|
|
3080
3081
|
try {
|
|
3081
|
-
this.incomeingCallSocketService.connect();
|
|
3082
3082
|
this.incomeingCallSocketService.listen().subscribe((incomingCallData) => {
|
|
3083
|
+
const data = JSON.parse(incomingCallData.data);
|
|
3083
3084
|
console.log("WS Event Received:", incomingCallData);
|
|
3084
3085
|
console.log("WS Event Received:", incomingCallData.data);
|
|
3085
|
-
if (
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
this.getUserInformation(incomingCallData);
|
|
3094
|
-
}
|
|
3095
|
-
else {
|
|
3096
|
-
incomingCallData['isFirstCall'] = true;
|
|
3097
|
-
console.log('dd1');
|
|
3098
|
-
this.isCallInProgress = true;
|
|
3099
|
-
this.isDialpadHidden = false;
|
|
3100
|
-
this.callData.phone = incomingCallData.parameters['From'];
|
|
3101
|
-
console.log('dd2');
|
|
3102
|
-
this.getUserInformation(incomingCallData);
|
|
3103
|
-
this.callData.name = incomingCallData.customParameters.get('name');
|
|
3104
|
-
this.callData.img = incomingCallData.customParameters.get('image') || 'assets/images/user.jpg';
|
|
3105
|
-
this.callData.isIncomingCall = true;
|
|
3106
|
-
}
|
|
3107
|
-
incomingCallData.on('cancel', () => {
|
|
3108
|
-
this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== incomingCallData.parameters['CallSid']);
|
|
3109
|
-
// if(this.incomingCallsList.length == 0){
|
|
3110
|
-
// console.log('dd3')
|
|
3111
|
-
// this.isCallInProgress = false;
|
|
3112
|
-
// }
|
|
3113
|
-
});
|
|
3114
|
-
incomingCallData.on('disconnect', () => {
|
|
3115
|
-
this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== incomingCallData.parameters['CallSid']);
|
|
3116
|
-
// if(this.incomingCallsList.length == 0){
|
|
3117
|
-
// console.log('dd4')
|
|
3118
|
-
// this.isCallInProgress = false;
|
|
3119
|
-
// }
|
|
3120
|
-
});
|
|
3121
|
-
}
|
|
3086
|
+
if (data[0]) {
|
|
3087
|
+
// this.showIncomingCallPopup(incoming, data/
|
|
3088
|
+
this.isCallInProgress = true;
|
|
3089
|
+
this.isDialpadHidden = false;
|
|
3090
|
+
this.callData.phone = data[0].from;
|
|
3091
|
+
this.callData.name = "";
|
|
3092
|
+
this.callData.img = "assets/images/user.jpg";
|
|
3093
|
+
this.callData.isIncomingCall = true;
|
|
3122
3094
|
}
|
|
3095
|
+
// this.initializeTwilio();
|
|
3096
|
+
// if (incomingCallData.type === "/incoming/call") {
|
|
3097
|
+
// if (incomingCallData) {
|
|
3098
|
+
// if (this.autoOpenOnIncoming && this._isDialpadHidden) {
|
|
3099
|
+
// this._isDialpadHidden = false;
|
|
3100
|
+
// }
|
|
3101
|
+
// if (this.isCallInProgress) {
|
|
3102
|
+
// this.newIncomingCalls.push(incomingCallData);
|
|
3103
|
+
// console.log('325', incomingCallData)
|
|
3104
|
+
// this.getUserInformation(incomingCallData);
|
|
3105
|
+
// } else {
|
|
3106
|
+
// incomingCallData['isFirstCall'] = true;
|
|
3107
|
+
// console.log('dd1')
|
|
3108
|
+
// this.isCallInProgress = true;
|
|
3109
|
+
// this.isDialpadHidden = false;
|
|
3110
|
+
// this.callData.phone = incomingCallData.parameters['From'];
|
|
3111
|
+
// console.log('dd2')
|
|
3112
|
+
// this.getUserInformation(incomingCallData);
|
|
3113
|
+
// this.callData.name = incomingCallData.customParameters.get('name');
|
|
3114
|
+
// this.callData.img = incomingCallData.customParameters.get('image') || 'assets/images/user.jpg';
|
|
3115
|
+
// this.callData.isIncomingCall = true;
|
|
3116
|
+
// }
|
|
3117
|
+
// incomingCallData.on('cancel', () => {
|
|
3118
|
+
// this.incomingCallsList = this.incomingCallsList.filter((item: any) => item.parameters['CallSid'] !== incomingCallData.parameters['CallSid']);
|
|
3119
|
+
// // if(this.incomingCallsList.length == 0){
|
|
3120
|
+
// // console.log('dd3')
|
|
3121
|
+
// // this.isCallInProgress = false;
|
|
3122
|
+
// // }
|
|
3123
|
+
// });
|
|
3124
|
+
// incomingCallData.on('disconnect', () => {
|
|
3125
|
+
// this.incomingCallsList = this.incomingCallsList.filter((item: any) => item.parameters['CallSid'] !== incomingCallData.parameters['CallSid']);
|
|
3126
|
+
// // if(this.incomingCallsList.length == 0){
|
|
3127
|
+
// // console.log('dd4')
|
|
3128
|
+
// // this.isCallInProgress = false;
|
|
3129
|
+
// // }
|
|
3130
|
+
// });
|
|
3131
|
+
// }
|
|
3132
|
+
// }
|
|
3123
3133
|
});
|
|
3124
3134
|
this.token = localStorage.getItem('ext_token') || '';
|
|
3125
3135
|
//this.isCallInProgress = true;
|
|
@@ -3259,6 +3269,10 @@ class DialboxComponent {
|
|
|
3259
3269
|
this.registerDragElement();
|
|
3260
3270
|
}
|
|
3261
3271
|
ngOnChanges(changes) {
|
|
3272
|
+
if (changes['deviceId']) {
|
|
3273
|
+
localStorage.setItem('deviceId', changes['deviceId'].currentValue);
|
|
3274
|
+
console.log('Set deviceId in localStorage:', changes['deviceId'].currentValue);
|
|
3275
|
+
}
|
|
3262
3276
|
if (changes['isDialpadHidden'] && !this.isDialpadHidden) {
|
|
3263
3277
|
this.getContactList();
|
|
3264
3278
|
this.getUserCallSetting();
|