@vgroup/dialbox 0.2.30 → 0.2.32

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.
@@ -3,7 +3,7 @@ import * as i0 from '@angular/core';
3
3
  import { Injectable, EventEmitter, Component, Input, Output, ViewChild, Inject, NgModule } from '@angular/core';
4
4
  import swal from 'sweetalert2';
5
5
  import { AsYouType } from 'libphonenumber-js';
6
- import { throwError, BehaviorSubject, forkJoin, of, interval, Subscription } from 'rxjs';
6
+ import { throwError, BehaviorSubject, of, interval, Subscription } from 'rxjs';
7
7
  import * as i1 from '@angular/common/http';
8
8
  import { HttpHeaders, HttpParams, HttpClientModule } from '@angular/common/http';
9
9
  import { catchError, switchMap, map, tap, shareReplay } from 'rxjs/operators';
@@ -68,7 +68,7 @@ const environment = {
68
68
  production: false,
69
69
  secureCookies: true,
70
70
  feUrl: 'https://dev.vgroupinc.com:91/',
71
- apiUrl: 'https://apis.vgroupinc.com/test_softphone',
71
+ apiUrl: 'https://dev-api-t10.vgroupinc.com/dev_softphone_p91',
72
72
  captchaKey: "6LfpOmEaAAAAAGsI6JXlMzOl3b7rW4YmYXFDjldD",
73
73
  stripePublishableKey: "pk_test_51K6aTuBiNVV2TMlQfmBWY8jziwiDo0IZ3TrqWPqth1m32cpMAAg5Qpi2AlSMDEAX6hCZRBXoTzBB1uQQLc8B4tco00q2SgG6zO",
74
74
  sessionTimeout: 15,
@@ -574,19 +574,63 @@ class ExtensionService {
574
574
  };
575
575
  payload = Object.assign(Object.assign({}, payload), { proxy: ipAddressInfo.proxy.toString() });
576
576
  const httpOptions = { headers: new HttpHeaders(params) };
577
- const api1$ = this.http.post(`${environment.apiUrl}/utilities/ext/ur/initiate/call`, payload, httpOptions);
578
- const api2$ = this.http.post(`${environment.apiUrl}/utilities/ext/ur/initiate/conference/call`, payload, httpOptions);
579
- return forkJoin([api1$, api2$]).pipe(catchError(error => throwError(() => error)));
580
- }), catchError(error => throwError(() => error)));
577
+ return this.http.post(environment.apiUrl + '/utilities/ext/ur/initiate/conference/call', payload, httpOptions).pipe(catchError(error => {
578
+ return throwError(error);
579
+ }));
580
+ }), catchError(error => {
581
+ // Catch error from getIpAddressInfo
582
+ return throwError(error);
583
+ }));
581
584
  }));
582
585
  }
586
+ // initiateCall(payload: any): Observable<any> {
587
+ // return this.fetchBlockedCountries().pipe(
588
+ // switchMap(blockedCountries => {
589
+ // return this.ipAddressService.getIpAddressInfo().pipe(
590
+ // switchMap(ipAddressInfo => {
591
+ // const params = {
592
+ // 'Content-Type': 'application/json',
593
+ // 'Auth-Key': 'Bearer ' + localStorage.getItem('ext_token'),
594
+ // 'ip-address': ipAddressInfo.ip,
595
+ // 'ip-country': ipAddressInfo.address.country,
596
+ // };
597
+ // payload = { ...payload, proxy: ipAddressInfo.proxy.toString() };
598
+ // const httpOptions = { headers: new HttpHeaders(params) };
599
+ // const api1$ = this.http.post(
600
+ // `${environment.apiUrl}/utilities/ext/ur/initiate/call`,
601
+ // payload,
602
+ // httpOptions
603
+ // );
604
+ // const api2$ = this.http.post(
605
+ // `${environment.apiUrl}/utilities/ext/ur/initiate/conference/call`,
606
+ // payload,
607
+ // httpOptions
608
+ // );
609
+ // return forkJoin([api1$, api2$]).pipe(
610
+ // catchError(error => throwError(() => error))
611
+ // );
612
+ // }),
613
+ // catchError(error => throwError(() => error))
614
+ // );
615
+ // })
616
+ // );
617
+ // }
618
+ // getConferenceCallToken(payload: any) {
619
+ // const params = {
620
+ // "conferenceId": payload.conferenceId,
621
+ // "userId": payload.userId
622
+ // }
623
+ // const httpOptions = { headers: new HttpHeaders(params) };
624
+ // return this.http.post<[]>(environment.apiUrl + '/utilities/ext/ur/generate/conference/token', params, httpOptions);
625
+ // }
583
626
  getConferenceCallToken(payload) {
584
627
  const params = {
585
- "conferenceId": payload.conferenceId,
586
- "userId": payload.userId
628
+ 'Content-Type': 'application/json',
629
+ 'Auth-Key': "Bearer " + localStorage.getItem('ext_token'),
630
+ 'c2c-request': window.location.hostname
587
631
  };
588
632
  const httpOptions = { headers: new HttpHeaders(params) };
589
- return this.http.post(environment.apiUrl + '/ur/generate/conference/token', params, httpOptions);
633
+ return this.http.post(environment.apiUrl + '/utilities/ext/ur/generate/token', payload, httpOptions);
590
634
  }
591
635
  addFirstParticipant(payload) {
592
636
  const params = {
@@ -2105,7 +2149,7 @@ class CallProgressComponent {
2105
2149
  const { id: callAuthId, recordCall } = yield this.getCallAuthId(response);
2106
2150
  this.getUserInformation(callAuthId);
2107
2151
  this.recordCall = recordCall; // Store the recordCall value
2108
- const tokenData = yield this.getOutgoingCallToken(callAuthId);
2152
+ const tokenData = yield this.getConferenceCallToken(callAuthId);
2109
2153
  yield this.connectToDevice(tokenData.token, callData);
2110
2154
  // Poll the status for 30-45 seconds
2111
2155
  this.pollCallStatus(callAuthId);
@@ -2137,9 +2181,9 @@ class CallProgressComponent {
2137
2181
  };
2138
2182
  });
2139
2183
  }
2140
- getOutgoingCallToken(callAuthId) {
2184
+ getConferenceCallToken(callAuthId) {
2141
2185
  return __awaiter(this, void 0, void 0, function* () {
2142
- return yield this.extensionService.getOutgoingCallToken({ authId: callAuthId }).toPromise();
2186
+ return yield this.extensionService.getConferenceCallToken({ authId: callAuthId }).toPromise();
2143
2187
  });
2144
2188
  }
2145
2189
  connectToDevice(token, callData) {
@@ -2368,7 +2412,7 @@ class CallProgressComponent {
2368
2412
  const { id: callAuthId, recordCall } = yield this.getCallAuthId(response);
2369
2413
  this.getUserInformation(callAuthId);
2370
2414
  this.recordCall = recordCall;
2371
- const tokenData = yield this.getOutgoingCallToken(callAuthId);
2415
+ const tokenData = yield this.getConferenceCallToken(callAuthId);
2372
2416
  // Connect to new call
2373
2417
  const options = {
2374
2418
  codecPreferences: ['opus', 'pcmu'],