@vgroup/dialbox 0.0.12 → 0.0.13

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.
@@ -2159,16 +2159,25 @@ class DialboxComponent {
2159
2159
  }
2160
2160
  }
2161
2161
  });
2162
- // handle incoming call
2163
- const sub2 = this.twilioService.currentCall.subscribe(incomingCallData => {
2164
- // if (incomingCallData) {
2165
- // this.isCallInProgress = true;
2166
- // this.isDialpadHidden = false;
2167
- // this.callData.phone = incomingCallData.parameters.From;
2168
- // this.callData.name = incomingCallData.customParameters.get('name');
2169
- // this.callData.img = incomingCallData.customParameters.get('image');
2170
- // this.callData.isIncomingCall = true;
2171
- // }
2162
+ // Handle incoming call
2163
+ const sub2 = this.twilioService.currentCall.subscribe((incomingCallData) => {
2164
+ var _a, _b;
2165
+ if (incomingCallData) {
2166
+ console.log('Incoming call received:', incomingCallData);
2167
+ this.isCallInProgress = true;
2168
+ this.isDialpadHidden = false;
2169
+ // Update call data for the UI
2170
+ this.callData = Object.assign(Object.assign({}, this.callData), { phone: incomingCallData.parameters.From, name: ((_a = incomingCallData.customParameters) === null || _a === void 0 ? void 0 : _a.get('name')) || 'Unknown Caller', img: ((_b = incomingCallData.customParameters) === null || _b === void 0 ? void 0 : _b.get('image')) || 'assets/images/user.jpg', isIncomingCall: true, extNum: incomingCallData.parameters.To || '' });
2171
+ // Add to incoming calls list if not already present
2172
+ const callSid = incomingCallData.parameters.CallSid;
2173
+ const existingCall = this.incomingCallsList.find((call) => call.parameters.CallSid === callSid);
2174
+ if (!existingCall) {
2175
+ this.incomingCallsList.push(incomingCallData);
2176
+ this.incomingCallsNewInfoEvent.emit(this.incomingCallsList);
2177
+ }
2178
+ // Notify parent component about the incoming call
2179
+ this.incomingCallInitiated.emit();
2180
+ }
2172
2181
  if (incomingCallData) {
2173
2182
  if (this.isCallInProgress) {
2174
2183
  this.newIncomingCalls.push(incomingCallData);
@@ -3105,20 +3114,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
3105
3114
 
3106
3115
  /*
3107
3116
  * Public API Surface of dialbox
3108
- */
3109
- // export * from './lib/components/dialpad/dialpad.component';
3110
- // export * from './lib/components/dial-button/dial-button.component';
3111
- // // Services
3112
- // export * from './lib/components/services/dialer.service';
3113
- // export * from './lib/components/services/call-handler.service';
3114
- // // Models
3115
- // export * from './lib/components/models/call.interface';
3116
- // export * from './lib/components/models/dialer-options.interface';
3117
- // // Utils
3118
- // export * from './lib/components/utils/phone-validator.util';
3119
- // export * from './lib/components/utils/format-phone.util';
3120
- // // Module
3121
- // export * from './lib/dialbox.module';
3117
+ */
3122
3118
 
3123
3119
  /**
3124
3120
  * Generated bundle index. Do not edit.