@vgroup/dialbox 0.4.36 → 0.4.38

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.
@@ -716,6 +716,14 @@ class ExtensionService {
716
716
  const httpOptions = { headers: headers };
717
717
  return this.http.get(environment.apiUrl + `/utilities/twilio/call/status/${callAuthId}`, httpOptions);
718
718
  }
719
+ setIncomingCallStatus(payload) {
720
+ const headers = new HttpHeaders({
721
+ 'Content-Type': 'application/json',
722
+ 'Auth-Key': 'Bearer ' + localStorage.getItem('ext_token')
723
+ });
724
+ const httpOptions = { headers: headers };
725
+ return this.http.post(environment.apiUrl + `/utilities/twilio/incoming/conference/ip`, payload, httpOptions);
726
+ }
719
727
  //sms api
720
728
  sendSms(c2c_latlong, c2c_request, dtModel) {
721
729
  return this.fetchBlockedCountries().pipe(switchMap(blockedCountries => {
@@ -2417,6 +2425,7 @@ class CallProgressComponent {
2417
2425
  this.isCurrentIncomingCallList.push(data?.id || data?.participantId);
2418
2426
  data.isAcceptCall = true;
2419
2427
  this.currentCall = data;
2428
+ this.setIncomingCallStatus(data);
2420
2429
  });
2421
2430
  }
2422
2431
  else {
@@ -2425,6 +2434,7 @@ class CallProgressComponent {
2425
2434
  console.log(this.call, 'callConnect');
2426
2435
  data.isAcceptCall = true;
2427
2436
  this.currentCall = data;
2437
+ this.setIncomingCallStatus(data);
2428
2438
  }
2429
2439
  // } else if(data?.status == 'ringing'){
2430
2440
  // this.twilioService.addIncomingParticipant(data?.id, this.twilioService.conferenceCallInfo.conferenceId).subscribe((data: any) => {
@@ -3097,6 +3107,17 @@ class CallProgressComponent {
3097
3107
  this.isClickExpand = !this.isClickExpand;
3098
3108
  this.selectedUserInfo = { ...data };
3099
3109
  }
3110
+ setIncomingCallStatus(data) {
3111
+ let payload = {
3112
+ recordID: data?.id,
3113
+ ipAddress: '',
3114
+ ipCountry: '',
3115
+ CallStatus: this.callStatus,
3116
+ };
3117
+ this.extensionService.setIncomingCallStatus(payload).subscribe((res) => {
3118
+ console.log(res);
3119
+ });
3120
+ }
3100
3121
  toggleSearch() {
3101
3122
  this.isSearchVisible = !this.isSearchVisible;
3102
3123
  // if closing search — reset results
@@ -3366,7 +3387,7 @@ class DialboxComponent {
3366
3387
  // console.log("WS Event Received:", incomingCallData);
3367
3388
  // console.log("WS Event Received:", incomingCallData.data);
3368
3389
  this.twilioService.conferenceCallInfo = incomingCallData;
3369
- if (!!incomingCallData.participants) {
3390
+ if (!!incomingCallData.participants?.length) {
3370
3391
  // this.incomingCallsList = incomingCallData.participants.filter((item: any) => !item.isLeft) || [];
3371
3392
  this.incomingCallsList = incomingCallData.participants || [];
3372
3393
  // if (this.incomingCallsList.length) {