@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.
@@ -588,11 +588,11 @@ class ExtensionService {
588
588
  getConferenceCallToken(payload) {
589
589
  const params = {
590
590
  'Content-Type': 'application/json',
591
- 'Auth-Key': "Bearer " + localStorage.getItem('ext_token'),
591
+ 'Auth-Key': payload.authId,
592
592
  'c2c-request': window.location.hostname
593
593
  };
594
594
  const httpOptions = { headers: new HttpHeaders(params) };
595
- return this.http.post(environment.apiUrl + '/utilities/ext/ur/generate/conference/token', params, httpOptions);
595
+ return this.http.post(environment.apiUrl + '/utilities/ext/ur/generate/conference/token', payload, httpOptions);
596
596
  }
597
597
  // getConferenceCallToken(payload: any) {
598
598
  // console.log(payload, 'payload');
@@ -613,13 +613,7 @@ class ExtensionService {
613
613
  return this.http.post(environment.apiUrl + '/add/first/participant', payload, httpOptions);
614
614
  }
615
615
  addParticipant(payload) {
616
- const params = {
617
- "conferenceId": payload.conferenceId,
618
- "conferenceSid": payload.conferenceSid,
619
- "participantNumber": payload.participantNumber
620
- };
621
- const httpOptions = { headers: new HttpHeaders(params) };
622
- return this.http.post(environment.apiUrl + '/add/participant', payload, httpOptions);
616
+ return this.http.post(environment.apiUrl + '/utilities/ext/ur/add/participant', payload);
623
617
  }
624
618
  // getAllParticipants(id:any, payload: any) {
625
619
  // const params = {
@@ -2106,14 +2100,15 @@ class CallProgressComponent {
2106
2100
  });
2107
2101
  }
2108
2102
  async startCall(callData) {
2103
+ console.log(callData, 'callData');
2109
2104
  try {
2110
2105
  this.showRingAnimation = true;
2111
2106
  const payload = {
2112
2107
  channelId: environment.channelId,
2113
2108
  userId: localStorage.getItem('userId'),
2114
2109
  to: callData.phone,
2110
+ fromNumber: callData.from,
2115
2111
  scope: 'local',
2116
- fromNumber: callData.from
2117
2112
  };
2118
2113
  const response = await this.initiateCall(payload);
2119
2114
  if (response.status == 200) {
@@ -2121,6 +2116,12 @@ class CallProgressComponent {
2121
2116
  this.getUserInformation(callAuthId);
2122
2117
  this.recordCall = recordCall; // Store the recordCall value
2123
2118
  const tokenData = await this.getOutgoingCallToken(callAuthId);
2119
+ await this.addParticipantToCall({
2120
+ from: callData?.from,
2121
+ route: "OUTGOING",
2122
+ participantNumber: callData?.phone,
2123
+ conferenceId: response?.callauth?.id
2124
+ });
2124
2125
  await this.connectToDevice(tokenData.token, callData);
2125
2126
  // Poll the status for 30-45 seconds
2126
2127
  this.pollCallStatus(callAuthId);
@@ -2141,6 +2142,9 @@ class CallProgressComponent {
2141
2142
  async initiateCall(payload) {
2142
2143
  return await this.extensionService.initiateCall(payload).toPromise();
2143
2144
  }
2145
+ async addParticipantToCall(payload) {
2146
+ return await this.extensionService.addParticipant(payload).toPromise();
2147
+ }
2144
2148
  async getCallAuthId(response) {
2145
2149
  return {
2146
2150
  id: response.callauth.id,