@wazo/sdk 0.37.35 → 0.37.38

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.
Files changed (102) hide show
  1. package/README.md +8 -2
  2. package/dist/wazo-sdk.js +2 -2
  3. package/esm/__tests__/api-client.test.js +7 -1
  4. package/esm/__tests__/web-rtc-client.test.js +7 -1
  5. package/esm/api/auth.js +2 -1
  6. package/esm/api/call-logd.js +1 -1
  7. package/esm/api/chatd.js +6 -0
  8. package/esm/api/confd.js +6 -0
  9. package/esm/api-client.js +7 -1
  10. package/esm/checker/Checker.js +7 -1
  11. package/esm/checker/checks/aor.js +7 -1
  12. package/esm/checker/checks/api.js +7 -1
  13. package/esm/checker/checks/index.js +7 -1
  14. package/esm/checker/checks/webrtc-transport.js +7 -1
  15. package/esm/checker/checks/webrtc.js +7 -1
  16. package/esm/domain/AdHocAPIConference.js +16 -6
  17. package/esm/domain/CallLog.js +1 -1
  18. package/esm/domain/CallSession.js +14 -0
  19. package/esm/domain/Features.js +7 -1
  20. package/esm/domain/Phone/CTIPhone.js +21 -1
  21. package/esm/domain/Phone/WebRTCPhone.js +42 -11
  22. package/esm/domain/Profile.js +6 -0
  23. package/esm/domain/SwitchboardCall.js +5 -5
  24. package/esm/domain/__tests__/CallLog.test.js +5 -1
  25. package/esm/domain/__tests__/CallSession.test.js +14 -0
  26. package/esm/domain/__tests__/IndirectTransfer.test.js +14 -0
  27. package/esm/domain/__tests__/Profile.test.js +6 -0
  28. package/esm/domain/__tests__/Room.test.js +14 -0
  29. package/esm/domain/__tests__/Session.test.js +6 -0
  30. package/esm/index.js +83 -29
  31. package/esm/service/CallApi.js +7 -1
  32. package/esm/service/getApiClient.js +7 -1
  33. package/esm/simple/Auth.js +84 -30
  34. package/esm/simple/Configuration.js +83 -29
  35. package/esm/simple/Directory.js +7 -1
  36. package/esm/simple/Phone.js +83 -29
  37. package/esm/simple/index.js +83 -29
  38. package/esm/simple/room/LocalParticipant.js +83 -29
  39. package/esm/simple/room/Participant.js +83 -29
  40. package/esm/simple/room/RemoteParticipant.js +83 -29
  41. package/esm/simple/room/Room.js +83 -29
  42. package/esm/simple/room/SipRoom.js +83 -29
  43. package/esm/simple/room/Stream.js +83 -29
  44. package/esm/simple/room/__tests__/RemoteParticipant.test.js +83 -29
  45. package/esm/simple/utils.js +83 -29
  46. package/esm/web-rtc-client.js +7 -1
  47. package/lib/__tests__/api-client.test.js +7 -1
  48. package/lib/__tests__/web-rtc-client.test.js +7 -1
  49. package/lib/api/auth.js +3 -0
  50. package/lib/api/call-logd.js +1 -1
  51. package/lib/api/chatd.js +6 -0
  52. package/lib/api/confd.js +6 -0
  53. package/lib/api-client.js +7 -1
  54. package/lib/checker/Checker.js +7 -1
  55. package/lib/checker/checks/aor.js +7 -1
  56. package/lib/checker/checks/api.js +7 -1
  57. package/lib/checker/checks/index.js +7 -1
  58. package/lib/checker/checks/webrtc-transport.js +7 -1
  59. package/lib/checker/checks/webrtc.js +7 -1
  60. package/lib/domain/AdHocAPIConference.js +16 -6
  61. package/lib/domain/CallLog.js +1 -1
  62. package/lib/domain/CallSession.js +14 -0
  63. package/lib/domain/Features.js +7 -1
  64. package/lib/domain/Phone/CTIPhone.js +21 -1
  65. package/lib/domain/Phone/WebRTCPhone.js +42 -11
  66. package/lib/domain/Profile.js +6 -0
  67. package/lib/domain/SwitchboardCall.js +5 -5
  68. package/lib/domain/__tests__/CallLog.test.js +5 -1
  69. package/lib/domain/__tests__/CallSession.test.js +14 -0
  70. package/lib/domain/__tests__/IndirectTransfer.test.js +14 -0
  71. package/lib/domain/__tests__/Profile.test.js +6 -0
  72. package/lib/domain/__tests__/Room.test.js +14 -0
  73. package/lib/domain/__tests__/Session.test.js +6 -0
  74. package/lib/index.js +83 -29
  75. package/lib/service/CallApi.js +7 -1
  76. package/lib/service/getApiClient.js +7 -1
  77. package/lib/simple/Auth.js +84 -29
  78. package/lib/simple/Configuration.js +83 -29
  79. package/lib/simple/Directory.js +7 -1
  80. package/lib/simple/Phone.js +83 -29
  81. package/lib/simple/index.js +83 -29
  82. package/lib/simple/room/LocalParticipant.js +83 -29
  83. package/lib/simple/room/Participant.js +83 -29
  84. package/lib/simple/room/RemoteParticipant.js +83 -29
  85. package/lib/simple/room/Room.js +83 -29
  86. package/lib/simple/room/SipRoom.js +83 -29
  87. package/lib/simple/room/Stream.js +83 -29
  88. package/lib/simple/room/__tests__/RemoteParticipant.test.js +83 -29
  89. package/lib/simple/utils.js +83 -29
  90. package/lib/web-rtc-client.js +7 -1
  91. package/package.json +1 -1
  92. package/src/api/auth.js +2 -1
  93. package/src/domain/AdHocAPIConference.js +9 -5
  94. package/src/domain/CallLog.js +1 -1
  95. package/src/domain/CallSession.js +14 -0
  96. package/src/domain/Phone/WebRTCPhone.js +28 -11
  97. package/src/domain/Profile.js +6 -0
  98. package/src/domain/SwitchboardCall.js +5 -5
  99. package/src/domain/__tests__/CallLog.test.js +4 -0
  100. package/src/simple/Auth.js +13 -2
  101. package/src/simple/Phone.js +6 -6
  102. package/src/simple/index.js +2 -1
