@vgroup/dialbox 0.6.3-0.10 → 0.6.3-0.12

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.
@@ -1843,41 +1843,41 @@ class CallProgressComponent {
1843
1843
  console.log(ourNumber, 'ourNumber');
1844
1844
  if (ourNumber?.id) {
1845
1845
  this.newIncomingCallsList[i].participants.forEach(async (res) => {
1846
- if (res?.to == 'c2c_softphone_client' && this.deviceNumberList.includes(res?.from)) {
1846
+ if (res?.to == 'c2c_softphone_client') {
1847
1847
  this.hostnumber = res;
1848
1848
  }
1849
1849
  else {
1850
1850
  let contact = {};
1851
1851
  if (this.contacts?.length) {
1852
- contact = this.contacts.find((resData) => resData?.numbersList[0]?.number == (res.direction == "incoming-call" ? res?.from : res?.to));
1852
+ contact = this.contacts.find((resData) => resData?.numbersList[0]?.number == (res?.direction == "incoming-call" ? res?.from : res?.to));
1853
1853
  }
1854
- if (this.currentCallList.length > 0) {
1854
+ if (this.currentCallList?.length > 0) {
1855
1855
  let index = this.currentCallList.findIndex((item) => item.id == res.id);
1856
1856
  if (index == -1 && !res.isLeft) {
1857
1857
  this.currentCallList.push({
1858
1858
  ...res,
1859
- img: res.direction == "incoming-call" ? res?.toImage : res?.fromImage || contact?.image || 'assets/images/user.jpg',
1860
- isIncomingCall: res.direction == "incoming-call",
1861
- isHold: res.isHold,
1859
+ img: res?.direction == "incoming-call" ? res?.toImage : res?.fromImage || contact?.image || 'assets/images/user.jpg',
1860
+ isIncomingCall: res?.direction == "incoming-call",
1861
+ isHold: res?.isHold,
1862
1862
  isMute: false,
1863
- isConference: res.isConference,
1864
- isAcceptCall: res.direction == "incoming-call" ? this.getStatus(res) : true,
1863
+ isConference: res?.isConference,
1864
+ isAcceptCall: res?.direction == "incoming-call" ? this.getStatus(res) : true,
1865
1865
  dial: true,
1866
- phone: res.direction == "incoming-call" ? res?.from : res?.to,
1867
- participantId: res.id,
1868
- conferenceSid: callInfo.conferenceSid,
1869
- name: res.name || res?.fromName || res?.toName,
1870
- time: this.getTimeDifference(res.joinedAt || new Date().toUTCString()),
1866
+ phone: res?.direction == "incoming-call" ? res?.from : res?.to,
1867
+ participantId: res?.id,
1868
+ conferenceSid: callInfo?.conferenceSid,
1869
+ name: res?.name || res?.fromName || res?.toName,
1870
+ time: this.getTimeDifference(res?.joinedAt || new Date().toUTCString()),
1871
1871
  });
1872
1872
  if (this.showContactsPanel) {
1873
- this.getAllParticipants(this.currentCall.conferenceSid);
1873
+ this.getAllParticipants(this.currentCall?.conferenceSid);
1874
1874
  this.applyFilter();
1875
1875
  }
1876
1876
  }
1877
- else if (index != -1 && res.isLeft) {
1877
+ else if (index != -1 && res?.isLeft) {
1878
1878
  if (this.currentCallList[index]?.id == this.currentCall?.id) {
1879
1879
  this.currentCallList.splice(index, 1);
1880
- this.currentCall = this.currentCallList.length > 0 ? this.currentCallList[0] : {};
1880
+ this.currentCall = this.currentCallList?.length > 0 ? this.currentCallList[0] : {};
1881
1881
  if (this.currentCall?.isHold && !this.currentCall?.isConference) {
1882
1882
  await this.onholdOrUnholdParticipant({
1883
1883
  participantId: [this.currentCall?.participantId],
@@ -1889,7 +1889,7 @@ class CallProgressComponent {
1889
1889
  }
1890
1890
  else if (this.currentCall?.isHold && this.currentCall?.isConference) {
1891
1891
  let conferenceCalllist = this.currentCallList.filter((item) => item.isConference && item.conferenceId == this.currentCall?.conferenceId);
1892
- if (conferenceCalllist.length > 0) {
1892
+ if (conferenceCalllist?.length > 0) {
1893
1893
  // await this.onholdOrUnholdParticipant({
1894
1894
  // participantId: conferenceCalllist.map((item: any) => item.participantId),
1895
1895
  // conferenceId: conferenceCalllist[0]?.conferenceId,
@@ -1912,25 +1912,25 @@ class CallProgressComponent {
1912
1912
  this.currentCallList.splice(index, 1);
1913
1913
  }
1914
1914
  if (this.showContactsPanel) {
1915
- this.getAllParticipants(this.currentCall.conferenceSid);
1915
+ this.getAllParticipants(this.currentCall?.conferenceSid);
1916
1916
  this.applyFilter();
1917
1917
  }
1918
1918
  }
1919
1919
  else if (index != -1) {
1920
1920
  this.currentCallList[index] = {
1921
1921
  ...res,
1922
- img: res.direction == "incoming-call" ? res?.toImage : res?.fromImage || contact?.image || 'assets/images/user.jpg',
1923
- isIncomingCall: res.direction == "incoming-call",
1924
- isHold: res.isHold,
1925
- isMute: false,
1926
- isConference: res.isConference,
1922
+ img: res?.direction == "incoming-call" ? res?.toImage : res?.fromImage || contact?.image || 'assets/images/user.jpg',
1923
+ isIncomingCall: res?.direction == "incoming-call",
1924
+ isHold: res?.isHold,
1925
+ isMute: res?.isMute,
1926
+ isConference: res?.isConference,
1927
1927
  isAcceptCall: res.direction == "incoming-call" ? this.getStatus(res) : true,
1928
1928
  dial: true,
1929
- phone: res.direction == "incoming-call" ? res?.from : res?.to,
1930
- participantId: res.id,
1931
- conferenceSid: callInfo.conferenceSid,
1932
- name: res.name || res?.fromName || res?.toName,
1933
- time: this.getTimeDifference(res.joinedAt || new Date().toUTCString()),
1929
+ phone: res?.direction == "incoming-call" ? res?.from : res?.to,
1930
+ participantId: res?.id,
1931
+ conferenceSid: callInfo?.conferenceSid,
1932
+ name: res?.name || res?.fromName || res?.toName,
1933
+ time: this.getTimeDifference(res?.joinedAt || new Date().toUTCString()),
1934
1934
  };
1935
1935
  }
1936
1936
  }
@@ -1939,16 +1939,16 @@ class CallProgressComponent {
1939
1939
  ...res,
1940
1940
  img: res.direction == "incoming-call" ? res?.toImage : res?.fromImage || contact?.image || 'assets/images/user.jpg',
1941
1941
  isIncomingCall: res.direction == "incoming-call",
1942
- isHold: res.isHold,
1943
- isMute: false,
1942
+ isHold: res?.isHold,
1943
+ isMute: res?.isMute,
1944
1944
  isConference: res.isConference,
1945
1945
  isAcceptCall: res.direction == "incoming-call" ? this.getStatus(res) : true,
1946
1946
  dial: true,
1947
1947
  phone: res.direction == "incoming-call" ? res?.from : res?.to,
1948
1948
  participantId: res.id,
1949
- conferenceSid: callInfo.conferenceSid,
1950
- name: res.name || res?.fromName || res?.toName,
1951
- time: this.getTimeDifference(res.joinedAt || new Date().toUTCString()),
1949
+ conferenceSid: callInfo?.conferenceSid,
1950
+ name: res?.name || res?.fromName || res?.toName,
1951
+ time: this.getTimeDifference(res?.joinedAt || new Date().toUTCString()),
1952
1952
  });
1953
1953
  if (this.currentCallList?.length == 1) {
1954
1954
  this.currentCall = this.currentCallList[0];
@@ -3899,11 +3899,16 @@ class DialboxComponent {
3899
3899
  // so we can auto-open on incoming calls.
3900
3900
  this.initializeTwilio();
3901
3901
  this.incomeingCallSocketService.connect(this.deviceId);
3902
+ let deviceNumberList = this.callerIdList.map((res) => res.number);
3902
3903
  try {
3903
3904
  this.incomeingCallSocketService.listen().subscribe(async (incomingCallData) => {
3904
3905
  this.twilioService.conferenceCallInfo = incomingCallData;
3905
3906
  incomingCallData = incomingCallData?.length > 0 ? incomingCallData.filter((item) => item.participants?.length > 0) : [];
3906
- if (!!incomingCallData?.length) {
3907
+ let ourNumber = {};
3908
+ this.incomingCallData.forEach((callInfo, i) => {
3909
+ ourNumber = callInfo.participants.find((resData) => ((deviceNumberList.includes(resData?.from) && resData?.to == 'c2c_softphone_client') || (deviceNumberList.includes(resData?.to) && resData?.direction == 'incoming-call')) && !resData?.isLeft);
3910
+ });
3911
+ if (!!incomingCallData?.length && ourNumber?.id) {
3907
3912
  // this.incomingCallsList = incomingCallData.participants.filter((item: any) => !item.isLeft) || [];
3908
3913
  this.incomingCallsList = incomingCallData || [];
3909
3914
  let parentCall = [];