@vgroup/dialbox 0.7.94 → 0.7.95

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.
@@ -62,23 +62,23 @@ const keypad = [
62
62
  ];
63
63
 
64
64
  const environment = {
65
- abb: "p",
66
- production: true,
65
+ abb: "t",
66
+ production: false,
67
67
  secureCookies: true,
68
- feUrl: 'https://app-phone.contexttocall.com/',
69
- apiUrl: 'https://phone-api.contexttocall.com/softphone/',
70
- websocketUrl: 'wss://phone-api.contexttocall.com/softphone/',
68
+ feUrl: 'https://test.vgroupinc.com:91/',
69
+ apiUrl: 'https://apis.vgroupinc.com/test_softphone',
70
+ websocketUrl: 'wss://apis.vgroupinc.com/test_softphone/',
71
71
  captchaKey: "6LfpOmEaAAAAAGsI6JXlMzOl3b7rW4YmYXFDjldD",
72
- stripePublishableKey: "pk_live_51OV9NYDjRTFWP7oMLrrgaWxCUp4nzeuwdDCCPjvwH7z6oDYUTierhavGMxBa411U0O27Yn24te7Hb43WFDwg2U7N00qbQUzTi6",
72
+ stripePublishableKey: "pk_test_51NbMVaA3guus6fhlTuCV5ycFTIJmwgN38dDUf9pNPfM319x5CkLbV6EbTQaZiNOrRsfR16RWLE8hQmR0eZFTBqTy00Wlsug4qS",
73
73
  sessionTimeout: 15,
74
74
  deviceType: "web",
75
- appVersion: "3.2",
76
- channelId: '6511738039ee10367cbde2e9',
75
+ appVersion: "2.3",
76
+ channelId: '61481b12e138eb7dc3007579',
77
77
  c2c_support_point_id: '60424735f74ac306c1bfa900',
78
- c2c_support_channel_id: '67783949be93ab03faf8eea6',
79
- c2c_point_url: 'https://bit.ly/3blWnPv',
80
- c2c_call_label_id: 'Bn78kjz6sSottXSHgqMt',
81
- c2c_email_label_id: 'UkNer4LgzXCfFlh8u909',
78
+ c2c_support_channel_id: '677f6726be93ab507fbbfdf0',
79
+ c2c_point_url: 'https://app.contexttocall.com/assets/cdn/c2c.js',
80
+ c2c_call_label_id: '6NU5fKE2mGTyXDC3yhmK',
81
+ c2c_email_label_id: 'YPMamj8RvsGORVvqXWyc',
82
82
  radarAPIKey: 'prj_live_sk_569b6f639edde6120a26f703511c61aaecd3f7ef',
83
83
  firebase: {
84
84
  apiKey: "AIzaSyCA8LSPrqlDq_thk26LhBQexAQeY6pkU5Y",
@@ -90,7 +90,10 @@ const environment = {
90
90
  measurementId: "G-NGXTSV9SH3",
91
91
  vapidKey: "BD6EgcQgbZTjOQfleG3YlEc0_SajB03prqTdDy-qGJkxTxezbq-A_qtuXE1l3yT47o8hnTAbTKBcH15D2AJB2To"
92
92
  },
93
- perspectiveApiKey: 'AIzaSyClf32lvLH4QOy-vOnzLzwSNntKIgapH8s'
93
+ perspectiveApiKey: 'AIzaSyClf32lvLH4QOy-vOnzLzwSNntKIgapH8s',
94
+ keycloakURL: 'https://test-keycloak.vgroupinc.com/',
95
+ keycloakRealm: 'vgroup-test',
96
+ keycloakClientId: 'c2c-softphone-app'
94
97
  };
95
98
 
96
99
  class IpAddressService {
@@ -2977,7 +2980,7 @@ class CallProgressComponent {
2977
2980
  await this.pollCallStatus(callAuthId);
2978
2981
  setTimeout(async () => {
2979
2982
  try {
2980
- let addClientParticipantRes = await this.addClientParticipant({
2983
+ let addClientParticipantRes = this.addClientParticipant({
2981
2984
  from: callData?.from,
2982
2985
  route: "OUTGOING",
2983
2986
  participantNumber: callData?.phone,
@@ -2988,9 +2991,9 @@ class CallProgressComponent {
2988
2991
  deviceId: this.deviceId,
2989
2992
  clientSid: this.call?.parameters['CallSid']
2990
2993
  });
2991
- if (addClientParticipantRes?.status != 200) {
2992
- swal("Error", addClientParticipantRes?.message, "error");
2993
- }
2994
+ // if(addClientParticipantRes?.status != 200) {
2995
+ // swal("Error", addClientParticipantRes?.message.join("<br/>"), "error");
2996
+ // }
2994
2997
  this.addRes = await this.addParticipantToCall({
2995
2998
  from: callData?.from,
2996
2999
  route: "OUTGOING",
@@ -3028,34 +3031,14 @@ class CallProgressComponent {
3028
3031
  this.unholdPendingConference();
3029
3032
  }
3030
3033
  else {
3031
- console.log(896);
3032
- this.endCallEvent.emit();
3033
3034
  this.endCall(); // regular call failure – disconnect everything
3034
3035
  }
3035
3036
  }
3036
3037
  }
3037
3038
  catch (error) {
3038
3039
  this.showRingAnimation = false;
3039
- // Whatever failed above (backend call, Twilio connect, etc.), the "Connecting..."
3040
- // loader must always come down — previously this was left to endCall()/the socket
3041
- // feed, and if either of those didn't run (or threw), the loader stayed on screen
3042
- // forever with no way back to the dialpad.
3043
- this.extensionService.isLoadershow.next(false);
3044
- this.isLoadershown.emit(false);
3045
- if (isNewConference) {
3046
- this.unholdPendingConference();
3047
- }
3048
- else {
3049
- console.log(896);
3050
- this.endCallEvent.emit();
3051
- try {
3052
- this.endCall(); // regular call failure – disconnect everything
3053
- }
3054
- catch (cleanupError) {
3055
- console.error('Error during call failure cleanup:', cleanupError);
3056
- }
3057
- }
3058
- this.handleError('Call not initiating due to a technical issue. Please try again.');
3040
+ this.handleError(error);
3041
+ this.endCall();
3059
3042
  return false;
3060
3043
  }
3061
3044
  }
@@ -3150,19 +3133,9 @@ class CallProgressComponent {
3150
3133
  // await this.getAllParticipants(c?.conferenceId);
3151
3134
  }
3152
3135
  async onEndCall(c, isAllCallEnd, isContect) {
3153
- let participantId = isAllCallEnd ? 'all' : c?.participantId || c?.id;
3136
+ let participantId = isAllCallEnd ? 'all' : c.participantId || c?.id;
3154
3137
  const currentConferenceCallInfo = this.getCurrentCallInfo();
3155
- // A call that failed/aborted before the backend ever created a conference for it
3156
- // (e.g. initiateCall()/connectToDevice() threw) has no `c` and no matching entry
3157
- // here — there is nothing to remove server-side, so just fall through to the
3158
- // local cleanup below instead of throwing on `undefined.participants`.
3159
- if (!c?.conferenceId && !isAllCallEnd) {
3160
- this.conferenceCallIDForParticipantList = currentConferenceCallInfo?.conferenceId;
3161
- this.incomeingCallSocketService.pause();
3162
- this.cdr.detectChanges();
3163
- return false;
3164
- }
3165
- const participantList = this.newIncomingCallsList.find((callInfo) => callInfo?.conferenceId == c?.conferenceId)?.participants.filter((resData) => !resData?.isLeft) || [];
3138
+ const participantList = this.newIncomingCallsList.find((callInfo) => callInfo?.conferenceId == c?.conferenceId).participants.filter((resData) => !resData?.isLeft);
3166
3139
  if (participantList?.length <= 2 && !isContect) {
3167
3140
  participantId = 'all';
3168
3141
  }
@@ -3631,7 +3604,7 @@ class CallProgressComponent {
3631
3604
  else if (this.missCallInfo?.data?.data?.recordId == data?.id && !callToAccept.parameters?.CallSid) {
3632
3605
  clearInterval(intervalId);
3633
3606
  const sid = callToAccept.parameters?.CallSid;
3634
- this.twilioService.isConnectingIncomingCallId.next('');
3607
+ this.isConnectingIncomingCallId = '';
3635
3608
  this.isConnectingIncomingCallId = '';
3636
3609
  this.acceptedCallList = this.acceptedCallList.filter(c => c.callSid !== sid);
3637
3610
  this.twilioService.acceptedCallList = this.twilioService.acceptedCallList.filter((c) => c.parameters?.CallSid !== sid);
@@ -3772,7 +3745,7 @@ class CallProgressComponent {
3772
3745
  catch (error) {
3773
3746
  console.error('Error adding participant:', error);
3774
3747
  this.showRingAnimation = false;
3775
- this.handleError('Failed to add participant. Please try again.');
3748
+ this.handleError(error);
3776
3749
  }
3777
3750
  }
3778
3751
  async CallToUnsavedNumber(number, isNewConference, options, participantInfo) {
@@ -4114,7 +4087,9 @@ class CallProgressComponent {
4114
4087
  console.log(ev);
4115
4088
  try {
4116
4089
  let selfCall = this.newIncomingCallsList.find((res) => res?.conferenceId == this.currentCall?.conferenceId)?.participants.find((resData) => ((this.deviceNumberList.includes(resData?.from) && resData?.client) || (this.deviceNumberList.includes(resData?.to) && resData?.direction == 'incoming-call' && resData?.host)) && !resData?.isLeft);
4090
+ console.log(selfCall);
4117
4091
  let device = this.twilioService.getIncomingCallById(selfCall?.callSid || selfCall?.clientSid);
4092
+ console.log(device);
4118
4093
  if (device && device?._status == 'open') {
4119
4094
  device.sendDigits(String(ev.key));
4120
4095
  }
@@ -4983,6 +4958,7 @@ class DialboxComponent {
4983
4958
  setTimeout(() => {
4984
4959
  if (!this.twilioService.acceptedCallList?.length) {
4985
4960
  this.twilioService.device?.disconnectAll();
4961
+ this.twilioService.acceptedCallList = [];
4986
4962
  }
4987
4963
  }, 2000);
4988
4964
  }
@@ -4993,6 +4969,7 @@ class DialboxComponent {
4993
4969
  this.isCallInProgress = false;
4994
4970
  this.twilioService.device?.disconnectAll();
4995
4971
  this.twilioService.spareDevice?.disconnectAll();
4972
+ this.twilioService.acceptedCallList = [];
4996
4973
  }
4997
4974
  }, 2000);
4998
4975
  }
@@ -5247,7 +5224,7 @@ class DialboxComponent {
5247
5224
  if (this.twilioService.incomingCallToken != this.updatedTwilioToken) {
5248
5225
  this.twilioService.incomingCallToken = this.updatedTwilioToken;
5249
5226
  this.twilioService.tokenInitialized = true;
5250
- this.twilioService.initializeTwilioDevice(localStorage.getItem('deviceId'));
5227
+ this.twilioService.initializeTwilioDevice(this.deviceId || localStorage.getItem('deviceId'));
5251
5228
  }
5252
5229
  }
5253
5230
  if (changes['userId']?.currentValue && this.userId) {
@@ -5983,7 +5960,6 @@ class DialboxComponent {
5983
5960
  this.incomingCallsList = [];
5984
5961
  // Clean up Twilio device when component is destroyed
5985
5962
  if (this.twilioService['device']) {
5986
- console.log('Destroying Twilio device...');
5987
5963
  this.twilioService['device'].disconnectAll();
5988
5964
  this.twilioService['device'].destroy();
5989
5965
  }