@vgroup/dialbox 0.1.25 → 0.1.26

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.
@@ -1457,6 +1457,9 @@ class TwilioService {
1457
1457
  this.processedCallSids.add(callSid);
1458
1458
  console.log('New incoming call:', callSid);
1459
1459
  this.currentCall.next(call);
1460
+ this.callType.next('INCOMING');
1461
+ this.currentCallState.next('incoming');
1462
+ this.notificationSerivce.showNotification(call);
1460
1463
  const callEndHandler = () => {
1461
1464
  this.processedCallSids.delete(callSid);
1462
1465
  call.off('disconnect', callEndHandler);
@@ -1615,16 +1618,21 @@ class IncomingCallComponent {
1615
1618
  this.newIncomingCallsList = [];
1616
1619
  }
1617
1620
  const callSid = call.parameters['CallSid'];
1618
- // The service now handles de-duplication, so we just add the call.
1619
- this.newIncomingCallsList.push(call);
1620
- this.incomingCallsNewList.emit([...this.newIncomingCallsList]);
1621
- if (!this.twilioCallData) {
1622
- this.twilioCallData = call;
1623
- this.twilioAuthId = call.customParameters.get('twilioAuthId');
1624
- this.sendIPforIncomingCall(this.twilioAuthId, '');
1625
- }
1626
- call.on('cancel', () => this.removeCallFromList(callSid));
1627
- call.on('disconnect', () => this.removeCallFromList(callSid));
1621
+ const existingCall = this.newIncomingCallsList.find((c) => c.parameters['CallSid'] === callSid);
1622
+ if (!existingCall) {
1623
+ this.newIncomingCallsList.push(call);
1624
+ this.incomingCallsNewList.emit([...this.newIncomingCallsList]);
1625
+ if (!this.twilioCallData) {
1626
+ this.twilioCallData = call;
1627
+ this.twilioAuthId = call.customParameters.get('twilioAuthId');
1628
+ this.sendIPforIncomingCall(this.twilioAuthId, '');
1629
+ }
1630
+ call.on('cancel', () => this.removeCallFromList(callSid));
1631
+ call.on('disconnect', () => this.removeCallFromList(callSid));
1632
+ }
1633
+ else {
1634
+ console.log('Call already in list, not adding again.');
1635
+ }
1628
1636
  }
1629
1637
  acceptCallFromList(data) {
1630
1638
  data.accept();