@vgroup/dialbox 0.2.35 → 0.2.36

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.
@@ -539,33 +539,6 @@ class ExtensionService {
539
539
  const httpOptions = { headers: new HttpHeaders(params) };
540
540
  return this.http.put(environment.apiUrl + '/utilities/softphone/update/callerid/label', dtModel, httpOptions);
541
541
  }
542
- // initiateCall(payload: any): Observable<any> {
543
- // return this.fetchBlockedCountries().pipe(
544
- // switchMap(blockedCountries => {
545
- // return this.ipAddressService.getIpAddressInfo().pipe(
546
- // switchMap(ipAddressInfo => {
547
- // const params = {
548
- // 'Content-Type': 'application/json',
549
- // 'Auth-Key': 'Bearer ' + localStorage.getItem('ext_token'),
550
- // 'ip-address': ipAddressInfo.ip,
551
- // 'ip-country': ipAddressInfo.address.country,
552
- // };
553
- // payload = {...payload, proxy:ipAddressInfo.proxy.toString()}
554
- // const httpOptions = { headers: new HttpHeaders(params) };
555
- // return this.http.post<[]>(environment.apiUrl + '/utilities/ext/ur/initiate/call', payload, httpOptions).pipe(
556
- // catchError(error => {
557
- // return throwError(error);
558
- // }),
559
- // );
560
- // }),
561
- // catchError(error => {
562
- // // Catch error from getIpAddressInfo
563
- // return throwError(error);
564
- // })
565
- // );
566
- // })
567
- // );
568
- // }
569
542
  initiateCall(payload) {
570
543
  return this.fetchBlockedCountries().pipe(switchMap(blockedCountries => {
571
544
  return this.ipAddressService.getIpAddressInfo().pipe(switchMap(ipAddressInfo => {
@@ -577,7 +550,7 @@ class ExtensionService {
577
550
  };
578
551
  payload = Object.assign(Object.assign({}, payload), { proxy: ipAddressInfo.proxy.toString() });
579
552
  const httpOptions = { headers: new HttpHeaders(params) };
580
- return this.http.post(environment.apiUrl + '/utilities/ext/ur/initiate/conference/call', payload, httpOptions).pipe(catchError(error => {
553
+ return this.http.post(environment.apiUrl + '/utilities/ext/ur/initiate/call', payload, httpOptions).pipe(catchError(error => {
581
554
  return throwError(error);
582
555
  }));
583
556
  }), catchError(error => {
@@ -591,51 +564,46 @@ class ExtensionService {
591
564
  // switchMap(blockedCountries => {
592
565
  // return this.ipAddressService.getIpAddressInfo().pipe(
593
566
  // switchMap(ipAddressInfo => {
594
- // const params = {
595
- // 'Content-Type': 'application/json',
596
- // 'Auth-Key': 'Bearer ' + localStorage.getItem('ext_token'),
597
- // 'ip-address': ipAddressInfo.ip,
598
- // 'ip-country': ipAddressInfo.address.country,
599
- // };
600
- // payload = { ...payload, proxy: ipAddressInfo.proxy.toString() };
601
- // const httpOptions = { headers: new HttpHeaders(params) };
602
- // const api1$ = this.http.post(
603
- // `${environment.apiUrl}/utilities/ext/ur/initiate/call`,
604
- // payload,
605
- // httpOptions
606
- // );
607
- // const api2$ = this.http.post(
608
- // `${environment.apiUrl}/utilities/ext/ur/initiate/conference/call`,
609
- // payload,
610
- // httpOptions
611
- // );
612
- // return forkJoin([api1$, api2$]).pipe(
613
- // catchError(error => throwError(() => error))
614
- // );
567
+ // const params = {
568
+ // 'Content-Type': 'application/json',
569
+ // 'Auth-Key': 'Bearer ' + localStorage.getItem('ext_token'),
570
+ // 'ip-address': ipAddressInfo.ip,
571
+ // 'ip-country': ipAddressInfo.address.country,
572
+ // };
573
+ // payload = {...payload, proxy:ipAddressInfo.proxy.toString()}
574
+ // const httpOptions = { headers: new HttpHeaders(params) };
575
+ // return this.http.post<[]>(environment.apiUrl + '/utilities/ext/ur/initiate/conference/call', payload, httpOptions).pipe(
576
+ // catchError(error => {
577
+ // return throwError(error);
578
+ // }),
579
+ // );
615
580
  // }),
616
- // catchError(error => throwError(() => error))
581
+ // catchError(error => {
582
+ // // Catch error from getIpAddressInfo
583
+ // return throwError(error);
584
+ // })
617
585
  // );
618
586
  // })
619
587
  // );
620
588
  // }
621
- // getConferenceCallToken(payload: any) {
622
- // const params = {
623
- // "conferenceId": payload.conferenceId,
624
- // "userId": payload.userId
625
- // }
626
- // const httpOptions = { headers: new HttpHeaders(params) };
627
- // return this.http.post<[]>(environment.apiUrl + '/utilities/ext/ur/generate/conference/token', params, httpOptions);
628
- // }
629
589
  getConferenceCallToken(payload) {
630
- console.log(payload, 'payload');
631
590
  const params = {
632
- 'Content-Type': 'application/json',
633
- 'Auth-Key': "Bearer " + localStorage.getItem('ext_token'),
634
- 'c2c-request': window.location.hostname
591
+ "conferenceId": payload.conferenceId,
592
+ "userId": payload.userId
635
593
  };
636
594
  const httpOptions = { headers: new HttpHeaders(params) };
637
- return this.http.post(environment.apiUrl + '/utilities/ext/ur/generate/token', payload, httpOptions);
595
+ return this.http.post(environment.apiUrl + '/utilities/ext/ur/generate/conference/token', params, httpOptions);
638
596
  }
597
+ // getConferenceCallToken(payload: any) {
598
+ // console.log(payload, 'payload');
599
+ // const params = {
600
+ // 'Content-Type': 'application/json',
601
+ // 'Auth-Key': "Bearer " + localStorage.getItem('ext_token'),
602
+ // 'c2c-request': window.location.hostname
603
+ // }
604
+ // const httpOptions = { headers: new HttpHeaders(params) };
605
+ // return this.http.post<[]>(environment.apiUrl + '/utilities/ext/ur/generate/token', payload, httpOptions);
606
+ // }
639
607
  addFirstParticipant(payload) {
640
608
  const params = {
641
609
  "conferenceId": payload.conferenceId,
@@ -2155,7 +2123,7 @@ class CallProgressComponent {
2155
2123
  const { id: callAuthId, recordCall } = yield this.getCallAuthId(response);
2156
2124
  this.getUserInformation(callAuthId);
2157
2125
  this.recordCall = recordCall; // Store the recordCall value
2158
- const tokenData = yield this.getConferenceCallToken(response.conferenceId);
2126
+ const tokenData = yield this.getOutgoingCallToken(callAuthId);
2159
2127
  yield this.connectToDevice(tokenData.token, callData);
2160
2128
  // Poll the status for 30-45 seconds
2161
2129
  this.pollCallStatus(callAuthId);
@@ -2187,10 +2155,9 @@ class CallProgressComponent {
2187
2155
  };
2188
2156
  });
2189
2157
  }
2190
- getConferenceCallToken(conferenceId) {
2158
+ getOutgoingCallToken(callAuthId) {
2191
2159
  return __awaiter(this, void 0, void 0, function* () {
2192
- console.log(conferenceId, 'conferenceId');
2193
- return yield this.extensionService.getConferenceCallToken({ conferenceId: conferenceId }).toPromise();
2160
+ return yield this.extensionService.getOutgoingCallToken({ authId: callAuthId }).toPromise();
2194
2161
  });
2195
2162
  }
2196
2163
  connectToDevice(token, callData) {
@@ -2421,7 +2388,7 @@ class CallProgressComponent {
2421
2388
  const { id: callAuthId, recordCall } = yield this.getCallAuthId(response);
2422
2389
  this.getUserInformation(callAuthId);
2423
2390
  this.recordCall = recordCall;
2424
- const tokenData = yield this.getConferenceCallToken(response.conferenceId);
2391
+ const tokenData = yield this.getOutgoingCallToken(callAuthId);
2425
2392
  // Connect to new call
2426
2393
  const options = {
2427
2394
  codecPreferences: ['opus', 'pcmu'],