@vgroup/dialbox 0.2.57 → 0.2.59

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.
@@ -595,27 +595,14 @@ class ExtensionService {
595
595
  const httpOptions = { headers: new HttpHeaders(params) };
596
596
  return this.http.post(environment.apiUrl + '/utilities/ext/ur/generate/conference/token', payload, httpOptions);
597
597
  }
598
- // getConferenceCallToken(payload: any) {
599
- // console.log(payload, 'payload');
600
- // const params = {
601
- // 'Content-Type': 'application/json',
602
- // 'Auth-Key': "Bearer " + localStorage.getItem('ext_token'),
603
- // 'c2c-request': window.location.hostname
604
- // }
605
- // const httpOptions = { headers: new HttpHeaders(params) };
606
- // return this.http.post<[]>(environment.apiUrl + '/utilities/ext/ur/generate/token', payload, httpOptions);
607
- // }
608
- // addFirstParticipant(payload: any){
609
- // const params = {
610
- // conferenceId: payload.conferenceId,
611
- // participantNumber: payload.participantNumber
612
- // }
613
- // const httpOptions = { headers: new HttpHeaders(params) };
614
- // return this.http.post<[]>(environment.apiUrl + '/utilities/ext/ur/add/participant', payload, httpOptions);
615
- // }
616
598
  addParticipant(payload) {
599
+ const headers = new HttpHeaders({
600
+ 'Content-Type': 'application/json',
601
+ 'Auth-Key': 'Bearer ' + localStorage.getItem('ext_token')
602
+ });
603
+ const httpOptions = { headers: headers };
617
604
  console.log(payload, 'payload');
618
- return this.http.post(environment.apiUrl + '/utilities/ext/ur/add/participant', payload);
605
+ return this.http.post(environment.apiUrl + '/utilities/ext/ur/add/participant', payload, httpOptions);
619
606
  }
620
607
  // getAllParticipants(id:any, payload: any) {
621
608
  // const params = {
@@ -641,6 +628,16 @@ class ExtensionService {
641
628
  const httpOptions = { headers: new HttpHeaders(params) };
642
629
  return this.http.post(environment.apiUrl + '/update/hold/unhold', params, httpOptions);
643
630
  }
631
+ getCallStatusOfParticipants(participantId) {
632
+ const params = {};
633
+ const httpOptions = { headers: new HttpHeaders(params) };
634
+ return this.http.get(environment.apiUrl + `/utilities/ext/ur/call/status/participant/${participantId}`, httpOptions);
635
+ }
636
+ muteParticipant() {
637
+ const params = {};
638
+ const httpOptions = { headers: new HttpHeaders(params) };
639
+ return this.http.get(environment.apiUrl + '/utilities/ext/ur/mute/participant', httpOptions);
640
+ }
644
641
  fetchBlockedCountries() {
645
642
  return this.http.get(environment.apiUrl + '/global/master/ur/blacklisted/countrylist').pipe(map(response => {
646
643
  if (response.response === 'Success' && Array.isArray(response.countries)) {
@@ -2123,15 +2120,15 @@ class CallProgressComponent {
2123
2120
  this.getUserInformation(callAuthId);
2124
2121
  this.recordCall = recordCall; // Store the recordCall value
2125
2122
  const tokenData = yield this.getOutgoingCallToken(callAuthId);
2123
+ yield this.connectToDevice(tokenData.token, callData);
2124
+ this.pollCallStatus(callAuthId);
2126
2125
  yield this.addParticipantToCall({
2127
2126
  from: callData === null || callData === void 0 ? void 0 : callData.from,
2128
2127
  route: "OUTGOING",
2129
2128
  participantNumber: callData === null || callData === void 0 ? void 0 : callData.phone,
2130
2129
  conferenceId: (_a = response === null || response === void 0 ? void 0 : response.callauth) === null || _a === void 0 ? void 0 : _a.id
2131
2130
  });
2132
- yield this.connectToDevice(tokenData.token, callData);
2133
2131
  // Poll the status for 30-45 seconds
2134
- this.pollCallStatus(callAuthId);
2135
2132
  }
2136
2133
  else if (response.status == 201) {
2137
2134
  swal("Error", response.message.join("<br/>"), "error");
@@ -2157,6 +2154,11 @@ class CallProgressComponent {
2157
2154
  return yield this.extensionService.addParticipant(payload).toPromise();
2158
2155
  });
2159
2156
  }
2157
+ getCallStatusOfParticipants(participantId) {
2158
+ return __awaiter(this, void 0, void 0, function* () {
2159
+ return yield this.extensionService.getCallStatusOfParticipants(participantId).toPromise();
2160
+ });
2161
+ }
2160
2162
  getCallAuthId(response) {
2161
2163
  return __awaiter(this, void 0, void 0, function* () {
2162
2164
  return {