@vgroup/dialbox 0.2.50 → 0.2.52

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.
@@ -588,8 +588,9 @@ class ExtensionService {
588
588
  }
589
589
  getConferenceCallToken(payload) {
590
590
  const params = {
591
- "conferenceId": payload.conferenceId,
592
- "userId": payload.userId
591
+ 'Content-Type': 'application/json',
592
+ 'Auth-Key': "Bearer " + localStorage.getItem('ext_token'),
593
+ 'c2c-request': window.location.hostname
593
594
  };
594
595
  const httpOptions = { headers: new HttpHeaders(params) };
595
596
  return this.http.post(environment.apiUrl + '/utilities/ext/ur/generate/conference/token', params, httpOptions);
@@ -2120,13 +2121,13 @@ class CallProgressComponent {
2120
2121
  };
2121
2122
  const response = yield this.initiateCall(payload);
2122
2123
  if (response.status == 200) {
2123
- const { authId } = yield this.getConferenceCallToken(response);
2124
- this.getUserInformation(authId);
2125
- // this.recordCall = recordCall; // Store the recordCall value
2126
- const tokenData = yield this.getOutgoingCallToken(authId);
2124
+ const { id: callAuthId, recordCall } = yield this.getCallAuthId(response);
2125
+ this.getUserInformation(callAuthId);
2126
+ this.recordCall = recordCall; // Store the recordCall value
2127
+ const tokenData = yield this.getOutgoingCallToken(callAuthId);
2127
2128
  yield this.connectToDevice(tokenData.token, callData);
2128
2129
  // Poll the status for 30-45 seconds
2129
- this.pollCallStatus(authId);
2130
+ this.pollCallStatus(callAuthId);
2130
2131
  }
2131
2132
  else if (response.status == 201) {
2132
2133
  swal("Error", response.message.join("<br/>"), "error");
@@ -2147,20 +2148,17 @@ class CallProgressComponent {
2147
2148
  return yield this.extensionService.initiateCall(payload).toPromise();
2148
2149
  });
2149
2150
  }
2150
- // private async getCallAuthId(response: any) {
2151
- // return {
2152
- // id: response.callauth.id,
2153
- // recordCall: response.callauth.recordCall
2154
- // };
2155
- // }
2156
- getConferenceCallToken(response) {
2157
- return {
2158
- authId: response.callauth.id,
2159
- };
2151
+ getCallAuthId(response) {
2152
+ return __awaiter(this, void 0, void 0, function* () {
2153
+ return {
2154
+ id: response.callauth.id,
2155
+ recordCall: response.callauth.recordCall
2156
+ };
2157
+ });
2160
2158
  }
2161
2159
  getOutgoingCallToken(callAuthId) {
2162
2160
  return __awaiter(this, void 0, void 0, function* () {
2163
- return yield this.extensionService.getOutgoingCallToken({ authId: callAuthId }).toPromise();
2161
+ return yield this.extensionService.getConferenceCallToken({ authId: callAuthId }).toPromise();
2164
2162
  });
2165
2163
  }
2166
2164
  connectToDevice(token, callData) {
@@ -2388,10 +2386,10 @@ class CallProgressComponent {
2388
2386
  };
2389
2387
  const response = yield this.initiateCall(payload);
2390
2388
  if (response.status == 200) {
2391
- const { authId } = yield this.getConferenceCallToken(response);
2392
- this.getUserInformation(authId);
2393
- // this.recordCall = recordCall;
2394
- const tokenData = yield this.getOutgoingCallToken(authId);
2389
+ const { id: callAuthId, recordCall } = yield this.getCallAuthId(response);
2390
+ this.getUserInformation(callAuthId);
2391
+ this.recordCall = recordCall;
2392
+ const tokenData = yield this.getOutgoingCallToken(callAuthId);
2395
2393
  // Connect to new call
2396
2394
  const options = {
2397
2395
  codecPreferences: ['opus', 'pcmu'],
@@ -2429,7 +2427,7 @@ class CallProgressComponent {
2429
2427
  // Setup event listeners for new call
2430
2428
  this.setupEventListeners();
2431
2429
  // Poll call status
2432
- this.pollCallStatus(authId);
2430
+ this.pollCallStatus(callAuthId);
2433
2431
  console.log('New call initiated to:', phoneNumber);
2434
2432
  this.cdr.detectChanges();
2435
2433
  }