@vgroup/dialbox 0.2.79 → 0.2.81

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.
@@ -1647,7 +1647,7 @@ class IncomeingCallSocketService {
1647
1647
  }
1648
1648
  connect() {
1649
1649
  // Replace with your WebSocket URL
1650
- this.socket = new WebSocket(`${environment.websocketUrl}/incoming/call`);
1650
+ this.socket = new WebSocket(`${environment.websocketUrl}incoming/call`);
1651
1651
  this.socket.onopen = () => {
1652
1652
  console.log("WebSocket connected");
1653
1653
  // Authenticate (if needed)
@@ -2080,6 +2080,7 @@ class CallProgressComponent {
2080
2080
  if (changes['callData']) {
2081
2081
  if (changes['callData'].currentValue?.isIncomingCall) {
2082
2082
  this.incomingCallDiv = true;
2083
+ this.call['callInfo'] = { ...this.callData };
2083
2084
  this.cdr.detectChanges();
2084
2085
  }
2085
2086
  else if (changes['callData'].currentValue?.displayNum || changes['callData'].currentValue?.from) {
@@ -2179,7 +2180,7 @@ class CallProgressComponent {
2179
2180
  conferenceId: this.conferenceId
2180
2181
  });
2181
2182
  this.callData = { ...this.callData, participantId: this.addRes?.participantId };
2182
- this.call['callInfo'] = this.callData;
2183
+ this.call['callInfo'] = { ...this.callData };
2183
2184
  console.log('Initial participantId:', this.addRes?.participantId);
2184
2185
  }
2185
2186
  catch (e) {
@@ -2449,7 +2450,7 @@ class CallProgressComponent {
2449
2450
  hold: true
2450
2451
  });
2451
2452
  // Put current call on hold
2452
- this.heldCall = this.call;
2453
+ this.heldCall = { ...this.call };
2453
2454
  this.isCallOnHold = true;
2454
2455
  this.heldCall.mute(true);
2455
2456
  // Close contacts panel and show ring animation
@@ -2466,6 +2467,7 @@ class CallProgressComponent {
2466
2467
  name: contactName || phoneNumber,
2467
2468
  img: contact?.img || 'assets/images/user.jpg'
2468
2469
  };
2470
+ this.call['callInfo'] = { ...this.callData };
2469
2471
  this.cdr.detectChanges();
2470
2472
  // Get the conference ID from the current call or use the stored one
2471
2473
  const conferenceId = this.conferenceId;
@@ -2500,7 +2502,7 @@ class CallProgressComponent {
2500
2502
  }
2501
2503
  getAllParticipants(conferenceSid) {
2502
2504
  this.extensionService.getAllParticipants(conferenceSid).subscribe((res) => {
2503
- console.log(res);
2505
+ this.allParticipentList = res.participants;
2504
2506
  });
2505
2507
  }
2506
2508
  // acceptConcurrentCall(incomingCall: any) {
@@ -2555,6 +2557,8 @@ class CallProgressComponent {
2555
2557
  async swapCalls() {
2556
2558
  if (!this.heldCall || !this.call)
2557
2559
  return;
2560
+ console.log(this.call, 'this.call');
2561
+ console.log(this.heldCall, 'this.heldCall');
2558
2562
  await this.onholdOrUnholdParticipant({
2559
2563
  participantId: this.call?.callInfo?.participantId,
2560
2564
  conferenceId: this.conferenceId,
@@ -3067,50 +3071,50 @@ class DialboxComponent {
3067
3071
  // Ensure Twilio is initialized even when dialpad starts hidden,
3068
3072
  // so we can auto-open on incoming calls.
3069
3073
  this.initializeTwilio();
3070
- this.incomeingCallSocketService.connect();
3071
- this.incomeingCallSocketService.listen().subscribe((incomingCallData) => {
3072
- console.log("WS Event Received:", incomingCallData);
3073
- console.log("WS Event Received:", incomingCallData.data);
3074
- if (incomingCallData.type === "/incoming/call") {
3075
- if (incomingCallData) {
3076
- if (this.autoOpenOnIncoming && this._isDialpadHidden) {
3077
- this._isDialpadHidden = false;
3078
- }
3079
- if (this.isCallInProgress) {
3080
- this.newIncomingCalls.push(incomingCallData);
3081
- console.log('325', incomingCallData);
3082
- this.getUserInformation(incomingCallData);
3083
- }
3084
- else {
3085
- incomingCallData['isFirstCall'] = true;
3086
- console.log('dd1');
3087
- this.isCallInProgress = true;
3088
- this.isDialpadHidden = false;
3089
- this.callData.phone = incomingCallData.parameters['From'];
3090
- console.log('dd2');
3091
- this.getUserInformation(incomingCallData);
3092
- this.callData.name = incomingCallData.customParameters.get('name');
3093
- this.callData.img = incomingCallData.customParameters.get('image') || 'assets/images/user.jpg';
3094
- this.callData.isIncomingCall = true;
3074
+ try {
3075
+ this.incomeingCallSocketService.connect();
3076
+ this.incomeingCallSocketService.listen().subscribe((incomingCallData) => {
3077
+ console.log("WS Event Received:", incomingCallData);
3078
+ console.log("WS Event Received:", incomingCallData.data);
3079
+ if (incomingCallData.type === "/incoming/call") {
3080
+ if (incomingCallData) {
3081
+ if (this.autoOpenOnIncoming && this._isDialpadHidden) {
3082
+ this._isDialpadHidden = false;
3083
+ }
3084
+ if (this.isCallInProgress) {
3085
+ this.newIncomingCalls.push(incomingCallData);
3086
+ console.log('325', incomingCallData);
3087
+ this.getUserInformation(incomingCallData);
3088
+ }
3089
+ else {
3090
+ incomingCallData['isFirstCall'] = true;
3091
+ console.log('dd1');
3092
+ this.isCallInProgress = true;
3093
+ this.isDialpadHidden = false;
3094
+ this.callData.phone = incomingCallData.parameters['From'];
3095
+ console.log('dd2');
3096
+ this.getUserInformation(incomingCallData);
3097
+ this.callData.name = incomingCallData.customParameters.get('name');
3098
+ this.callData.img = incomingCallData.customParameters.get('image') || 'assets/images/user.jpg';
3099
+ this.callData.isIncomingCall = true;
3100
+ }
3101
+ incomingCallData.on('cancel', () => {
3102
+ this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== incomingCallData.parameters['CallSid']);
3103
+ // if(this.incomingCallsList.length == 0){
3104
+ // console.log('dd3')
3105
+ // this.isCallInProgress = false;
3106
+ // }
3107
+ });
3108
+ incomingCallData.on('disconnect', () => {
3109
+ this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== incomingCallData.parameters['CallSid']);
3110
+ // if(this.incomingCallsList.length == 0){
3111
+ // console.log('dd4')
3112
+ // this.isCallInProgress = false;
3113
+ // }
3114
+ });
3095
3115
  }
3096
- incomingCallData.on('cancel', () => {
3097
- this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== incomingCallData.parameters['CallSid']);
3098
- // if(this.incomingCallsList.length == 0){
3099
- // console.log('dd3')
3100
- // this.isCallInProgress = false;
3101
- // }
3102
- });
3103
- incomingCallData.on('disconnect', () => {
3104
- this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== incomingCallData.parameters['CallSid']);
3105
- // if(this.incomingCallsList.length == 0){
3106
- // console.log('dd4')
3107
- // this.isCallInProgress = false;
3108
- // }
3109
- });
3110
3116
  }
3111
- }
3112
- });
3113
- try {
3117
+ });
3114
3118
  this.token = localStorage.getItem('ext_token') || '';
3115
3119
  //this.isCallInProgress = true;
3116
3120
  this.getContactList();