@vgroup/dialbox 0.2.50 → 0.2.51

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.
@@ -2116,13 +2116,13 @@ class CallProgressComponent {
2116
2116
  };
2117
2117
  const response = await this.initiateCall(payload);
2118
2118
  if (response.status == 200) {
2119
- const { authId } = await this.getConferenceCallToken(response);
2120
- this.getUserInformation(authId);
2121
- // this.recordCall = recordCall; // Store the recordCall value
2122
- const tokenData = await this.getOutgoingCallToken(authId);
2119
+ const { id: callAuthId, recordCall } = await this.getCallAuthId(response);
2120
+ this.getUserInformation(callAuthId);
2121
+ this.recordCall = recordCall; // Store the recordCall value
2122
+ const tokenData = await this.getOutgoingCallToken(callAuthId);
2123
2123
  await this.connectToDevice(tokenData.token, callData);
2124
2124
  // Poll the status for 30-45 seconds
2125
- this.pollCallStatus(authId);
2125
+ this.pollCallStatus(callAuthId);
2126
2126
  }
2127
2127
  else if (response.status == 201) {
2128
2128
  swal("Error", response.message.join("<br/>"), "error");
@@ -2140,19 +2140,14 @@ class CallProgressComponent {
2140
2140
  async initiateCall(payload) {
2141
2141
  return await this.extensionService.initiateCall(payload).toPromise();
2142
2142
  }
2143
- // private async getCallAuthId(response: any) {
2144
- // return {
2145
- // id: response.callauth.id,
2146
- // recordCall: response.callauth.recordCall
2147
- // };
2148
- // }
2149
- getConferenceCallToken(response) {
2143
+ async getCallAuthId(response) {
2150
2144
  return {
2151
- authId: response.callauth.id,
2145
+ id: response.callauth.id,
2146
+ recordCall: response.callauth.recordCall
2152
2147
  };
2153
2148
  }
2154
2149
  async getOutgoingCallToken(callAuthId) {
2155
- return await this.extensionService.getOutgoingCallToken({ authId: callAuthId }).toPromise();
2150
+ return await this.extensionService.getConferenceCallToken({ authId: callAuthId }).toPromise();
2156
2151
  }
2157
2152
  async connectToDevice(token, callData) {
2158
2153
  const options = {
@@ -2372,10 +2367,10 @@ class CallProgressComponent {
2372
2367
  };
2373
2368
  const response = await this.initiateCall(payload);
2374
2369
  if (response.status == 200) {
2375
- const { authId } = await this.getConferenceCallToken(response);
2376
- this.getUserInformation(authId);
2377
- // this.recordCall = recordCall;
2378
- const tokenData = await this.getOutgoingCallToken(authId);
2370
+ const { id: callAuthId, recordCall } = await this.getCallAuthId(response);
2371
+ this.getUserInformation(callAuthId);
2372
+ this.recordCall = recordCall;
2373
+ const tokenData = await this.getOutgoingCallToken(callAuthId);
2379
2374
  // Connect to new call
2380
2375
  const options = {
2381
2376
  codecPreferences: ['opus', 'pcmu'],
@@ -2413,7 +2408,7 @@ class CallProgressComponent {
2413
2408
  // Setup event listeners for new call
2414
2409
  this.setupEventListeners();
2415
2410
  // Poll call status
2416
- this.pollCallStatus(authId);
2411
+ this.pollCallStatus(callAuthId);
2417
2412
  console.log('New call initiated to:', phoneNumber);
2418
2413
  this.cdr.detectChanges();
2419
2414
  }