@vgroup/dialbox 0.8.7 → 0.8.8

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: "t",
65
+ abb: "u",
66
66
  production: false,
67
67
  secureCookies: true,
68
- feUrl: 'https://test.vgroupinc.com:91/',
69
- apiUrl: 'https://apis.vgroupinc.com/test_softphone',
70
- websocketUrl: 'wss://apis.vgroupinc.com/test_softphone/',
68
+ feUrl: 'https://c2c-uat.contexttocall.com:85/',
69
+ apiUrl: 'https://c2c-uatapi-t10.contexttocall.com/uat_softphone',
70
+ websocketUrl: 'wss://c2c-uatapi-t10.contexttocall.com/uat_softphone/',
71
71
  captchaKey: "6LfpOmEaAAAAAGsI6JXlMzOl3b7rW4YmYXFDjldD",
72
- stripePublishableKey: "pk_test_51NbMVaA3guus6fhlTuCV5ycFTIJmwgN38dDUf9pNPfM319x5CkLbV6EbTQaZiNOrRsfR16RWLE8hQmR0eZFTBqTy00Wlsug4qS",
72
+ stripePublishableKey: "pk_live_51NbMVaA3guus6fhl85gdcvAWHzfHba5LdGlsnV7DxBT9spHghn4IHT9rDCjSRgFh2ijTiZn9qeazdciY1PbreOuB00t1GdQAZJ",
73
73
  sessionTimeout: 15,
74
74
  deviceType: "web",
75
- appVersion: "2.3",
76
- channelId: '61481b12e138eb7dc3007579',
75
+ appVersion: "2.9",
76
+ channelId: '6511738039ee10367cbde2e9',
77
77
  c2c_support_point_id: '60424735f74ac306c1bfa900',
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',
78
+ c2c_support_channel_id: '677f68fcbe93ab507fbbfe0b',
79
+ c2c_point_url: 'https://bit.ly/3blWnPv',
80
+ c2c_call_label_id: '5M4taT8xzAg9pPIUADOW',
81
+ c2c_email_label_id: 'MUUC4NV5bLqHixXyhmok',
82
82
  radarAPIKey: 'prj_live_sk_569b6f639edde6120a26f703511c61aaecd3f7ef',
