@vgroup/dialbox 0.4.151 → 0.4.153

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.
@@ -728,7 +728,7 @@ class ExtensionService {
728
728
  });
729
729
  return this.ipAddressService.getIpAddressInfo().pipe(switchMap((ipAddressInfo) => {
730
730
  const httpOptions = { headers: headers };
731
- payload = { ...payload, ipAddress: ipAddressInfo?.ip, ipCountry: ipAddressInfo?.country };
731
+ payload = { ...payload, ipAddress: ipAddressInfo?.ip, ipCountry: ipAddressInfo?.address?.country };
732
732
  return this.http.post(environment.apiUrl + `/utilities/twilio/incoming/conference/ip`, payload, httpOptions);
733
733
  }), catchError((error) => {
734
734
  // Properly catch errors
@@ -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() {
@@ -2521,6 +2522,7 @@ class CallProgressComponent {
2521
2522
  // this.call = await this.twilioService.connect('');
2522
2523
  this.twilioService.addIncomingParticipant(data?.id, this.twilioService.conferenceCallInfo.conferenceId).subscribe((res) => {
2523
2524
  console.log(res, 'bhhhhhhhhhhhhhhhhhhh');
2525
+ this.incomeingCallSocketService.pause();
2524
2526
  this.isCurrentIncomingCallList.push(data?.id || data?.participantId);
2525
2527
  data.isAcceptCall = true;
2526
2528
  // this.currentCall = data;
@@ -2534,6 +2536,7 @@ class CallProgressComponent {
2534
2536
  data.isAcceptCall = true;
2535
2537
  // this.currentCall = data;
2536
2538
  this.setIncomingCallStatus(data);
2539
+ this.incomeingCallSocketService.pause();
2537
2540
  }
2538
2541
  // } else if(data?.status == 'ringing'){
2539
2542
  // this.twilioService.addIncomingParticipant(data?.id, this.twilioService.conferenceCallInfo.conferenceId).subscribe((data: any) => {
@@ -3577,7 +3580,7 @@ class DialboxComponent {
3577
3580
  // Ensure Twilio is initialized even when dialpad starts hidden,
3578
3581
  // so we can auto-open on incoming calls.
3579
3582
  this.initializeTwilio();
3580
- this.incomeingCallSocketService.connect();
3583
+ this.incomeingCallSocketService.connect(this.deviceId);
3581
3584
  try {
3582
3585
  this.incomeingCallSocketService.listen().subscribe(async (incomingCallData) => {
3583
3586
  // const data = JSON.parse(incomingCallData.data);