@vgroup/dialbox 0.4.152 → 0.4.154
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 -4
- package/esm2020/lib/service/incomeing-call-socket.service.mjs +5 -4
- package/fesm2015/vgroup-dialbox.mjs +8 -7
- package/fesm2015/vgroup-dialbox.mjs.map +1 -1
- package/fesm2020/vgroup-dialbox.mjs +7 -6
- package/fesm2020/vgroup-dialbox.mjs.map +1 -1
- package/lib/service/incomeing-call-socket.service.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1622,14 +1622,15 @@ class IncomeingCallSocketService {
|
|
|
1622
1622
|
constructor() {
|
|
1623
1623
|
this.eventSubject = new Subject();
|
|
1624
1624
|
}
|
|
1625
|
-
connect() {
|
|
1625
|
+
connect(deviceId) {
|
|
1626
1626
|
// Replace with your WebSocket URL
|
|
1627
1627
|
this.socket = new WebSocket(`${environment.websocketUrl}incoming/call`);
|
|
1628
1628
|
this.socket.onopen = () => {
|
|
1629
1629
|
console.log("WebSocket connected");
|
|
1630
1630
|
// Authenticate (if needed)
|
|
1631
1631
|
const authMessage = { "incomingCall": {
|
|
1632
|
-
"userId": localStorage.getItem('userId')
|
|
1632
|
+
"userId": localStorage.getItem('userId'),
|
|
1633
|
+
"deviceId": deviceId
|
|
1633
1634
|
} };
|
|
1634
1635
|
// {
|
|
1635
1636
|
// userId: localStorage.getItem('userId'),
|
|
@@ -1654,7 +1655,7 @@ class IncomeingCallSocketService {
|
|
|
1654
1655
|
};
|
|
1655
1656
|
this.socket.onclose = () => {
|
|
1656
1657
|
console.warn("WebSocket disconnected");
|
|
1657
|
-
setTimeout(() => this.connect(), 100); // Auto-reconnect
|
|
1658
|
+
setTimeout(() => this.connect(deviceId), 100); // Auto-reconnect
|
|
1658
1659
|
};
|
|
1659
1660
|
}
|
|
1660
1661
|
createAudioBase() {
|
|
@@ -3579,16 +3580,16 @@ class DialboxComponent {
|
|
|
3579
3580
|
// Ensure Twilio is initialized even when dialpad starts hidden,
|
|
3580
3581
|
// so we can auto-open on incoming calls.
|
|
3581
3582
|
this.initializeTwilio();
|
|
3582
|
-
this.incomeingCallSocketService.connect();
|
|
3583
|
+
this.incomeingCallSocketService.connect(this.deviceId);
|
|
3583
3584
|
try {
|
|
3584
3585
|
this.incomeingCallSocketService.listen().subscribe(async (incomingCallData) => {
|
|
3585
3586
|
// const data = JSON.parse(incomingCallData.data);
|
|
3586
3587
|
// console.log("WS Event Received:", incomingCallData);
|
|
3587
3588
|
// console.log("WS Event Received:", incomingCallData.data);
|
|
3588
3589
|
this.twilioService.conferenceCallInfo = incomingCallData;
|
|
3589
|
-
if (!!incomingCallData
|
|
3590
|
+
if (!!incomingCallData[0]?.participants?.length) {
|
|
3590
3591
|
// this.incomingCallsList = incomingCallData.participants.filter((item: any) => !item.isLeft) || [];
|
|
3591
|
-
this.incomingCallsList = incomingCallData.participants || [];
|
|
3592
|
+
this.incomingCallsList = incomingCallData[0].participants || [];
|
|
3592
3593
|
this.isCallInProgress = true;
|
|
3593
3594
|
this.isDialpadHidden = false;
|
|
3594
3595
|
this.isIncomingCallnotification = false;
|