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