@vgroup/dialbox 0.2.65 → 0.2.67

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.
@@ -604,6 +604,14 @@ class ExtensionService {
604
604
  console.log(payload, 'payload');
605
605
  return this.http.post(environment.apiUrl + '/utilities/ext/ur/add/participant', payload, httpOptions);
606
606
  }
607
+ holdParticipant(payload) {
608
+ const headers = new HttpHeaders({
609
+ 'Content-Type': 'application/json',
610
+ 'Auth-Key': 'Bearer ' + localStorage.getItem('ext_token')
611
+ });
612
+ const httpOptions = { headers: headers };
613
+ return this.http.post(environment.apiUrl + '/utilities/ext/ur/hold/participant', payload, httpOptions);
614
+ }
607
615
  // getAllParticipants(id:any, payload: any) {
608
616
  // const params = {
609
617
  // "conferenceId": payload.conferenceId,
@@ -2152,6 +2160,11 @@ class CallProgressComponent {
2152
2160
  return yield this.extensionService.initiateCall(payload).toPromise();
2153
2161
  });
2154
2162
  }
2163
+ onholdOrUnholdParticipant(payload) {
2164
+ return __awaiter(this, void 0, void 0, function* () {
2165
+ return yield this.extensionService.holdParticipant(payload).toPromise();
2166
+ });
2167
+ }
2155
2168
  addParticipantToCall(payload) {
2156
2169
  return __awaiter(this, void 0, void 0, function* () {
2157
2170
  return yield this.extensionService.addParticipant(payload).toPromise();
@@ -2360,13 +2373,12 @@ class CallProgressComponent {
2360
2373
  this.GetContactsList();
2361
2374
  }
2362
2375
  callContact(contact) {
2363
- var _a, _b, _c;
2376
+ var _a, _b, _c, _d;
2364
2377
  return __awaiter(this, void 0, void 0, function* () {
2365
2378
  console.log('Adding participant:', contact);
2366
2379
  // Check if there's an active call
2367
2380
  if (!this.call || this.call.status() !== 'open') {
2368
2381
  console.error('No active call');
2369
- swal("Error", "No active call found", "error");
2370
2382
  return;
2371
2383
  }
2372
2384
  // Get the phone number from the contact
@@ -2376,6 +2388,11 @@ class CallProgressComponent {
2376
2388
  return;
2377
2389
  }
2378
2390
  try {
2391
+ yield this.onholdOrUnholdParticipant({
2392
+ participantId: (_c = this.callData) === null || _c === void 0 ? void 0 : _c.participantId,
2393
+ conferenceId: this.conferenceId,
2394
+ hold: true
2395
+ });
2379
2396
  // Put current call on hold
2380
2397
  this.heldCall = this.call;
2381
2398
  this.isCallOnHold = true;
@@ -2393,15 +2410,13 @@ class CallProgressComponent {
2393
2410
  }
2394
2411
  // Add participant to the conference
2395
2412
  yield this.addParticipantToCall({
2396
- from: (_c = this.callData) === null || _c === void 0 ? void 0 : _c.from,
2413
+ from: (_d = this.callData) === null || _d === void 0 ? void 0 : _d.from,
2397
2414
  route: "OUTGOING",
2398
2415
  participantNumber: phoneNumber,
2399
2416
  conferenceId: conferenceId
2400
2417
  });
2401
2418
  console.log("Participant added to conference:", phoneNumber);
2402
2419
  this.showRingAnimation = false;
2403
- // Show success message
2404
- swal("Success", "Participant is being added to your call", "success");
2405
2420
  }
2406
2421
  catch (error) {
2407
2422
  console.error('Error adding participant:', error);