@vgroup/dialbox 0.2.52 → 0.2.54

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.
@@ -589,11 +589,11 @@ class ExtensionService {
589
589
  getConferenceCallToken(payload) {
590
590
  const params = {
591
591
  'Content-Type': 'application/json',
592
- 'Auth-Key': "Bearer " + localStorage.getItem('ext_token'),
592
+ 'Auth-Key': payload.authId,
593
593
  'c2c-request': window.location.hostname
594
594
  };
595
595
  const httpOptions = { headers: new HttpHeaders(params) };
596
- return this.http.post(environment.apiUrl + '/utilities/ext/ur/generate/conference/token', params, httpOptions);
596
+ return this.http.post(environment.apiUrl + '/utilities/ext/ur/generate/conference/token', payload, httpOptions);
597
597
  }
598
598
  // getConferenceCallToken(payload: any) {
599
599
  // console.log(payload, 'payload');
@@ -614,13 +614,7 @@ class ExtensionService {
614
614
  return this.http.post(environment.apiUrl + '/add/first/participant', payload, httpOptions);
615
615
  }
616
616
  addParticipant(payload) {
617
- const params = {
618
- "conferenceId": payload.conferenceId,
619
- "conferenceSid": payload.conferenceSid,
620
- "participantNumber": payload.participantNumber
621
- };
622
- const httpOptions = { headers: new HttpHeaders(params) };
623
- return this.http.post(environment.apiUrl + '/add/participant', payload, httpOptions);
617
+ return this.http.post(environment.apiUrl + '/utilities/ext/ur/add/participant', payload);
624
618
  }
625
619
  // getAllParticipants(id:any, payload: any) {
626
620
  // const params = {
@@ -2109,15 +2103,17 @@ class CallProgressComponent {
2109
2103
  });
2110
2104
  }
2111
2105
  startCall(callData) {
2106
+ var _a;
2112
2107
  return __awaiter(this, void 0, void 0, function* () {
2108
+ console.log(callData, 'callData');
2113
2109
  try {
2114
2110
  this.showRingAnimation = true;
2115
2111
  const payload = {
2116
2112
  channelId: environment.channelId,
2117
2113
  userId: localStorage.getItem('userId'),
2118
2114
  to: callData.phone,
2115
+ fromNumber: callData.from,
2119
2116
  scope: 'local',
2120
- fromNumber: callData.from
2121
2117
  };
2122
2118
  const response = yield this.initiateCall(payload);
2123
2119
  if (response.status == 200) {
@@ -2125,6 +2121,12 @@ class CallProgressComponent {
2125
2121
  this.getUserInformation(callAuthId);
2126
2122
  this.recordCall = recordCall; // Store the recordCall value
2127
2123
  const tokenData = yield this.getOutgoingCallToken(callAuthId);
2124
+ yield this.addParticipantToCall({
2125
+ from: callData === null || callData === void 0 ? void 0 : callData.from,
2126
+ route: "OUTGOING",
2127
+ participantNumber: callData === null || callData === void 0 ? void 0 : callData.phone,
2128
+ conferenceId: (_a = response === null || response === void 0 ? void 0 : response.callauth) === null || _a === void 0 ? void 0 : _a.id
2129
+ });
2128
2130
  yield this.connectToDevice(tokenData.token, callData);
2129
2131
  // Poll the status for 30-45 seconds
2130
2132
  this.pollCallStatus(callAuthId);
@@ -2148,6 +2150,11 @@ class CallProgressComponent {
2148
2150
  return yield this.extensionService.initiateCall(payload).toPromise();
2149
2151
  });
2150
2152
  }
2153
+ addParticipantToCall(payload) {
2154
+ return __awaiter(this, void 0, void 0, function* () {
2155
+ return yield this.extensionService.addParticipant(payload).toPromise();
2156
+ });
2157
+ }
2151
2158
  getCallAuthId(response) {
2152
2159
  return __awaiter(this, void 0, void 0, function* () {
2153
2160
  return {