@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.
@@ -603,6 +603,14 @@ class ExtensionService {
603
603
  console.log(payload, 'payload');
604
604
  return this.http.post(environment.apiUrl + '/utilities/ext/ur/add/participant', payload, httpOptions);
605
605
  }
606
+ holdParticipant(payload) {
607
+ const headers = new HttpHeaders({
608
+ 'Content-Type': 'application/json',
609
+ 'Auth-Key': 'Bearer ' + localStorage.getItem('ext_token')
610
+ });
611
+ const httpOptions = { headers: headers };
612
+ return this.http.post(environment.apiUrl + '/utilities/ext/ur/hold/participant', payload, httpOptions);
613
+ }
606
614
  // getAllParticipants(id:any, payload: any) {
607
615
  // const params = {
608
616
  // "conferenceId": payload.conferenceId,
@@ -2144,6 +2152,9 @@ class CallProgressComponent {
2144
2152
  async initiateCall(payload) {
2145
2153
  return await this.extensionService.initiateCall(payload).toPromise();
2146
2154
  }
2155
+ async onholdOrUnholdParticipant(payload) {
2156
+ return await this.extensionService.holdParticipant(payload).toPromise();
2157
+ }
2147
2158
  async addParticipantToCall(payload) {
2148
2159
  return await this.extensionService.addParticipant(payload).toPromise();
2149
2160
  }
@@ -2343,7 +2354,6 @@ class CallProgressComponent {
2343
2354
  // Check if there's an active call
2344
2355
  if (!this.call || this.call.status() !== 'open') {
2345
2356
  console.error('No active call');
2346
- swal("Error", "No active call found", "error");
2347
2357
  return;
2348
2358
  }
2349
2359
  // Get the phone number from the contact
@@ -2353,6 +2363,11 @@ class CallProgressComponent {
2353
2363
  return;
2354
2364
  }
2355
2365
  try {
2366
+ await this.onholdOrUnholdParticipant({
2367
+ participantId: this.callData?.participantId,
2368
+ conferenceId: this.conferenceId,
2369
+ hold: true
2370
+ });
2356
2371
  // Put current call on hold
2357
2372
  this.heldCall = this.call;
2358
2373
  this.isCallOnHold = true;
@@ -2377,8 +2392,6 @@ class CallProgressComponent {
2377
2392
  });
2378
2393
  console.log("Participant added to conference:", phoneNumber);
2379
2394
  this.showRingAnimation = false;
2380
- // Show success message
2381
- swal("Success", "Participant is being added to your call", "success");
2382
2395
  }
2383
2396
  catch (error) {
2384
2397
  console.error('Error adding participant:', error);