@vgroup/dialbox 0.1.47 → 0.1.48
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/dialbox.component.mjs +4 -2
- package/esm2020/lib/service/extension.service.mjs +6 -5
- package/esm2020/lib/service/twilio.service.mjs +4 -3
- package/fesm2015/vgroup-dialbox.mjs +11 -7
- package/fesm2015/vgroup-dialbox.mjs.map +1 -1
- package/fesm2020/vgroup-dialbox.mjs +11 -7
- package/fesm2020/vgroup-dialbox.mjs.map +1 -1
- package/lib/service/extension.service.d.ts +1 -1
- package/lib/service/twilio.service.d.ts +2 -1
- package/package.json +1 -1
|
@@ -579,13 +579,14 @@ class ExtensionService {
|
|
|
579
579
|
// })
|
|
580
580
|
// );
|
|
581
581
|
// }
|
|
582
|
-
getIncomingCallToken() {
|
|
583
|
-
const
|
|
582
|
+
getIncomingCallToken(deviceId) {
|
|
583
|
+
const headers = {
|
|
584
584
|
'Content-Type': 'application/json',
|
|
585
585
|
'Auth-Key': "Bearer " + localStorage.getItem('ext_token')
|
|
586
586
|
};
|
|
587
|
-
const httpOptions = { headers: new HttpHeaders(params) };
|
|
588
|
-
|
|
587
|
+
// const httpOptions = { headers: new HttpHeaders(params) };
|
|
588
|
+
const params = new HttpParams().set('deviceId', deviceId);
|
|
589
|
+
return this.http.get(environment.apiUrl + '/utilities/twilio/incomingcall/token/web', { headers, params });
|
|
589
590
|
}
|
|
590
591
|
getOutgoingCallToken(payload) {
|
|
591
592
|
const params = {
|
|
@@ -1395,7 +1396,7 @@ class TwilioService {
|
|
|
1395
1396
|
if (this.tokenInitialized) {
|
|
1396
1397
|
return this.tokenInitialization$ || of(null);
|
|
1397
1398
|
}
|
|
1398
|
-
this.tokenInitialization$ = this.extensionService.getIncomingCallToken().pipe(tap((data) => {
|
|
1399
|
+
this.tokenInitialization$ = this.extensionService.getIncomingCallToken(this.deviceId).pipe(tap((data) => {
|
|
1399
1400
|
this.incomingCallToken = data.token;
|
|
1400
1401
|
localStorage.setItem('in-token', data.token);
|
|
1401
1402
|
this.tokenInitialized = true;
|
|
@@ -1408,7 +1409,8 @@ class TwilioService {
|
|
|
1408
1409
|
);
|
|
1409
1410
|
return this.tokenInitialization$;
|
|
1410
1411
|
}
|
|
1411
|
-
initializeTwilioDevice() {
|
|
1412
|
+
initializeTwilioDevice(deviceId) {
|
|
1413
|
+
this.deviceId = deviceId;
|
|
1412
1414
|
if (this.tokenInitialized && this.incomingCallToken) {
|
|
1413
1415
|
this.initializeDevice();
|
|
1414
1416
|
}
|
|
@@ -2266,7 +2268,7 @@ class DialboxComponent {
|
|
|
2266
2268
|
}
|
|
2267
2269
|
this.isInitialized = true;
|
|
2268
2270
|
// Initialize Twilio service
|
|
2269
|
-
this.twilioService.initializeTwilioDevice();
|
|
2271
|
+
this.twilioService.initializeTwilioDevice(this.deviceId);
|
|
2270
2272
|
}
|
|
2271
2273
|
}
|
|
2272
2274
|
// ngOnChange() {
|
|
@@ -2511,6 +2513,8 @@ class DialboxComponent {
|
|
|
2511
2513
|
this.registerDragElement();
|
|
2512
2514
|
}
|
|
2513
2515
|
ngOnChanges(changes) {
|
|
2516
|
+
if (changes['deviceId'] && this.deviceId) {
|
|
2517
|
+
}
|
|
2514
2518
|
if (changes['isDialpadHidden'] && !this.isDialpadHidden) {
|
|
2515
2519
|
this.getContactList();
|
|
2516
2520
|
this.getUserCallSetting();
|