@vgroup/dialbox 0.2.40 โ†’ 0.2.41

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.
@@ -2536,13 +2536,25 @@ class CallProgressComponent {
2536
2536
  rejectConcurrentCall(incomingCall) {
2537
2537
  if (!incomingCall)
2538
2538
  return;
2539
- if (incomingCall.reject) {
2540
- incomingCall.reject();
2539
+ try {
2540
+ // ๐ŸŸฅ Reject or hang up the call at SDK level
2541
+ if (incomingCall.reject) {
2542
+ incomingCall.reject(); // Twilio-like API
2543
+ }
2544
+ else if (incomingCall.disconnect) {
2545
+ incomingCall.disconnect(); // Some SDKs use disconnect()
2546
+ }
2547
+ else if (incomingCall.hangup) {
2548
+ incomingCall.hangup(); // Fallback if the SDK uses hangup()
2549
+ }
2550
+ }
2551
+ catch (err) {
2552
+ console.error('Error rejecting call:', err);
2541
2553
  }
2542
- // Remove from list
2554
+ // ๐Ÿงน Remove the call from the incoming list
2543
2555
  this.newIncomingCallsList = (this.newIncomingCallsList || []).filter((c) => c?.parameters?.CallSid !== incomingCall?.parameters?.CallSid);
2544
2556
  this.incomingCallsNewInfo.emit(this.newIncomingCallsList);
2545
- // If no more incoming, hide banner
2557
+ // ๐ŸŽฏ Update UI state
2546
2558
  if (!this.newIncomingCallsList || this.newIncomingCallsList.length === 0) {
2547
2559
  this.isConcurrentIncoming = false;
2548
2560
  this.incomingCallDiv = false;