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