@vgroup/dialbox 0.2.49 → 0.2.51
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.
- package/esm2020/lib/components/call-progress/call-progress.component.mjs +15 -20
- package/esm2020/lib/service/extension.service.mjs +22 -22
- package/fesm2015/vgroup-dialbox.mjs +39 -42
- package/fesm2015/vgroup-dialbox.mjs.map +1 -1
- package/fesm2020/vgroup-dialbox.mjs +35 -40
- package/fesm2020/vgroup-dialbox.mjs.map +1 -1
- package/lib/components/call-progress/call-progress.component.d.ts +1 -3
- package/package.json +1 -1
|
@@ -539,26 +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) {
|
|
543
|
-
return this.fetchBlockedCountries().pipe(switchMap(blockedCountries => {
|
|
544
|
-
return this.ipAddressService.getIpAddressInfo().pipe(switchMap(ipAddressInfo => {
|
|
545
|
-
const params = {
|
|
546
|
-
'Content-Type': 'application/json',
|
|
547
|
-
'Auth-Key': 'Bearer ' + localStorage.getItem('ext_token'),
|
|
548
|
-
'ip-address': ipAddressInfo.ip,
|
|
549
|
-
'ip-country': ipAddressInfo.address.country,
|
|
550
|
-
};
|
|
551
|
-
payload = Object.assign(Object.assign({}, payload), { proxy: ipAddressInfo.proxy.toString() });
|
|
552
|
-
const httpOptions = { headers: new HttpHeaders(params) };
|
|
553
|
-
return this.http.post(environment.apiUrl + '/utilities/ext/ur/initiate/call', payload, httpOptions).pipe(catchError(error => {
|
|
554
|
-
return throwError(error);
|
|
555
|
-
}));
|
|
556
|
-
}), catchError(error => {
|
|
557
|
-
// Catch error from getIpAddressInfo
|
|
558
|
-
return throwError(error);
|
|
559
|
-
}));
|
|
560
|
-
}));
|
|
561
|
-
}
|
|
562
542
|
// initiateCall(payload: any): Observable<any> {
|
|
563
543
|
// return this.fetchBlockedCountries().pipe(
|
|
564
544
|
// switchMap(blockedCountries => {
|
|
@@ -572,7 +552,7 @@ class ExtensionService {
|
|
|
572
552
|
// };
|
|
573
553
|
// payload = {...payload, proxy:ipAddressInfo.proxy.toString()}
|
|
574
554
|
// const httpOptions = { headers: new HttpHeaders(params) };
|
|
575
|
-
// return this.http.post<[]>(environment.apiUrl + '/utilities/ext/ur/initiate/
|
|
555
|
+
// return this.http.post<[]>(environment.apiUrl + '/utilities/ext/ur/initiate/call', payload, httpOptions).pipe(
|
|
576
556
|
// catchError(error => {
|
|
577
557
|
// return throwError(error);
|
|
578
558
|
// }),
|
|
@@ -586,6 +566,26 @@ class ExtensionService {
|
|
|
586
566
|
// })
|
|
587
567
|
// );
|
|
588
568
|
// }
|
|
569
|
+
initiateCall(payload) {
|
|
570
|
+
return this.fetchBlockedCountries().pipe(switchMap(blockedCountries => {
|
|
571
|
+
return this.ipAddressService.getIpAddressInfo().pipe(switchMap(ipAddressInfo => {
|
|
572
|
+
const params = {
|
|
573
|
+
'Content-Type': 'application/json',
|
|
574
|
+
'Auth-Key': 'Bearer ' + localStorage.getItem('ext_token'),
|
|
575
|
+
'ip-address': ipAddressInfo.ip,
|
|
576
|
+
'ip-country': ipAddressInfo.address.country,
|
|
577
|
+
};
|
|
578
|
+
payload = Object.assign(Object.assign({}, payload), { proxy: ipAddressInfo.proxy.toString() });
|
|
579
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
580
|
+
return this.http.post(environment.apiUrl + '/utilities/ext/ur/initiate/conference/call', payload, httpOptions).pipe(catchError(error => {
|
|
581
|
+
return throwError(error);
|
|
582
|
+
}));
|
|
583
|
+
}), catchError(error => {
|
|
584
|
+
// Catch error from getIpAddressInfo
|
|
585
|
+
return throwError(error);
|
|
586
|
+
}));
|
|
587
|
+
}));
|
|
588
|
+
}
|
|
589
589
|
getConferenceCallToken(payload) {
|
|
590
590
|
const params = {
|
|
591
591
|
"conferenceId": payload.conferenceId,
|
|
@@ -2120,13 +2120,13 @@ class CallProgressComponent {
|
|
|
2120
2120
|
};
|
|
2121
2121
|
const response = yield this.initiateCall(payload);
|
|
2122
2122
|
if (response.status == 200) {
|
|
2123
|
-
const {
|
|
2124
|
-
this.getUserInformation(
|
|
2125
|
-
|
|
2126
|
-
const tokenData = yield this.getOutgoingCallToken(
|
|
2123
|
+
const { id: callAuthId, recordCall } = yield this.getCallAuthId(response);
|
|
2124
|
+
this.getUserInformation(callAuthId);
|
|
2125
|
+
this.recordCall = recordCall; // Store the recordCall value
|
|
2126
|
+
const tokenData = yield this.getOutgoingCallToken(callAuthId);
|
|
2127
2127
|
yield this.connectToDevice(tokenData.token, callData);
|
|
2128
2128
|
// Poll the status for 30-45 seconds
|
|
2129
|
-
this.pollCallStatus(
|
|
2129
|
+
this.pollCallStatus(callAuthId);
|
|
2130
2130
|
}
|
|
2131
2131
|
else if (response.status == 201) {
|
|
2132
2132
|
swal("Error", response.message.join("<br/>"), "error");
|
|
@@ -2147,20 +2147,17 @@ class CallProgressComponent {
|
|
|
2147
2147
|
return yield this.extensionService.initiateCall(payload).toPromise();
|
|
2148
2148
|
});
|
|
2149
2149
|
}
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
return {
|
|
2158
|
-
authId: response.callauth.id,
|
|
2159
|
-
};
|
|
2150
|
+
getCallAuthId(response) {
|
|
2151
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2152
|
+
return {
|
|
2153
|
+
id: response.callauth.id,
|
|
2154
|
+
recordCall: response.callauth.recordCall
|
|
2155
|
+
};
|
|
2156
|
+
});
|
|
2160
2157
|
}
|
|
2161
2158
|
getOutgoingCallToken(callAuthId) {
|
|
2162
2159
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2163
|
-
return yield this.extensionService.
|
|
2160
|
+
return yield this.extensionService.getConferenceCallToken({ authId: callAuthId }).toPromise();
|
|
2164
2161
|
});
|
|
2165
2162
|
}
|
|
2166
2163
|
connectToDevice(token, callData) {
|
|
@@ -2388,10 +2385,10 @@ class CallProgressComponent {
|
|
|
2388
2385
|
};
|
|
2389
2386
|
const response = yield this.initiateCall(payload);
|
|
2390
2387
|
if (response.status == 200) {
|
|
2391
|
-
const {
|
|
2392
|
-
this.getUserInformation(
|
|
2393
|
-
|
|
2394
|
-
const tokenData = yield this.getOutgoingCallToken(
|
|
2388
|
+
const { id: callAuthId, recordCall } = yield this.getCallAuthId(response);
|
|
2389
|
+
this.getUserInformation(callAuthId);
|
|
2390
|
+
this.recordCall = recordCall;
|
|
2391
|
+
const tokenData = yield this.getOutgoingCallToken(callAuthId);
|
|
2395
2392
|
// Connect to new call
|
|
2396
2393
|
const options = {
|
|
2397
2394
|
codecPreferences: ['opus', 'pcmu'],
|
|
@@ -2429,7 +2426,7 @@ class CallProgressComponent {
|
|
|
2429
2426
|
// Setup event listeners for new call
|
|
2430
2427
|
this.setupEventListeners();
|
|
2431
2428
|
// Poll call status
|
|
2432
|
-
this.pollCallStatus(
|
|
2429
|
+
this.pollCallStatus(callAuthId);
|
|
2433
2430
|
console.log('New call initiated to:', phoneNumber);
|
|
2434
2431
|
this.cdr.detectChanges();
|
|
2435
2432
|
}
|