@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.
- package/README.md +8 -2
- package/dist/wazo-sdk.js +2 -2
- package/esm/__tests__/api-client.test.js +7 -1
- package/esm/__tests__/web-rtc-client.test.js +7 -1
- package/esm/api/auth.js +2 -1
- package/esm/api/call-logd.js +1 -1
- package/esm/api/chatd.js +6 -0
- package/esm/api/confd.js +6 -0
- package/esm/api-client.js +7 -1
- package/esm/checker/Checker.js +7 -1
- package/esm/checker/checks/aor.js +7 -1
- package/esm/checker/checks/api.js +7 -1
- package/esm/checker/checks/index.js +7 -1
- package/esm/checker/checks/webrtc-transport.js +7 -1
- package/esm/checker/checks/webrtc.js +7 -1
- package/esm/domain/AdHocAPIConference.js +16 -6
- package/esm/domain/CallLog.js +1 -1
- package/esm/domain/CallSession.js +14 -0
- package/esm/domain/Features.js +7 -1
- package/esm/domain/Phone/CTIPhone.js +21 -1
- package/esm/domain/Phone/WebRTCPhone.js +42 -11
- package/esm/domain/Profile.js +6 -0
- package/esm/domain/SwitchboardCall.js +5 -5
- package/esm/domain/__tests__/CallLog.test.js +5 -1
- package/esm/domain/__tests__/CallSession.test.js +14 -0
- package/esm/domain/__tests__/IndirectTransfer.test.js +14 -0
- package/esm/domain/__tests__/Profile.test.js +6 -0
- package/esm/domain/__tests__/Room.test.js +14 -0
- package/esm/domain/__tests__/Session.test.js +6 -0
- package/esm/index.js +83 -29
- package/esm/service/CallApi.js +7 -1
- package/esm/service/getApiClient.js +7 -1
- package/esm/simple/Auth.js +84 -30
- package/esm/simple/Configuration.js +83 -29
- package/esm/simple/Directory.js +7 -1
- package/esm/simple/Phone.js +83 -29
- package/esm/simple/index.js +83 -29
- package/esm/simple/room/LocalParticipant.js +83 -29
- package/esm/simple/room/Participant.js +83 -29
- package/esm/simple/room/RemoteParticipant.js +83 -29
- package/esm/simple/room/Room.js +83 -29
- package/esm/simple/room/SipRoom.js +83 -29
- package/esm/simple/room/Stream.js +83 -29
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +83 -29
- package/esm/simple/utils.js +83 -29
- package/esm/web-rtc-client.js +7 -1
- package/lib/__tests__/api-client.test.js +7 -1
- package/lib/__tests__/web-rtc-client.test.js +7 -1
- package/lib/api/auth.js +3 -0
- package/lib/api/call-logd.js +1 -1
- package/lib/api/chatd.js +6 -0
- package/lib/api/confd.js +6 -0
- package/lib/api-client.js +7 -1
- package/lib/checker/Checker.js +7 -1
- package/lib/checker/checks/aor.js +7 -1
- package/lib/checker/checks/api.js +7 -1
- package/lib/checker/checks/index.js +7 -1
- package/lib/checker/checks/webrtc-transport.js +7 -1
- package/lib/checker/checks/webrtc.js +7 -1
- package/lib/domain/AdHocAPIConference.js +16 -6
- package/lib/domain/CallLog.js +1 -1
- package/lib/domain/CallSession.js +14 -0
- package/lib/domain/Features.js +7 -1
- package/lib/domain/Phone/CTIPhone.js +21 -1
- package/lib/domain/Phone/WebRTCPhone.js +42 -11
- package/lib/domain/Profile.js +6 -0
- package/lib/domain/SwitchboardCall.js +5 -5
- package/lib/domain/__tests__/CallLog.test.js +5 -1
- package/lib/domain/__tests__/CallSession.test.js +14 -0
- package/lib/domain/__tests__/IndirectTransfer.test.js +14 -0
- package/lib/domain/__tests__/Profile.test.js +6 -0
- package/lib/domain/__tests__/Room.test.js +14 -0
- package/lib/domain/__tests__/Session.test.js +6 -0
- package/lib/index.js +83 -29
- package/lib/service/CallApi.js +7 -1
- package/lib/service/getApiClient.js +7 -1
- package/lib/simple/Auth.js +84 -29
- package/lib/simple/Configuration.js +83 -29
- package/lib/simple/Directory.js +7 -1
- package/lib/simple/Phone.js +83 -29
- package/lib/simple/index.js +83 -29
- package/lib/simple/room/LocalParticipant.js +83 -29
- package/lib/simple/room/Participant.js +83 -29
- package/lib/simple/room/RemoteParticipant.js +83 -29
- package/lib/simple/room/Room.js +83 -29
- package/lib/simple/room/SipRoom.js +83 -29
- package/lib/simple/room/Stream.js +83 -29
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +83 -29
- package/lib/simple/utils.js +83 -29
- package/lib/web-rtc-client.js +7 -1
- package/package.json +1 -1
- package/src/api/auth.js +2 -1
- package/src/domain/AdHocAPIConference.js +9 -5
- package/src/domain/CallLog.js +1 -1
- package/src/domain/CallSession.js +14 -0
- package/src/domain/Phone/WebRTCPhone.js +28 -11
- package/src/domain/Profile.js +6 -0
- package/src/domain/SwitchboardCall.js +5 -5
- package/src/domain/__tests__/CallLog.test.js +4 -0
- package/src/simple/Auth.js +13 -2
- package/src/simple/Phone.js +6 -6
- package/src/simple/index.js +2 -1
|
@@ -374,6 +374,7 @@ const LINE_STATE = {
|
|
|
374
374
|
|
|
375
375
|
|
|
376
376
|
|
|
377
|
+
|
|
377
378
|
|
|
378
379
|
|
|
379
380
|
|
|
@@ -410,6 +411,7 @@ const LINE_STATE = {
|
|
|
410
411
|
|
|
411
412
|
|
|
412
413
|
|
|
414
|
+
|
|
413
415
|
|
|
414
416
|
|
|
415
417
|
|
|
@@ -441,6 +443,7 @@ class Profile {
|
|
|
441
443
|
|
|
442
444
|
|
|
443
445
|
|
|
446
|
+
|
|
444
447
|
|
|
445
448
|
|
|
446
449
|
|
|
@@ -457,6 +460,7 @@ class Profile {
|
|
|
457
460
|
lines: plain.lines.map(line => Line.parse(line)),
|
|
458
461
|
username: plain.username,
|
|
459
462
|
mobileNumber: plain.mobile_phone_number || '',
|
|
463
|
+
ringSeconds: plain.ring_seconds,
|
|
460
464
|
forwards: [
|
|
461
465
|
ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
|
|
462
466
|
ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
|
|
@@ -493,6 +497,7 @@ class Profile {
|
|
|
493
497
|
switchboards,
|
|
494
498
|
agent,
|
|
495
499
|
status,
|
|
500
|
+
ringSeconds,
|
|
496
501
|
sipLines,
|
|
497
502
|
callPickupTargetUsers,
|
|
498
503
|
onlineCallRecordEnabled,
|
|
@@ -514,6 +519,7 @@ class Profile {
|
|
|
514
519
|
this.status = status;
|
|
515
520
|
this.callPickupTargetUsers = callPickupTargetUsers;
|
|
516
521
|
this.onlineCallRecordEnabled = onlineCallRecordEnabled;
|
|
522
|
+
this.ringSeconds = ringSeconds;
|
|
517
523
|
|
|
518
524
|
this.sipLines = sipLines || [];
|
|
519
525
|
}
|
|
@@ -1742,6 +1748,7 @@ var updateFrom = (instance , from ) => {
|
|
|
1742
1748
|
|
|
1743
1749
|
|
|
1744
1750
|
|
|
1751
|
+
|
|
1745
1752
|
|
|
1746
1753
|
|
|
1747
1754
|
class CallSession {
|
|
@@ -1804,6 +1811,8 @@ class CallSession {
|
|
|
1804
1811
|
|
|
1805
1812
|
|
|
1806
1813
|
|
|
1814
|
+
|
|
1815
|
+
|
|
1807
1816
|
|
|
1808
1817
|
|
|
1809
1818
|
|
|
@@ -1835,6 +1844,7 @@ class CallSession {
|
|
|
1835
1844
|
videoRemotelyDowngraded,
|
|
1836
1845
|
sipSession,
|
|
1837
1846
|
answerTime,
|
|
1847
|
+
conference,
|
|
1838
1848
|
} ) {
|
|
1839
1849
|
this.callId = callId;
|
|
1840
1850
|
this.sipCallId = sipCallId;
|
|
@@ -1863,6 +1873,7 @@ class CallSession {
|
|
|
1863
1873
|
this.videoRemotelyDowngraded = videoRemotelyDowngraded;
|
|
1864
1874
|
this.sipSession = sipSession;
|
|
1865
1875
|
this.answerTime = answerTime || this.answerTime;
|
|
1876
|
+
this.conference = conference;
|
|
1866
1877
|
|
|
1867
1878
|
// Useful to compare instead of instanceof with minified code
|
|
1868
1879
|
this.type = 'CallSession';
|
|
@@ -1920,6 +1931,10 @@ class CallSession {
|
|
|
1920
1931
|
this.screensharing = false;
|
|
1921
1932
|
}
|
|
1922
1933
|
|
|
1934
|
+
setIsConference(conference ) {
|
|
1935
|
+
this.conference = conference;
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1923
1938
|
isIncoming() {
|
|
1924
1939
|
return !this.isCaller && !this.answered;
|
|
1925
1940
|
}
|
|
@@ -1996,6 +2011,10 @@ class CallSession {
|
|
|
1996
2011
|
return this.sipStatus === sessionState.SessionState.Terminated;
|
|
1997
2012
|
}
|
|
1998
2013
|
|
|
2014
|
+
isConference() {
|
|
2015
|
+
return this.conference;
|
|
2016
|
+
}
|
|
2017
|
+
|
|
1999
2018
|
getElapsedTimeInSeconds() {
|
|
2000
2019
|
if (!this.startTime) {
|
|
2001
2020
|
return 0;
|
|
@@ -2087,6 +2106,7 @@ class CallSession {
|
|
|
2087
2106
|
cameraEnabled: false,
|
|
2088
2107
|
dialedExtension: call.dialedExtension,
|
|
2089
2108
|
call,
|
|
2109
|
+
conference: false, // @FIXME?
|
|
2090
2110
|
});
|
|
2091
2111
|
}
|
|
2092
2112
|
}
|
|
@@ -2182,7 +2202,7 @@ class Recording {
|
|
|
2182
2202
|
|
|
2183
2203
|
|
|
2184
2204
|
|
|
2185
|
-
|
|
2205
|
+
|
|
2186
2206
|
|
|
2187
2207
|
|
|
2188
2208
|
|
|
@@ -90,6 +90,7 @@ var updateFrom = (instance , from ) => {
|
|
|
90
90
|
|
|
91
91
|
|
|
92
92
|
|
|
93
|
+
|
|
93
94
|
|
|
94
95
|
|
|
95
96
|
class CallSession {
|
|
@@ -152,6 +153,8 @@ class CallSession {
|
|
|
152
153
|
|
|
153
154
|
|
|
154
155
|
|
|
156
|
+
|
|
157
|
+
|
|
155
158
|
|
|
156
159
|
|
|
157
160
|
|
|
@@ -183,6 +186,7 @@ class CallSession {
|
|
|
183
186
|
videoRemotelyDowngraded,
|
|
184
187
|
sipSession,
|
|
185
188
|
answerTime,
|
|
189
|
+
conference,
|
|
186
190
|
} ) {
|
|
187
191
|
this.callId = callId;
|
|
188
192
|
this.sipCallId = sipCallId;
|
|
@@ -211,6 +215,7 @@ class CallSession {
|
|
|
211
215
|
this.videoRemotelyDowngraded = videoRemotelyDowngraded;
|
|
212
216
|
this.sipSession = sipSession;
|
|
213
217
|
this.answerTime = answerTime || this.answerTime;
|
|
218
|
+
this.conference = conference;
|
|
214
219
|
|
|
215
220
|
// Useful to compare instead of instanceof with minified code
|
|
216
221
|
this.type = 'CallSession';
|
|
@@ -268,6 +273,10 @@ class CallSession {
|
|
|
268
273
|
this.screensharing = false;
|
|
269
274
|
}
|
|
270
275
|
|
|
276
|
+
setIsConference(conference ) {
|
|
277
|
+
this.conference = conference;
|
|
278
|
+
}
|
|
279
|
+
|
|
271
280
|
isIncoming() {
|
|
272
281
|
return !this.isCaller && !this.answered;
|
|
273
282
|
}
|
|
@@ -344,6 +353,10 @@ class CallSession {
|
|
|
344
353
|
return this.sipStatus === sessionState.SessionState.Terminated;
|
|
345
354
|
}
|
|
346
355
|
|
|
356
|
+
isConference() {
|
|
357
|
+
return this.conference;
|
|
358
|
+
}
|
|
359
|
+
|
|
347
360
|
getElapsedTimeInSeconds() {
|
|
348
361
|
if (!this.startTime) {
|
|
349
362
|
return 0;
|
|
@@ -435,6 +448,7 @@ class CallSession {
|
|
|
435
448
|
cameraEnabled: false,
|
|
436
449
|
dialedExtension: call.dialedExtension,
|
|
437
450
|
call,
|
|
451
|
+
conference: false, // @FIXME?
|
|
438
452
|
});
|
|
439
453
|
}
|
|
440
454
|
}
|
|
@@ -1723,7 +1737,11 @@ class WebRTCPhone extends Emitter {
|
|
|
1723
1737
|
accept(callSession , cameraEnabled ) {
|
|
1724
1738
|
logger.info('WebRTC phone - accept call', { id: callSession ? callSession.getId() : 'n/a', cameraEnabled });
|
|
1725
1739
|
if (this.currentSipSession) {
|
|
1726
|
-
this.holdSipSession(
|
|
1740
|
+
this.holdSipSession(
|
|
1741
|
+
this.currentSipSession,
|
|
1742
|
+
this.currentCallSession,
|
|
1743
|
+
true,
|
|
1744
|
+
);
|
|
1727
1745
|
}
|
|
1728
1746
|
|
|
1729
1747
|
if (!callSession) {
|
|
@@ -1816,22 +1834,22 @@ class WebRTCPhone extends Emitter {
|
|
|
1816
1834
|
}
|
|
1817
1835
|
}
|
|
1818
1836
|
|
|
1819
|
-
hold(callSession , withEvent = true
|
|
1837
|
+
hold(callSession , withEvent = true) {
|
|
1820
1838
|
logger.info('WebRTC hold', { id: callSession.getId() });
|
|
1821
1839
|
|
|
1822
1840
|
const sipSession = this.findSipSession(callSession);
|
|
1823
1841
|
|
|
1824
|
-
return sipSession ? this.holdSipSession(sipSession, callSession, withEvent
|
|
1842
|
+
return sipSession ? this.holdSipSession(sipSession, callSession, withEvent) : null;
|
|
1825
1843
|
}
|
|
1826
1844
|
|
|
1827
1845
|
// @Deprecated
|
|
1828
|
-
unhold(callSession , withEvent = true
|
|
1846
|
+
unhold(callSession , withEvent = true) {
|
|
1829
1847
|
console.warn('Please note that `phone.unhold()` is being deprecated; `phone.resume()` is the preferred method');
|
|
1830
1848
|
|
|
1831
|
-
return this.resume(callSession,
|
|
1849
|
+
return this.resume(callSession, withEvent);
|
|
1832
1850
|
}
|
|
1833
1851
|
|
|
1834
|
-
resume(callSession ,
|
|
1852
|
+
resume(callSession , withEvent = true) {
|
|
1835
1853
|
logger.info('WebRTC resume called', { id: callSession ? callSession.getId() : null });
|
|
1836
1854
|
|
|
1837
1855
|
const sipSession = this.findSipSession(callSession);
|
|
@@ -1844,10 +1862,14 @@ class WebRTCPhone extends Emitter {
|
|
|
1844
1862
|
// Hold current session if different from the current one (we don't want 2 sessions active at the same time).
|
|
1845
1863
|
if (this.currentSipSession && this.currentSipSession.id !== sipSession.id) {
|
|
1846
1864
|
logger.info('WebRTC hold call after resume', { id: this.currentSipSession.id });
|
|
1847
|
-
this.holdSipSession(
|
|
1865
|
+
this.holdSipSession(
|
|
1866
|
+
this.currentSipSession,
|
|
1867
|
+
this.currentCallSession,
|
|
1868
|
+
withEvent,
|
|
1869
|
+
);
|
|
1848
1870
|
}
|
|
1849
1871
|
|
|
1850
|
-
const promise = this.unholdSipSession(sipSession, callSession, withEvent
|
|
1872
|
+
const promise = this.unholdSipSession(sipSession, callSession, withEvent);
|
|
1851
1873
|
this.currentSipSession = sipSession;
|
|
1852
1874
|
if (callSession) {
|
|
1853
1875
|
this.currentCallSession = callSession;
|
|
@@ -1860,7 +1882,6 @@ class WebRTCPhone extends Emitter {
|
|
|
1860
1882
|
sipSession ,
|
|
1861
1883
|
callSession ,
|
|
1862
1884
|
withEvent = true,
|
|
1863
|
-
isConference = false,
|
|
1864
1885
|
) {
|
|
1865
1886
|
if (!sipSession) {
|
|
1866
1887
|
return new Promise((resolve, reject) => reject(new Error('No session to hold')));
|
|
@@ -1881,6 +1902,8 @@ class WebRTCPhone extends Emitter {
|
|
|
1881
1902
|
await this.client.downgradeToAudio(sipSession);
|
|
1882
1903
|
}
|
|
1883
1904
|
|
|
1905
|
+
const isConference = !!callSession && callSession.isConference();
|
|
1906
|
+
|
|
1884
1907
|
const promise = this.client.hold(sipSession, isConference, hasVideo);
|
|
1885
1908
|
if (withEvent) {
|
|
1886
1909
|
this.eventEmitter.emit(ON_CALL_HELD, this._createCallSession(sipSession, callSession));
|
|
@@ -1893,11 +1916,13 @@ class WebRTCPhone extends Emitter {
|
|
|
1893
1916
|
sipSession ,
|
|
1894
1917
|
callSession ,
|
|
1895
1918
|
withEvent = true,
|
|
1896
|
-
isConference = false,
|
|
1897
1919
|
) {
|
|
1898
1920
|
if (!sipSession) {
|
|
1899
1921
|
return new Promise((resolve, reject) => reject(new Error('No session to unhold')));
|
|
1900
1922
|
}
|
|
1923
|
+
|
|
1924
|
+
const isConference = !!callSession && callSession.isConference();
|
|
1925
|
+
|
|
1901
1926
|
const sessionId = this.getSipSessionId(sipSession);
|
|
1902
1927
|
logger.info('WebRTC unhold sip session', { sessionId, isConference });
|
|
1903
1928
|
|
|
@@ -2039,7 +2064,11 @@ class WebRTCPhone extends Emitter {
|
|
|
2039
2064
|
await this.client.register();
|
|
2040
2065
|
}
|
|
2041
2066
|
if (this.currentSipSession) {
|
|
2042
|
-
this.holdSipSession(
|
|
2067
|
+
this.holdSipSession(
|
|
2068
|
+
this.currentSipSession,
|
|
2069
|
+
this.currentCallSession,
|
|
2070
|
+
true,
|
|
2071
|
+
).catch(e => {
|
|
2043
2072
|
logger.warn('Unable to hold current session when making another call', e);
|
|
2044
2073
|
});
|
|
2045
2074
|
}
|
|
@@ -2054,6 +2083,7 @@ class WebRTCPhone extends Emitter {
|
|
|
2054
2083
|
return Promise.resolve(null);
|
|
2055
2084
|
}
|
|
2056
2085
|
const callSession = this._createOutgoingCallSession(sipSession, cameraEnabled || false);
|
|
2086
|
+
callSession.setIsConference(conference);
|
|
2057
2087
|
callSession.creationTime = new Date();
|
|
2058
2088
|
this._updateCallSession(callSession);
|
|
2059
2089
|
|
|
@@ -2632,6 +2662,7 @@ class WebRTCPhone extends Emitter {
|
|
|
2632
2662
|
recording: fromSession ? fromSession.isRecording() : false,
|
|
2633
2663
|
recordingPaused: false, // @TODO
|
|
2634
2664
|
sipSession,
|
|
2665
|
+
conference: !!fromSession && fromSession.isConference(),
|
|
2635
2666
|
...extra,
|
|
2636
2667
|
});
|
|
2637
2668
|
|
package/lib/domain/Profile.js
CHANGED
|
@@ -203,6 +203,7 @@ const LINE_STATE = {
|
|
|
203
203
|
|
|
204
204
|
|
|
205
205
|
|
|
206
|
+
|
|
206
207
|
|
|
207
208
|
|
|
208
209
|
|
|
@@ -239,6 +240,7 @@ const LINE_STATE = {
|
|
|
239
240
|
|
|
240
241
|
|
|
241
242
|
|
|
243
|
+
|
|
242
244
|
|
|
243
245
|
|
|
244
246
|
|
|
@@ -270,6 +272,7 @@ class Profile {
|
|
|
270
272
|
|
|
271
273
|
|
|
272
274
|
|
|
275
|
+
|
|
273
276
|
|
|
274
277
|
|
|
275
278
|
|
|
@@ -286,6 +289,7 @@ class Profile {
|
|
|
286
289
|
lines: plain.lines.map(line => Line.parse(line)),
|
|
287
290
|
username: plain.username,
|
|
288
291
|
mobileNumber: plain.mobile_phone_number || '',
|
|
292
|
+
ringSeconds: plain.ring_seconds,
|
|
289
293
|
forwards: [
|
|
290
294
|
ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
|
|
291
295
|
ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
|
|
@@ -322,6 +326,7 @@ class Profile {
|
|
|
322
326
|
switchboards,
|
|
323
327
|
agent,
|
|
324
328
|
status,
|
|
329
|
+
ringSeconds,
|
|
325
330
|
sipLines,
|
|
326
331
|
callPickupTargetUsers,
|
|
327
332
|
onlineCallRecordEnabled,
|
|
@@ -343,6 +348,7 @@ class Profile {
|
|
|
343
348
|
this.status = status;
|
|
344
349
|
this.callPickupTargetUsers = callPickupTargetUsers;
|
|
345
350
|
this.onlineCallRecordEnabled = onlineCallRecordEnabled;
|
|
351
|
+
this.ringSeconds = ringSeconds;
|
|
346
352
|
|
|
347
353
|
this.sipLines = sipLines || [];
|
|
348
354
|
}
|
|
@@ -56,7 +56,7 @@ var updateFrom = (instance , from ) => {
|
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
|
|
60
60
|
|
|
61
61
|
|
|
62
62
|
|
|
@@ -82,7 +82,7 @@ class SwitchboardCall {
|
|
|
82
82
|
|
|
83
83
|
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
|
|
86
86
|
|
|
87
87
|
|
|
88
88
|
|
|
@@ -96,7 +96,7 @@ class SwitchboardCall {
|
|
|
96
96
|
callerIdName: plain.caller_id_name || null,
|
|
97
97
|
callerIdNumber: plain.caller_id_number || null,
|
|
98
98
|
participantId: plain.participantId || null,
|
|
99
|
-
|
|
99
|
+
answerTime: plain.startTime,
|
|
100
100
|
state: plain.state,
|
|
101
101
|
switchboardName: plain.switchboardName,
|
|
102
102
|
switchboardUuid: plain.switchboardUuid,
|
|
@@ -109,7 +109,7 @@ class SwitchboardCall {
|
|
|
109
109
|
callerIdName,
|
|
110
110
|
callerIdNumber,
|
|
111
111
|
participantId,
|
|
112
|
-
|
|
112
|
+
answerTime,
|
|
113
113
|
state,
|
|
114
114
|
switchboardName,
|
|
115
115
|
switchboardUuid,
|
|
@@ -119,7 +119,7 @@ class SwitchboardCall {
|
|
|
119
119
|
this.callerIdName = callerIdName;
|
|
120
120
|
this.callerIdNumber = callerIdNumber;
|
|
121
121
|
this.participantId = participantId;
|
|
122
|
-
this.
|
|
122
|
+
this.answerTime = answerTime;
|
|
123
123
|
this.state = state;
|
|
124
124
|
this.switchboardName = switchboardName;
|
|
125
125
|
this.switchboardUuid = switchboardUuid;
|
|
@@ -99,7 +99,7 @@ class Recording {
|
|
|
99
99
|
|
|
100
100
|
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
|
|
103
103
|
|
|
104
104
|
|
|
105
105
|
|
|
@@ -335,8 +335,10 @@ describe('CallLog domain', () => {
|
|
|
335
335
|
call_direction: 'outbound',
|
|
336
336
|
source_extension: '8020',
|
|
337
337
|
source_name: 'Jonathan Lessard',
|
|
338
|
+
source_user_uuid: '123',
|
|
338
339
|
destination_extension: '4182250459',
|
|
339
340
|
destination_name: null,
|
|
341
|
+
destination_user_uuid: '456',
|
|
340
342
|
duration: 4,
|
|
341
343
|
start: '2017-08-06T13:50:55.819057+00:00',
|
|
342
344
|
end: '2017-08-08T13:51:23.822529+00:00',
|
|
@@ -367,10 +369,12 @@ describe('CallLog domain', () => {
|
|
|
367
369
|
destination: {
|
|
368
370
|
extension: '4182250459',
|
|
369
371
|
name: '',
|
|
372
|
+
uuid: '456',
|
|
370
373
|
},
|
|
371
374
|
source: {
|
|
372
375
|
extension: '8020',
|
|
373
376
|
name: 'Jonathan Lessard',
|
|
377
|
+
uuid: '123',
|
|
374
378
|
},
|
|
375
379
|
id: 215,
|
|
376
380
|
duration: 4000,
|
|
@@ -61,6 +61,7 @@ var updateFrom = (instance , from ) => {
|
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
|
|
64
|
+
|
|
64
65
|
|
|
65
66
|
|
|
66
67
|
class CallSession {
|
|
@@ -123,6 +124,8 @@ class CallSession {
|
|
|
123
124
|
|
|
124
125
|
|
|
125
126
|
|
|
127
|
+
|
|
128
|
+
|
|
126
129
|
|
|
127
130
|
|
|
128
131
|
|
|
@@ -154,6 +157,7 @@ class CallSession {
|
|
|
154
157
|
videoRemotelyDowngraded,
|
|
155
158
|
sipSession,
|
|
156
159
|
answerTime,
|
|
160
|
+
conference,
|
|
157
161
|
} ) {
|
|
158
162
|
this.callId = callId;
|
|
159
163
|
this.sipCallId = sipCallId;
|
|
@@ -182,6 +186,7 @@ class CallSession {
|
|
|
182
186
|
this.videoRemotelyDowngraded = videoRemotelyDowngraded;
|
|
183
187
|
this.sipSession = sipSession;
|
|
184
188
|
this.answerTime = answerTime || this.answerTime;
|
|
189
|
+
this.conference = conference;
|
|
185
190
|
|
|
186
191
|
// Useful to compare instead of instanceof with minified code
|
|
187
192
|
this.type = 'CallSession';
|
|
@@ -239,6 +244,10 @@ class CallSession {
|
|
|
239
244
|
this.screensharing = false;
|
|
240
245
|
}
|
|
241
246
|
|
|
247
|
+
setIsConference(conference ) {
|
|
248
|
+
this.conference = conference;
|
|
249
|
+
}
|
|
250
|
+
|
|
242
251
|
isIncoming() {
|
|
243
252
|
return !this.isCaller && !this.answered;
|
|
244
253
|
}
|
|
@@ -315,6 +324,10 @@ class CallSession {
|
|
|
315
324
|
return this.sipStatus === sessionState.SessionState.Terminated;
|
|
316
325
|
}
|
|
317
326
|
|
|
327
|
+
isConference() {
|
|
328
|
+
return this.conference;
|
|
329
|
+
}
|
|
330
|
+
|
|
318
331
|
getElapsedTimeInSeconds() {
|
|
319
332
|
if (!this.startTime) {
|
|
320
333
|
return 0;
|
|
@@ -406,6 +419,7 @@ class CallSession {
|
|
|
406
419
|
cameraEnabled: false,
|
|
407
420
|
dialedExtension: call.dialedExtension,
|
|
408
421
|
call,
|
|
422
|
+
conference: false, // @FIXME?
|
|
409
423
|
});
|
|
410
424
|
}
|
|
411
425
|
}
|
|
@@ -61,6 +61,7 @@ var updateFrom = (instance , from ) => {
|
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
|
|
64
|
+
|
|
64
65
|
|
|
65
66
|
|
|
66
67
|
class CallSession {
|
|
@@ -123,6 +124,8 @@ class CallSession {
|
|
|
123
124
|
|
|
124
125
|
|
|
125
126
|
|
|
127
|
+
|
|
128
|
+
|
|
126
129
|
|
|
127
130
|
|
|
128
131
|
|
|
@@ -154,6 +157,7 @@ class CallSession {
|
|
|
154
157
|
videoRemotelyDowngraded,
|
|
155
158
|
sipSession,
|
|
156
159
|
answerTime,
|
|
160
|
+
conference,
|
|
157
161
|
} ) {
|
|
158
162
|
this.callId = callId;
|
|
159
163
|
this.sipCallId = sipCallId;
|
|
@@ -182,6 +186,7 @@ class CallSession {
|
|
|
182
186
|
this.videoRemotelyDowngraded = videoRemotelyDowngraded;
|
|
183
187
|
this.sipSession = sipSession;
|
|
184
188
|
this.answerTime = answerTime || this.answerTime;
|
|
189
|
+
this.conference = conference;
|
|
185
190
|
|
|
186
191
|
// Useful to compare instead of instanceof with minified code
|
|
187
192
|
this.type = 'CallSession';
|
|
@@ -239,6 +244,10 @@ class CallSession {
|
|
|
239
244
|
this.screensharing = false;
|
|
240
245
|
}
|
|
241
246
|
|
|
247
|
+
setIsConference(conference ) {
|
|
248
|
+
this.conference = conference;
|
|
249
|
+
}
|
|
250
|
+
|
|
242
251
|
isIncoming() {
|
|
243
252
|
return !this.isCaller && !this.answered;
|
|
244
253
|
}
|
|
@@ -315,6 +324,10 @@ class CallSession {
|
|
|
315
324
|
return this.sipStatus === sessionState.SessionState.Terminated;
|
|
316
325
|
}
|
|
317
326
|
|
|
327
|
+
isConference() {
|
|
328
|
+
return this.conference;
|
|
329
|
+
}
|
|
330
|
+
|
|
318
331
|
getElapsedTimeInSeconds() {
|
|
319
332
|
if (!this.startTime) {
|
|
320
333
|
return 0;
|
|
@@ -406,6 +419,7 @@ class CallSession {
|
|
|
406
419
|
cameraEnabled: false,
|
|
407
420
|
dialedExtension: call.dialedExtension,
|
|
408
421
|
call,
|
|
422
|
+
conference: false, // @FIXME?
|
|
409
423
|
});
|
|
410
424
|
}
|
|
411
425
|
}
|
|
@@ -193,6 +193,7 @@ const LINE_STATE = {
|
|
|
193
193
|
|
|
194
194
|
|
|
195
195
|
|
|
196
|
+
|
|
196
197
|
|
|
197
198
|
|
|
198
199
|
|
|
@@ -229,6 +230,7 @@ const LINE_STATE = {
|
|
|
229
230
|
|
|
230
231
|
|
|
231
232
|
|
|
233
|
+
|
|
232
234
|
|
|
233
235
|
|
|
234
236
|
|
|
@@ -260,6 +262,7 @@ class Profile {
|
|
|
260
262
|
|
|
261
263
|
|
|
262
264
|
|
|
265
|
+
|
|
263
266
|
|
|
264
267
|
|
|
265
268
|
|
|
@@ -276,6 +279,7 @@ class Profile {
|
|
|
276
279
|
lines: plain.lines.map(line => Line.parse(line)),
|
|
277
280
|
username: plain.username,
|
|
278
281
|
mobileNumber: plain.mobile_phone_number || '',
|
|
282
|
+
ringSeconds: plain.ring_seconds,
|
|
279
283
|
forwards: [
|
|
280
284
|
ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
|
|
281
285
|
ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
|
|
@@ -312,6 +316,7 @@ class Profile {
|
|
|
312
316
|
switchboards,
|
|
313
317
|
agent,
|
|
314
318
|
status,
|
|
319
|
+
ringSeconds,
|
|
315
320
|
sipLines,
|
|
316
321
|
callPickupTargetUsers,
|
|
317
322
|
onlineCallRecordEnabled,
|
|
@@ -333,6 +338,7 @@ class Profile {
|
|
|
333
338
|
this.status = status;
|
|
334
339
|
this.callPickupTargetUsers = callPickupTargetUsers;
|
|
335
340
|
this.onlineCallRecordEnabled = onlineCallRecordEnabled;
|
|
341
|
+
this.ringSeconds = ringSeconds;
|
|
336
342
|
|
|
337
343
|
this.sipLines = sipLines || [];
|
|
338
344
|
}
|
|
@@ -61,6 +61,7 @@ var updateFrom = (instance , from ) => {
|
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
|
|
64
|
+
|
|
64
65
|
|
|
65
66
|
|
|
66
67
|
class CallSession {
|
|
@@ -123,6 +124,8 @@ class CallSession {
|
|
|
123
124
|
|
|
124
125
|
|
|
125
126
|
|
|
127
|
+
|
|
128
|
+
|
|
126
129
|
|
|
127
130
|
|
|
128
131
|
|
|
@@ -154,6 +157,7 @@ class CallSession {
|
|
|
154
157
|
videoRemotelyDowngraded,
|
|
155
158
|
sipSession,
|
|
156
159
|
answerTime,
|
|
160
|
+
conference,
|
|
157
161
|
} ) {
|
|
158
162
|
this.callId = callId;
|
|
159
163
|
this.sipCallId = sipCallId;
|
|
@@ -182,6 +186,7 @@ class CallSession {
|
|
|
182
186
|
this.videoRemotelyDowngraded = videoRemotelyDowngraded;
|
|
183
187
|
this.sipSession = sipSession;
|
|
184
188
|
this.answerTime = answerTime || this.answerTime;
|
|
189
|
+
this.conference = conference;
|
|
185
190
|
|
|
186
191
|
// Useful to compare instead of instanceof with minified code
|
|
187
192
|
this.type = 'CallSession';
|
|
@@ -239,6 +244,10 @@ class CallSession {
|
|
|
239
244
|
this.screensharing = false;
|
|
240
245
|
}
|
|
241
246
|
|
|
247
|
+
setIsConference(conference ) {
|
|
248
|
+
this.conference = conference;
|
|
249
|
+
}
|
|
250
|
+
|
|
242
251
|
isIncoming() {
|
|
243
252
|
return !this.isCaller && !this.answered;
|
|
244
253
|
}
|
|
@@ -315,6 +324,10 @@ class CallSession {
|
|
|
315
324
|
return this.sipStatus === sessionState.SessionState.Terminated;
|
|
316
325
|
}
|
|
317
326
|
|
|
327
|
+
isConference() {
|
|
328
|
+
return this.conference;
|
|
329
|
+
}
|
|
330
|
+
|
|
318
331
|
getElapsedTimeInSeconds() {
|
|
319
332
|
if (!this.startTime) {
|
|
320
333
|
return 0;
|
|
@@ -406,6 +419,7 @@ class CallSession {
|
|
|
406
419
|
cameraEnabled: false,
|
|
407
420
|
dialedExtension: call.dialedExtension,
|
|
408
421
|
call,
|
|
422
|
+
conference: false, // @FIXME?
|
|
409
423
|
});
|
|
410
424
|
}
|
|
411
425
|
}
|
|
@@ -207,6 +207,7 @@ const LINE_STATE = {
|
|
|
207
207
|
|
|
208
208
|
|
|
209
209
|
|
|
210
|
+
|
|
210
211
|
|
|
211
212
|
|
|
212
213
|
|
|
@@ -243,6 +244,7 @@ const LINE_STATE = {
|
|
|
243
244
|
|
|
244
245
|
|
|
245
246
|
|
|
247
|
+
|
|
246
248
|
|
|
247
249
|
|
|
248
250
|
|
|
@@ -274,6 +276,7 @@ class Profile {
|
|
|
274
276
|
|
|
275
277
|
|
|
276
278
|
|
|
279
|
+
|
|
277
280
|
|
|
278
281
|
|
|
279
282
|
|
|
@@ -290,6 +293,7 @@ class Profile {
|
|
|
290
293
|
lines: plain.lines.map(line => Line.parse(line)),
|
|
291
294
|
username: plain.username,
|
|
292
295
|
mobileNumber: plain.mobile_phone_number || '',
|
|
296
|
+
ringSeconds: plain.ring_seconds,
|
|
293
297
|
forwards: [
|
|
294
298
|
ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
|
|
295
299
|
ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
|
|
@@ -326,6 +330,7 @@ class Profile {
|
|
|
326
330
|
switchboards,
|
|
327
331
|
agent,
|
|
328
332
|
status,
|
|
333
|
+
ringSeconds,
|
|
329
334
|
sipLines,
|
|
330
335
|
callPickupTargetUsers,
|
|
331
336
|
onlineCallRecordEnabled,
|
|
@@ -347,6 +352,7 @@ class Profile {
|
|
|
347
352
|
this.status = status;
|
|
348
353
|
this.callPickupTargetUsers = callPickupTargetUsers;
|
|
349
354
|
this.onlineCallRecordEnabled = onlineCallRecordEnabled;
|
|
355
|
+
this.ringSeconds = ringSeconds;
|
|
350
356
|
|
|
351
357
|
this.sipLines = sipLines || [];
|
|
352
358
|
}
|