@vgroup/dialbox 0.1.93 → 0.1.94

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.
@@ -2108,13 +2108,48 @@ class CallProgressComponent {
2108
2108
  swal("Error", error, "error");
2109
2109
  }
2110
2110
  endCall() {
2111
- this.endCallEvent.emit();
2111
+ console.log('endCall() called');
2112
+ console.log('Current call:', this.call?.parameters['From']);
2113
+ console.log('Held call exists:', !!this.heldCall);
2114
+ // Disconnect the current active call
2112
2115
  if (this.call) {
2113
2116
  this.call.disconnect();
2117
+ this.call = undefined;
2114
2118
  }
2115
2119
  this.showRingAnimation = false;
2116
2120
  this.stopTimer();
2117
- this.maximiseDialpad();
2121
+ // If there's a held call, make it active
2122
+ if (this.heldCall) {
2123
+ console.log('Resuming held call:', this.heldCall.parameters['From']);
2124
+ // Make held call the active call
2125
+ this.call = this.heldCall;
2126
+ this.heldCall = undefined;
2127
+ this.isCallOnHold = false;
2128
+ // Unmute the resumed call
2129
+ this.call.mute(false);
2130
+ // Update UI with the resumed call info
2131
+ const fromNumber = this.call.parameters['From'];
2132
+ const callerName = this.call.customParameters?.get('name') || '-';
2133
+ const callerImg = this.call.customParameters?.get('image') || 'assets/images/user.jpg';
2134
+ this.callData = {
2135
+ ...this.callData,
2136
+ phone: fromNumber,
2137
+ displayNum: fromNumber,
2138
+ name: callerName,
2139
+ img: callerImg
2140
+ };
2141
+ // Restart timer for the resumed call
2142
+ this.startTimer();
2143
+ this.disbaleEndCallBtn = false;
2144
+ console.log('Held call is now active:', this.callData);
2145
+ this.cdr.detectChanges();
2146
+ }
2147
+ else {
2148
+ // No held call, completely end
2149
+ console.log('No held call, ending completely');
2150
+ this.endCallEvent.emit();
2151
+ this.maximiseDialpad();
2152
+ }
2118
2153
  }
2119
2154
  toggleMute() {
2120
2155
  this.isMute = !this.isMute;