@vgroup/dialbox 0.4.136 → 0.4.138

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.
@@ -141,6 +141,7 @@ class ExtensionService {
141
141
  this.http = http;
142
142
  this.ipAddressService = ipAddressService;
143
143
  this.callSid = '';
144
+ this.userId = '';
144
145
  this.messageSource = new BehaviorSubject('');
145
146
  this.channelId = environment.channelId;
146
147
  this.currentMessage = this.messageSource.asObservable();
@@ -1761,6 +1762,7 @@ class CallProgressComponent {
1761
1762
  try {
1762
1763
  // this.incomingAudio = new Audio('../../../assets/phone-ringing.mp3');
1763
1764
  // this.incomingAudio['loop'] = true;
1765
+ this.userId = this.extensionService.userId;
1764
1766
  this.twilioService.currentCall.subscribe((incoming) => {
1765
1767
  if (!incoming) {
1766
1768
  return;
@@ -1788,6 +1790,9 @@ class CallProgressComponent {
1788
1790
  }
1789
1791
  ngOnChanges(changes) {
1790
1792
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1793
+ if (this.userId) {
1794
+ this.extensionService.userId = this.userId;
1795
+ }
1791
1796
  if (changes['callData']) {
1792
1797
  if ((_a = changes['callData'].currentValue) === null || _a === void 0 ? void 0 : _a.isIncomingCall) {
1793
1798
  this.incomingCallDiv = true;
@@ -2025,7 +2030,7 @@ class CallProgressComponent {
2025
2030
  this.showRingAnimation = true;
2026
2031
  const payload = {
2027
2032
  channelId: environment.channelId,
2028
- userId: this.userId,
2033
+ userId: this.userId || localStorage.getItem('userId'),
2029
2034
  to: callData.phone,
2030
2035
  fromNumber: callData.from,
2031
2036
  scope: 'local',
@@ -2056,7 +2061,7 @@ class CallProgressComponent {
2056
2061
  time: '',
2057
2062
  to: (callData === null || callData === void 0 ? void 0 : callData.phone) || '',
2058
2063
  toName: (callData === null || callData === void 0 ? void 0 : callData.name) || '',
2059
- userId: this.userId || ''
2064
+ userId: this.userId || (callData === null || callData === void 0 ? void 0 : callData.userId)
2060
2065
  };
2061
2066
  const response = yield this.initiateCall(payload);
2062
2067
  this.conferenceId = (_a = response === null || response === void 0 ? void 0 : response.callauth) === null || _a === void 0 ? void 0 : _a.id;
@@ -2074,7 +2079,10 @@ class CallProgressComponent {
2074
2079
  from: callData === null || callData === void 0 ? void 0 : callData.from,
2075
2080
  route: "OUTGOING",
2076
2081
  participantNumber: callData === null || callData === void 0 ? void 0 : callData.phone,
2077
- conferenceId: this.conferenceId
2082
+ conferenceId: this.conferenceId,
2083
+ userId: this.userId,
2084
+ proxy: '',
2085
+ countryCode: '',
2078
2086
  });
2079
2087
  console.log('Initial participantId:', (_b = this.addRes) === null || _b === void 0 ? void 0 : _b.participantId);
2080
2088
  return true;
@@ -2495,7 +2503,7 @@ class CallProgressComponent {
2495
2503
  conferenceId: this.conferenceId,
2496
2504
  userId: this.userId,
2497
2505
  proxy: '',
2498
- countrycode: '',
2506
+ countryCode: '',
2499
2507
  });
2500
2508
  this.onholdOrUnholdParticipant({
2501
2509
  participantId: [data === null || data === void 0 ? void 0 : data.participantId],
@@ -2564,7 +2572,10 @@ class CallProgressComponent {
2564
2572
  from: ((_g = this.callData) === null || _g === void 0 ? void 0 : _g.from) || ((_h = this.selectedCallerId) === null || _h === void 0 ? void 0 : _h.number),
2565
2573
  route: "OUTGOING",
2566
2574
  participantNumber: phoneNumber,
2567
- conferenceId: this.conferenceId
2575
+ conferenceId: this.conferenceId,
2576
+ userId: this.userId,
2577
+ proxy: '',
2578
+ countryCode: '',
2568
2579
  });
2569
2580
  // this.callData = {
2570
2581
  // ...this.callData,