83
83
  firebase: {
84
84
  apiKey: "AIzaSyCA8LSPrqlDq_thk26LhBQexAQeY6pkU5Y",
@@ -3017,7 +3017,7 @@ class CallProgressComponent {
3017
3017
  console.log('Call initiated successfully:', response);
3018
3018
  setTimeout(async () => {
3019
3019
  try {
3020
- let addClientParticipantRes = this.addClientParticipant({
3020
+ let addClientParticipantRes = await this.addClientParticipant({
3021
3021
  from: callData?.from,
3022
3022
  route: "OUTGOING",
3023
3023
  participantNumber: callData?.phone,
@@ -3028,9 +3028,9 @@ class CallProgressComponent {
3028
3028
  deviceId: this.deviceId,
3029
3029
  clientSid: this.call?.parameters['CallSid']
3030
3030
  });
3031
- // if(addClientParticipantRes?.status != 200) {
3032
- // swal("Error", addClientParticipantRes?.message.join("<br/>"), "error");
3033
- // }
3031
+ if (addClientParticipantRes?.status != 200) {
3032
+ swal("Error", addClientParticipantRes?.message, "error");
3033
+ }
3034
3034
  this.addRes = await this.addParticipantToCall({
3035
3035
  from: callData?.from,
3036
3036
  route: "OUTGOING",
@@ -3070,14 +3070,34 @@ class CallProgressComponent {
3070
3070
  this.unholdPendingConference();
3071
3071
  }
3072
3072
  else {
3073
+ console.log(896);
3074
+ this.endCallEvent.emit();
3073
3075
  this.endCall(); // regular call failure – disconnect everything
3074
3076
  }
3075
3077
  }
3076
3078
  }
3077
3079
  catch (error) {
3078
3080
  this.showRingAnimation = false;
3079
- this.handleError(error);
3080
- this.endCall();
3081
+ // Whatever failed above (backend call, Twilio connect, etc.), the "Connecting..."
3082
+ // loader must always come down — previously this was left to endCall()/the socket
3083
+ // feed, and if either of those didn't run (or threw), the loader stayed on screen
3084
+ // forever with no way back to the dialpad.
3085
+ this.extensionService.isLoadershow.next(false);
3086
+ this.isLoadershown.emit(false);
3087
+ if (isNewConference) {
3088
+ this.unholdPendingConference();
3089
+ }
3090
+ else {
3091
+ console.log(896);
3092
+ this.endCallEvent.emit();
3093
+ try {
3094
+ this.endCall(); // regular call failure – disconnect everything
3095
+ }
3096
+ catch (cleanupError) {
3097
+ console.error('Error during call failure cleanup:', cleanupError);
3098
+ }
3099
+ }
3100
+ this.handleError('Call not initiating due to a technical issue. Please try again.');
3081
3101
  return false;
3082
3102
  }
3083
3103
  }
@@ -3174,7 +3194,17 @@ class CallProgressComponent {
3174
3194
  async onEndCall(c, isAllCallEnd, isContect, isSetTimer) {
3175
3195
  let participantId = isAllCallEnd ? 'all' : c.participantId || c?.id;
3176
3196
  const currentConferenceCallInfo = this.getCurrentCallInfo();
3177
- const participantList = this.newIncomingCallsList.find((callInfo) => callInfo?.conferenceId == c?.conferenceId).participants.filter((resData) => !resData?.isLeft);
3197
+ // A call that failed/aborted before the backend ever created a conference for it
3198
+ // (e.g. initiateCall()/connectToDevice() threw) has no `c` and no matching entry
3199
+ // here — there is nothing to remove server-side, so just fall through to the
3200
+ // local cleanup below instead of throwing on `undefined.participants`.
3201
+ if (!c?.conferenceId && !isAllCallEnd) {
3202
+ this.conferenceCallIDForParticipantList = currentConferenceCallInfo?.conferenceId;
3203
+ this.incomeingCallSocketService.pause();
3204
+ this.cdr.detectChanges();
3205
+ return false;
3206
+ }
3207
+ const participantList = this.newIncomingCallsList.find((callInfo) => callInfo?.conferenceId == c?.conferenceId)?.participants.filter((resData) => !resData?.isLeft) || [];
3178
3208
  if (participantList?.length <= 2 && !isContect) {
3179
3209
  participantId = 'all';
3180
3210
  }
@@ -3648,7 +3678,7 @@ class CallProgressComponent {
3648
3678
  else if (this.missCallInfo?.data?.data?.recordId == data?.id && !callToAccept.parameters?.CallSid) {
3649
3679
  clearInterval(intervalId);
3650
3680
  const sid = callToAccept.parameters?.CallSid;
3651
- this.isConnectingIncomingCallId = '';
3681
+ this.twilioService.isConnectingIncomingCallId.next('');
3652
3682
  this.isConnectingIncomingCallId = '';
3653
3683
  this.acceptedCallList = this.acceptedCallList.filter(c => c.callSid !== sid);
3654
3684
  this.twilioService.acceptedCallList = this.twilioService.acceptedCallList.filter((c) => c.parameters?.CallSid !== sid);
@@ -3789,7 +3819,7 @@ class CallProgressComponent {
3789
3819
  catch (error) {
3790
3820
  console.error('Error adding participant:', error);
3791
3821
  this.showRingAnimation = false;
3792
- this.handleError(error);
3822
+ this.handleError('Failed to add participant. Please try again.');
3793
3823
  }
3794
3824
  }
3795
3825
  async CallToUnsavedNumber(number, isNewConference, options, participantInfo) {
@@ -4131,9 +4161,7 @@ class CallProgressComponent {
4131
4161
  console.log(ev);
4132
4162
  try {
4133
4163
  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);
4134
- console.log(selfCall);
4135
4164
  let device = this.twilioService.getIncomingCallById(selfCall?.callSid || selfCall?.clientSid);
4136
- console.log(device);
4137
4165
  if (device && device?._status == 'open') {
4138
4166
  device.sendDigits(String(ev.key));
4139
4167
  }
@@ -5278,7 +5306,7 @@ class DialboxComponent {
5278
5306
  if (this.twilioService.incomingCallToken != this.updatedTwilioToken) {
5279
5307
  this.twilioService.incomingCallToken = this.updatedTwilioToken;
5280
5308
  this.twilioService.tokenInitialized = true;
5281
- this.twilioService.initializeTwilioDevice(this.deviceId || localStorage.getItem('deviceId'));
5309
+ this.twilioService.initializeTwilioDevice(localStorage.getItem('deviceId'));
5282
5310
  }
5283
5311
  }
5284
5312
  if (changes['userId']?.currentValue && this.userId) {