@vgroup/dialbox 0.3.76 → 0.3.78

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.
@@ -1803,7 +1803,19 @@ class CallProgressComponent {
1803
1803
  // Check if there's an active ongoing call
1804
1804
  this.newIncomingCallsList.forEach((res) => {
1805
1805
  if (this.currentCallList.findIndex((item) => item.id == res.id) == -1) {
1806
- this.currentCallList.push({ ...res, img: 'assets/images/user.jpg', isIncomingCall: true, isHold: res.isHold, isMute: false, isConference: false, isAcceptCall: false, dial: true, phone: res?.from, participantId: res.id });
1806
+ this.currentCallList.push({
1807
+ ...res,
1808
+ img: 'assets/images/user.jpg',
1809
+ isIncomingCall: res.direction == "incoming-call",
1810
+ isHold: res.isHold,
1811
+ isMute: false,
1812
+ isConference: res.isConference,
1813
+ isAcceptCall: this.getStatus(res),
1814
+ dial: true,
1815
+ phone: res.direction == "incoming-call" ? res?.from : res?.to,
1816
+ participantId: res.id,
1817
+ name: res.name,
1818
+ });
1807
1819
  }
1808
1820
  });
1809
1821
  }
@@ -1824,6 +1836,27 @@ class CallProgressComponent {
1824
1836
  }
1825
1837
  console.log('currentCallList', this.currentCallList);
1826
1838
  }
1839
+ getStatus(res) {
1840
+ if (res.direction == "incoming-call") {
1841
+ if (res.status == "participant-join" || res.status == "participant-hold" || res.status == "participant-mute") {
1842
+ return true;
1843
+ }
1844
+ else {
1845
+ return false;
1846
+ }
1847
+ }
1848
+ else if (res.direction == "outgoing-call") {
1849
+ if (res.status == "participant-join" || res.status == "participant-hold" || res.status == "participant-mute") {
1850
+ return true;
1851
+ }
1852
+ else {
1853
+ return false;
1854
+ }
1855
+ }
1856
+ else {
1857
+ return false;
1858
+ }
1859
+ }
1827
1860
  ngAfterViewInit() {
1828
1861
  // this.isRecording = false;
1829
1862
  // setTimeout(() => {
@@ -3018,20 +3051,22 @@ class DialboxComponent {
3018
3051
  // console.log("WS Event Received:", incomingCallData.data);
3019
3052
  this.twilioService.conferenceCallInfo = incomingCallData;
3020
3053
  if (!!incomingCallData.participants) {
3021
- this.incomingCallsList = incomingCallData.participants.filter((item) => !item.isLeft) || [];
3022
- if (this.incomingCallsList.length) {
3023
- this.isCallInProgress = true;
3024
- this.isDialpadHidden = false;
3025
- }
3026
- else {
3027
- this.callData = [];
3028
- this.incomingCallsList = [];
3029
- this.isDialpadHidden = true;
3030
- }
3054
+ // this.incomingCallsList = incomingCallData.participants.filter((item: any) => !item.isLeft) || [];
3055
+ this.incomingCallsList = incomingCallData.participants || [];
3056
+ // if (this.incomingCallsList.length) {
3057
+ this.isCallInProgress = true;
3058
+ this.isDialpadHidden = false;
3059
+ // } else {
3060
+ // this.callData = [];
3061
+ // this.incomingCallsList = [];
3062
+ // this.isDialpadHidden = true;
3063
+ // }
3031
3064
  }
3032
3065
  else {
3033
3066
  this.callData = [];
3034
3067
  this.incomingCallsList = [];
3068
+ this.isCallInProgress = false;
3069
+ this.isDialpadHidden = false;
3035
3070
  }
3036
3071
  // incomingCallData.participants.length ? incomingCallData.participants.filter((item: any) => !item.isLeft) : [];
3037
3072
  // this.initializeTwilio();