@vgroup/dialbox 0.6.57 → 0.6.58

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.
@@ -2148,7 +2148,7 @@ class CallProgressComponent {
2148
2148
  }
2149
2149
  getStatus(res) {
2150
2150
  if (res?.direction == "incoming-call") {
2151
- return res?.callStatus == "participant-join" || res?.callStatus == "participant-hold" || res?.callStatus == 'connected' ? true : this.incomeingCallSocketService.isCurrentIncomingCallList.includes(res.id);
2151
+ return res?.callStatus == "participant-join" || res?.callStatus == "participant-mute" || res?.callStatus == "participant-hold" || res?.callStatus == 'connected' ? true : this.incomeingCallSocketService.isCurrentIncomingCallList.includes(res.id);
2152
2152
  }
2153
2153
  else {
2154
2154
  if (res.status == 'answered' && res.direction == "incoming-call") {
@@ -2239,43 +2239,8 @@ class CallProgressComponent {
2239
2239
  // this.getUserInformation(callAuthId)
2240
2240
  this.recordCall = recordCall; // Store the recordCall value
2241
2241
  // const tokenData: any = await this.getOutgoingCallToken(callAuthId);
2242
- await this.connectToDevice(callAuthId, callData, tokenData);
2242
+ await this.connectToDevice(callAuthId, callData, tokenData, response);
2243
2243
  await this.pollCallStatus(callAuthId);
2244
- setTimeout(async () => {
2245
- try {
2246
- // **************need to update*******************
2247
- let addClientParticipantRes = this.addClientParticipant({
2248
- from: callData?.from,
2249
- route: "OUTGOING",
2250
- participantNumber: callData?.phone,
2251
- conferenceId: response?.callauth?.id,
2252
- userId: this.userId || localStorage.getItem('userId'),
2253
- proxy: '',
2254
- countrycode: '',
2255
- deviceId: this.deviceId,
2256
- clientSid: this.call?.parameters['CallSid']
2257
- });
2258
- console.log('addClientParticipantRes', addClientParticipantRes);
2259
- this.addRes = await this.addParticipantToCall({
2260
- from: callData?.from,
2261
- route: "OUTGOING",
2262
- participantNumber: callData?.phone,
2263
- conferenceId: response?.callauth?.id,
2264
- userId: this.userId || localStorage.getItem('userId'),
2265
- proxy: '',
2266
- countrycode: '',
2267
- deviceId: this.deviceId,
2268
- });
2269
- this.isNewAddedCall = false;
2270
- this.extensionService.isLoadershow.next(false);
2271
- this.isLoadershown.emit(false);
2272
- await this.getAllParticipants(this.addRes?.conferenceSid);
2273
- console.log('Initial participantId:', this.addRes?.participantId);
2274
- }
2275
- catch (e) {
2276
- console.error('Error adding initial participant:', e);
2277
- }
2278
- }, 1300);
2279
2244
  // Poll the status for 30-45 seconds
2280
2245
  }
2281
2246
  else if (response.status == 201) {
@@ -2374,7 +2339,7 @@ class CallProgressComponent {
2374
2339
  async getOutgoingCallToken(callAuthId) {
2375
2340
  return await this.extensionService.getConferenceCallToken({ authId: callAuthId }).toPromise();
2376
2341
  }
2377
- async connectToDevice(token, callData, tokenData) {
2342
+ async connectToDevice(token, callData, tokenData, response) {
2378
2343
  const options = {
2379
2344
  codecPreferences: ['opus', 'pcmu'],
2380
2345
  closeProtection: true,
@@ -2391,11 +2356,49 @@ class CallProgressComponent {
2391
2356
  rtcConstraints: { audio: true },
2392
2357
  });
2393
2358
  this.twilioService.call = this.call;
2359
+ this.setUpParticipent(callData, response);
2394
2360
  console.log('test98998111111', this.call);
2395
2361
  console.log('testdevice', this.twilioService.device);
2396
2362
  // this.call['callInfo'] = JSON.parse(JSON.stringify(callData));
2397
2363
  this.setupEventListeners();
2398
2364
  }
2365
+ setUpParticipent(callData, response) {
2366
+ setTimeout(async () => {
2367
+ try {
2368
+ // **************need to update*******************
2369
+ let addClientParticipantRes = this.addClientParticipant({
2370
+ from: callData?.from,
2371
+ route: "OUTGOING",
2372
+ participantNumber: callData?.phone,
2373
+ conferenceId: response?.callauth?.id,
2374
+ userId: this.userId || localStorage.getItem('userId'),
2375
+ proxy: '',
2376
+ countrycode: '',
2377
+ deviceId: this.deviceId,
2378
+ clientSid: this.call?.parameters['CallSid']
2379
+ });
2380
+ console.log('addClientParticipantRes', addClientParticipantRes);
2381
+ this.addRes = await this.addParticipantToCall({
2382
+ from: callData?.from,
2383
+ route: "OUTGOING",
2384
+ participantNumber: callData?.phone,
2385
+ conferenceId: response?.callauth?.id,
2386
+ userId: this.userId || localStorage.getItem('userId'),
2387
+ proxy: '',
2388
+ countrycode: '',
2389
+ deviceId: this.deviceId,
2390
+ });
2391
+ this.isNewAddedCall = false;
2392
+ this.extensionService.isLoadershow.next(false);
2393
+ this.isLoadershown.emit(false);
2394
+ await this.getAllParticipants(this.addRes?.conferenceSid);
2395
+ console.log('Initial participantId:', this.addRes?.participantId);
2396
+ }
2397
+ catch (e) {
2398
+ console.error('Error adding initial participant:', e);
2399
+ }
2400
+ }, 1300);
2401
+ }
2399
2402
  setupEventListeners() {
2400
2403
  this.startTimer();
2401
2404
  this.device?.on('error', (err) => {
@@ -3117,13 +3120,9 @@ class CallProgressComponent {
3117
3120
  }
3118
3121
  else if (this.callStatus === 'completed') {
3119
3122
  clearInterval(intervalId);
3120
- console.log('test1');
3121
3123
  this.endCall();
3122
3124
  this.stopRecording();
3123
3125
  }
3124
- else if (this.callStatus === 'ringing') {
3125
- // Continue polling; do not clear the interval yet
3126
- }
3127
3126
  }
3128
3127
  }
3129
3128
  catch (error) {