@@ -1261,6 +1261,7 @@ const LINE_STATE = {
1261
1261
 
1262
1262
 
1263
1263
 
1264
+
1264
1265
 
1265
1266
 
1266
1267
 
@@ -1297,6 +1298,7 @@ const LINE_STATE = {
1297
1298
 
1298
1299
 
1299
1300
 
1301
+
1300
1302
 
1301
1303
 
1302
1304
 
@@ -1328,6 +1330,7 @@ class Profile {
1328
1330
 
1329
1331
 
1330
1332
 
1333
+
1331
1334
 
1332
1335
 
1333
1336
 
@@ -1344,6 +1347,7 @@ class Profile {
1344
1347
  lines: plain.lines.map(line => Line.parse(line)),
1345
1348
  username: plain.username,
1346
1349
  mobileNumber: plain.mobile_phone_number || '',
1350
+ ringSeconds: plain.ring_seconds,
1347
1351
  forwards: [
1348
1352
  ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
1349
1353
  ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
@@ -1380,6 +1384,7 @@ class Profile {
1380
1384
  switchboards,
1381
1385
  agent,
1382
1386
  status,
1387
+ ringSeconds,
1383
1388
  sipLines,
1384
1389
  callPickupTargetUsers,
1385
1390
  onlineCallRecordEnabled,
@@ -1401,6 +1406,7 @@ class Profile {
1401
1406
  this.status = status;
1402
1407
  this.callPickupTargetUsers = callPickupTargetUsers;
1403
1408
  this.onlineCallRecordEnabled = onlineCallRecordEnabled;
1409
+ this.ringSeconds = ringSeconds;
1404
1410
 
1405
1411
  this.sipLines = sipLines || [];
1406
1412
  }
@@ -3295,7 +3301,7 @@ class Recording {
3295
3301
 
3296
3302
 
3297
3303
 
3298
-
3304
+
3299
3305
 
3300
3306
 
3301
3307
 
@@ -4748,7 +4754,7 @@ var getApiClient = (forServer ) => {
4748
4754
 
4749
4755
 
4750
4756
 
4751
-
4757
+
4752
4758
 
4753
4759
 
4754
4760
 
@@ -4768,7 +4774,7 @@ class AdHocAPIConference {
4768
4774
 
4769
4775
 
4770
4776
 
4771
-
4777
+
4772
4778
 
4773
4779
 
4774
4780
 
@@ -4780,7 +4786,7 @@ class AdHocAPIConference {
4780
4786
  participants,
4781
4787
  started,
4782
4788
  finished,
4783
- startTime,
4789
+ answerTime,
4784
4790
  conferenceId,
4785
4791
  muted,
4786
4792
  paused,
@@ -4790,16 +4796,20 @@ class AdHocAPIConference {
4790
4796
  this.participants = participants || {};
4791
4797
  this.started = started || false;
4792
4798
  this.finished = finished || false;
4793
- this.startTime = startTime;
4799
+ this.answerTime = answerTime;
4794
4800
  this.conferenceId = conferenceId || '';
4795
4801
  this.muted = muted || false;
4796
4802
  this.paused = paused || false;
4803
+
4804
+ if (this.host) {
4805
+ this.host.setIsConference(true);
4806
+ }
4797
4807
  }
4798
4808
 
4799
4809
  async start() {
4800
4810
  this.started = true;
4801
4811
  // $FlowFixMe
4802
- this.startTime = Object.values(this.participants).length ? Object.values(this.participants)[0].startTime : null;
4812
+ this.answerTime = Object.values(this.participants).length ? Object.values(this.participants)[0].answerTime : null;
4803
4813
 
4804
4814
  const participantIds = Object.keys(this.participants);
4805
4815
  const conference = await getApiClient().calld.createAdHocConference(this.host.callId, participantIds);
@@ -93,7 +93,7 @@ class Recording {
93
93
 
94
94
 
95
95
 
96
-
96
+
97
97
 
98
98
 
99
99
 
@@ -59,6 +59,7 @@ var updateFrom = (instance , from ) => {
59
59
 
60
60
 
61
61
 
62
+
62
63
 
63
64
 
64
65
  class CallSession {
@@ -121,6 +122,8 @@ class CallSession {
121
122
 
122
123
 
123
124
 
125
+
126
+
124
127
 
125
128
 
126
129
 
@@ -152,6 +155,7 @@ class CallSession {
152
155
  videoRemotelyDowngraded,
153
156
  sipSession,
154
157
  answerTime,
158
+ conference,
155
159
  } ) {
156
160
  this.callId = callId;
157
161
  this.sipCallId = sipCallId;
@@ -180,6 +184,7 @@ class CallSession {
180
184
  this.videoRemotelyDowngraded = videoRemotelyDowngraded;
181
185
  this.sipSession = sipSession;
182
186
  this.answerTime = answerTime || this.answerTime;
187
+ this.conference = conference;
183
188
 
184
189
  // Useful to compare instead of instanceof with minified code
185
190
  this.type = 'CallSession';
@@ -237,6 +242,10 @@ class CallSession {
237
242
  this.screensharing = false;
238
243
  }
239
244
 
245
+ setIsConference(conference ) {
246
+ this.conference = conference;
247
+ }
248
+
240
249
  isIncoming() {
241
250
  return !this.isCaller && !this.answered;
242
251
  }
@@ -313,6 +322,10 @@ class CallSession {
313
322
  return this.sipStatus === SessionState.Terminated;
314
323
  }
315
324
 
325
+ isConference() {
326
+ return this.conference;
327
+ }
328
+
316
329
  getElapsedTimeInSeconds() {
317
330
  if (!this.startTime) {
318
331
  return 0;
@@ -404,6 +417,7 @@ class CallSession {
404
417
  cameraEnabled: false,
405
418
  dialedExtension: call.dialedExtension,
406
419
  call,
420
+ conference: false, // @FIXME?
407
421
  });
408
422
  }
409
423
  }
@@ -1052,6 +1052,7 @@ const LINE_STATE = {
1052
1052
 
1053
1053
 
1054
1054
 
1055
+
1055
1056
 
1056
1057
 
1057
1058
 
@@ -1088,6 +1089,7 @@ const LINE_STATE = {
1088
1089
 
1089
1090
 
1090
1091
 
1092
+
1091
1093
 
1092
1094
 
1093
1095
 
@@ -1119,6 +1121,7 @@ class Profile {
1119
1121
 
1120
1122
 
1121
1123
 
1124
+
1122
1125
 
1123
1126
 
1124
1127
 
@@ -1135,6 +1138,7 @@ class Profile {
1135
1138
  lines: plain.lines.map(line => Line.parse(line)),
1136
1139
  username: plain.username,
1137
1140
  mobileNumber: plain.mobile_phone_number || '',
1141
+ ringSeconds: plain.ring_seconds,
1138
1142
  forwards: [
1139
1143
  ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
1140
1144
  ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
@@ -1171,6 +1175,7 @@ class Profile {
1171
1175
  switchboards,
1172
1176
  agent,
1173
1177
  status,
1178
+ ringSeconds,
1174
1179
  sipLines,
1175
1180
  callPickupTargetUsers,
1176
1181
  onlineCallRecordEnabled,
@@ -1192,6 +1197,7 @@ class Profile {
1192
1197
  this.status = status;
1193
1198
  this.callPickupTargetUsers = callPickupTargetUsers;
1194
1199
  this.onlineCallRecordEnabled = onlineCallRecordEnabled;
1200
+ this.ringSeconds = ringSeconds;
1195
1201
 
1196
1202
  this.sipLines = sipLines || [];
1197
1203
  }
@@ -3295,7 +3301,7 @@ class Recording {
3295
3301
 
3296
3302
 
3297
3303
 
3298
-
3304
+
3299
3305
 
3300
3306
 
3301
3307
 
@@ -365,6 +365,7 @@ const LINE_STATE = {
365
365
 
366
366
 
367
367
 
368
+
368
369
 
369
370
 
370
371
 
@@ -401,6 +402,7 @@ const LINE_STATE = {
401
402
 
402
403
 
403
404
 
405
+
404
406
 
405
407
 
406
408
 
@@ -432,6 +434,7 @@ class Profile {
432
434
 
433
435
 
434
436
 
437
+
435
438
 
436
439
 
437
440
 
@@ -448,6 +451,7 @@ class Profile {
448
451
  lines: plain.lines.map(line => Line.parse(line)),
449
452
  username: plain.username,
450
453
  mobileNumber: plain.mobile_phone_number || '',
454
+ ringSeconds: plain.ring_seconds,
451
455
  forwards: [
452
456
  ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
453
457
  ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
@@ -484,6 +488,7 @@ class Profile {
484
488
  switchboards,
485
489
  agent,
486
490
  status,
491
+ ringSeconds,
487
492
  sipLines,
488
493
  callPickupTargetUsers,
489
494
  onlineCallRecordEnabled,
@@ -505,6 +510,7 @@ class Profile {
505
510
  this.status = status;
506
511
  this.callPickupTargetUsers = callPickupTargetUsers;
507
512
  this.onlineCallRecordEnabled = onlineCallRecordEnabled;
513
+ this.ringSeconds = ringSeconds;
508
514
 
509
515
  this.sipLines = sipLines || [];
510
516
  }
@@ -1733,6 +1739,7 @@ var updateFrom = (instance , from ) => {
1733
1739
 
1734
1740
 
1735
1741
 
1742
+
1736
1743
 
1737
1744
 
1738
1745
  class CallSession {
@@ -1795,6 +1802,8 @@ class CallSession {
1795
1802
 
1796
1803
 
1797
1804
 
1805
+
1806
+
1798
1807
 
1799
1808
 
1800
1809
 
@@ -1826,6 +1835,7 @@ class CallSession {
1826
1835
  videoRemotelyDowngraded,
1827
1836
  sipSession,
1828
1837
  answerTime,
1838
+ conference,
1829
1839
  } ) {
1830
1840
  this.callId = callId;
1831
1841
  this.sipCallId = sipCallId;
@@ -1854,6 +1864,7 @@ class CallSession {
1854
1864
  this.videoRemotelyDowngraded = videoRemotelyDowngraded;
1855
1865
  this.sipSession = sipSession;
1856
1866
  this.answerTime = answerTime || this.answerTime;
1867
+ this.conference = conference;
1857
1868
 
1858
1869
  // Useful to compare instead of instanceof with minified code
1859
1870
  this.type = 'CallSession';
@@ -1911,6 +1922,10 @@ class CallSession {
1911
1922
  this.screensharing = false;
1912
1923
  }
1913
1924
 
1925
+ setIsConference(conference ) {
1926
+ this.conference = conference;
1927
+ }
1928
+
1914
1929
  isIncoming() {
1915
1930
  return !this.isCaller && !this.answered;
1916
1931
  }
@@ -1987,6 +2002,10 @@ class CallSession {
1987
2002
  return this.sipStatus === SessionState.Terminated;
1988
2003
  }
1989
2004
 
2005
+ isConference() {
2006
+ return this.conference;
2007
+ }
2008
+
1990
2009
  getElapsedTimeInSeconds() {
1991
2010
  if (!this.startTime) {
1992
2011
  return 0;
@@ -2078,6 +2097,7 @@ class CallSession {
2078
2097
  cameraEnabled: false,
2079
2098
  dialedExtension: call.dialedExtension,
2080
2099
  call,
2100
+ conference: false, // @FIXME?
2081
2101
  });
2082
2102
  }
2083
2103
  }
@@ -2173,7 +2193,7 @@ class Recording {
2173
2193
 
2174
2194
 
2175
2195
 
2176
-
2196
+
2177
2197
 
2178
2198
 
2179
2199
 
@@ -81,6 +81,7 @@ var updateFrom = (instance , from ) => {
81
81
 
82
82
 
83
83
 
84
+
84
85
 
85
86
 
86
87
  class CallSession {
@@ -143,6 +144,8 @@ class CallSession {
143
144
 
144
145
 
145
146
 
147
+
148
+
146
149
 
147
150
 
148
151
 
@@ -174,6 +177,7 @@ class CallSession {
174
177
  videoRemotelyDowngraded,
175
178
  sipSession,
176
179
  answerTime,
180
+ conference,
177
181
  } ) {
178
182
  this.callId = callId;
179
183
  this.sipCallId = sipCallId;
@@ -202,6 +206,7 @@ class CallSession {
202
206
  this.videoRemotelyDowngraded = videoRemotelyDowngraded;
203
207
  this.sipSession = sipSession;
204
208
  this.answerTime = answerTime || this.answerTime;
209
+ this.conference = conference;
205
210
 
206
211
  // Useful to compare instead of instanceof with minified code
207
212
  this.type = 'CallSession';
@@ -259,6 +264,10 @@ class CallSession {
259
264
  this.screensharing = false;
260
265
  }
261
266
 
267
+ setIsConference(conference ) {
268
+ this.conference = conference;
269
+ }
270
+
262
271
  isIncoming() {
263
272
  return !this.isCaller && !this.answered;
264
273
  }
@@ -335,6 +344,10 @@ class CallSession {
335
344
  return this.sipStatus === SessionState.Terminated;
336
345
  }
337
346
 
347
+ isConference() {
348
+ return this.conference;
349
+ }
350
+
338
351
  getElapsedTimeInSeconds() {
339
352
  if (!this.startTime) {
340
353
  return 0;
@@ -426,6 +439,7 @@ class CallSession {
426
439
  cameraEnabled: false,
427
440
  dialedExtension: call.dialedExtension,
428
441
  call,
442
+ conference: false, // @FIXME?
429
443
  });
430
444
  }
431
445
  }
@@ -1714,7 +1728,11 @@ class WebRTCPhone extends Emitter {
1714
1728
  accept(callSession , cameraEnabled ) {
1715
1729
  logger.info('WebRTC phone - accept call', { id: callSession ? callSession.getId() : 'n/a', cameraEnabled });
1716
1730
  if (this.currentSipSession) {
1717
- this.holdSipSession(this.currentSipSession, this.currentCallSession, true);
1731
+ this.holdSipSession(
1732
+ this.currentSipSession,
1733
+ this.currentCallSession,
1734
+ true,
1735
+ );
1718
1736
  }
1719
1737
 
1720
1738
  if (!callSession) {
@@ -1807,22 +1825,22 @@ class WebRTCPhone extends Emitter {
1807
1825
  }
1808
1826
  }
1809
1827
 
1810
- hold(callSession , withEvent = true, isConference = false) {
1828
+ hold(callSession , withEvent = true) {
1811
1829
  logger.info('WebRTC hold', { id: callSession.getId() });
1812
1830
 
1813
1831
  const sipSession = this.findSipSession(callSession);
1814
1832
 
1815
- return sipSession ? this.holdSipSession(sipSession, callSession, withEvent, isConference) : null;
1833
+ return sipSession ? this.holdSipSession(sipSession, callSession, withEvent) : null;
1816
1834
  }
1817
1835
 
1818
1836
  // @Deprecated
1819
- unhold(callSession , withEvent = true, isConference = false) {
1837
+ unhold(callSession , withEvent = true) {
1820
1838
  console.warn('Please note that `phone.unhold()` is being deprecated; `phone.resume()` is the preferred method');
1821
1839
 
1822
- return this.resume(callSession, isConference, withEvent);
1840
+ return this.resume(callSession, withEvent);
1823
1841
  }
1824
1842
 
1825
- resume(callSession , isConference = false, withEvent = true) {
1843
+ resume(callSession , withEvent = true) {
1826
1844
  logger.info('WebRTC resume called', { id: callSession ? callSession.getId() : null });
1827
1845
 
1828
1846
  const sipSession = this.findSipSession(callSession);
@@ -1835,10 +1853,14 @@ class WebRTCPhone extends Emitter {
1835
1853
  // Hold current session if different from the current one (we don't want 2 sessions active at the same time).
1836
1854
  if (this.currentSipSession && this.currentSipSession.id !== sipSession.id) {
1837
1855
  logger.info('WebRTC hold call after resume', { id: this.currentSipSession.id });
1838
- this.holdSipSession(this.currentSipSession, this.currentCallSession);
1856
+ this.holdSipSession(
1857
+ this.currentSipSession,
1858
+ this.currentCallSession,
1859
+ withEvent,
1860
+ );
1839
1861
  }
1840
1862
 
1841
- const promise = this.unholdSipSession(sipSession, callSession, withEvent, isConference);
1863
+ const promise = this.unholdSipSession(sipSession, callSession, withEvent);
1842
1864
  this.currentSipSession = sipSession;
1843
1865
  if (callSession) {
1844
1866
  this.currentCallSession = callSession;
@@ -1851,7 +1873,6 @@ class WebRTCPhone extends Emitter {
1851
1873
  sipSession ,
1852
1874
  callSession ,
1853
1875
  withEvent = true,
1854
- isConference = false,
1855
1876
  ) {
1856
1877
  if (!sipSession) {
1857
1878
  return new Promise((resolve, reject) => reject(new Error('No session to hold')));
@@ -1872,6 +1893,8 @@ class WebRTCPhone extends Emitter {
1872
1893
  await this.client.downgradeToAudio(sipSession);
1873
1894
  }
1874
1895
 
1896
+ const isConference = !!callSession && callSession.isConference();
1897
+
1875
1898
  const promise = this.client.hold(sipSession, isConference, hasVideo);
1876
1899
  if (withEvent) {
1877
1900
  this.eventEmitter.emit(ON_CALL_HELD, this._createCallSession(sipSession, callSession));
@@ -1884,11 +1907,13 @@ class WebRTCPhone extends Emitter {
1884
1907
  sipSession ,
1885
1908
  callSession ,
1886
1909
  withEvent = true,
1887
- isConference = false,
1888
1910
  ) {
1889
1911
  if (!sipSession) {
1890
1912
  return new Promise((resolve, reject) => reject(new Error('No session to unhold')));
1891
1913
  }
1914
+
1915
+ const isConference = !!callSession && callSession.isConference();
1916
+
1892
1917
  const sessionId = this.getSipSessionId(sipSession);
1893
1918
  logger.info('WebRTC unhold sip session', { sessionId, isConference });
1894
1919
 
@@ -2030,7 +2055,11 @@ class WebRTCPhone extends Emitter {
2030
2055
  await this.client.register();
2031
2056
  }
2032
2057
  if (this.currentSipSession) {
2033
- this.holdSipSession(this.currentSipSession, this.currentCallSession, true).catch(e => {
2058
+ this.holdSipSession(
2059
+ this.currentSipSession,
2060
+ this.currentCallSession,
2061
+ true,
2062
+ ).catch(e => {
2034
2063
  logger.warn('Unable to hold current session when making another call', e);
2035
2064
  });
2036
2065
  }
@@ -2045,6 +2074,7 @@ class WebRTCPhone extends Emitter {
2045
2074
  return Promise.resolve(null);
2046
2075
  }
2047
2076
  const callSession = this._createOutgoingCallSession(sipSession, cameraEnabled || false);
2077
+ callSession.setIsConference(conference);
2048
2078
  callSession.creationTime = new Date();
2049
2079
  this._updateCallSession(callSession);
2050
2080
 
@@ -2623,6 +2653,7 @@ class WebRTCPhone extends Emitter {
2623
2653
  recording: fromSession ? fromSession.isRecording() : false,
2624
2654
  recordingPaused: false, // @TODO
2625
2655
  sipSession,
2656
+ conference: !!fromSession && fromSession.isConference(),
2626
2657
  ...extra,
2627
2658
  });
2628
2659
 
@@ -199,6 +199,7 @@ const LINE_STATE = {
199
199
 
200
200
 
201
201
 
202
+
202
203
 
203
204
 
204
205
 
@@ -235,6 +236,7 @@ const LINE_STATE = {
235
236
 
236
237
 
237
238
 
239
+
238
240
 
239
241
 
240
242
 
@@ -266,6 +268,7 @@ class Profile {
266
268
 
267
269
 
268
270
 
271
+
269
272
 
270
273
 
271
274
 
@@ -282,6 +285,7 @@ class Profile {
282
285
  lines: plain.lines.map(line => Line.parse(line)),
283
286
  username: plain.username,
284
287
  mobileNumber: plain.mobile_phone_number || '',
288
+ ringSeconds: plain.ring_seconds,
285
289
  forwards: [
286
290
  ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
287
291
  ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
@@ -318,6 +322,7 @@ class Profile {
318
322
  switchboards,
319
323
  agent,
320
324
  status,
325
+ ringSeconds,
321
326
  sipLines,
322
327
  callPickupTargetUsers,
323
328
  onlineCallRecordEnabled,
@@ -339,6 +344,7 @@ class Profile {
339
344
  this.status = status;
340
345
  this.callPickupTargetUsers = callPickupTargetUsers;
341
346
  this.onlineCallRecordEnabled = onlineCallRecordEnabled;
347
+ this.ringSeconds = ringSeconds;
342
348
 
343
349
  this.sipLines = sipLines || [];
344
350
  }
@@ -54,7 +54,7 @@ var updateFrom = (instance , from ) => {
54
54
 
55
55
 
56
56
 
57
-
57
+
58
58
 
59
59
 
60
60
 
@@ -80,7 +80,7 @@ class SwitchboardCall {
80
80
 
81
81
 
82
82
 
83
-
83
+
84
84
 
85
85
 
86
86
 
@@ -94,7 +94,7 @@ class SwitchboardCall {
94
94
  callerIdName: plain.caller_id_name || null,
95
95
  callerIdNumber: plain.caller_id_number || null,
96
96
  participantId: plain.participantId || null,
97
- startTime: plain.startTime,
97
+ answerTime: plain.startTime,
98
98
  state: plain.state,
99
99
  switchboardName: plain.switchboardName,
100
100
  switchboardUuid: plain.switchboardUuid,
@@ -107,7 +107,7 @@ class SwitchboardCall {
107
107
  callerIdName,
108
108
  callerIdNumber,
109
109
  participantId,
110
- startTime,
110
+ answerTime,
111
111
  state,
112
112
  switchboardName,
113
113
  switchboardUuid,
@@ -117,7 +117,7 @@ class SwitchboardCall {
117
117
  this.callerIdName = callerIdName;
118
118
  this.callerIdNumber = callerIdNumber;
119
119
  this.participantId = participantId;
120
- this.startTime = startTime;
120
+ this.answerTime = answerTime;
121
121
  this.state = state;
122
122
  this.switchboardName = switchboardName;
123
123
  this.switchboardUuid = switchboardUuid;
@@ -93,7 +93,7 @@ class Recording {
93
93
 
94
94
 
95
95
 
96
-
96
+
97
97
 
98
98
 
99
99
 
@@ -329,8 +329,10 @@ describe('CallLog domain', () => {
329
329
  call_direction: 'outbound',
330
330
  source_extension: '8020',
331
331
  source_name: 'Jonathan Lessard',
332
+ source_user_uuid: '123',
332
333
  destination_extension: '4182250459',
333
334
  destination_name: null,
335
+ destination_user_uuid: '456',
334
336
  duration: 4,
335
337
  start: '2017-08-06T13:50:55.819057+00:00',
336
338
  end: '2017-08-08T13:51:23.822529+00:00',
@@ -361,10 +363,12 @@ describe('CallLog domain', () => {
361
363
  destination: {
362
364
  extension: '4182250459',
363
365
  name: '',
366
+ uuid: '456',
364
367
  },
365
368
  source: {
366
369
  extension: '8020',
367
370
  name: 'Jonathan Lessard',
371
+ uuid: '123',
368
372
  },
369
373
  id: 215,
370
374
  duration: 4000,