@wazo/sdk 0.37.33 → 0.37.36
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 +1 -0
- package/dist/wazo-sdk.js +2 -2
- package/esm/__tests__/api-client.test.js +17 -0
- package/esm/__tests__/web-rtc-client.test.js +18 -1
- package/esm/api/auth.js +5 -0
- package/esm/api/call-logd.js +6 -0
- package/esm/api/chatd.js +6 -0
- package/esm/api/confd.js +6 -0
- package/esm/api-client.js +17 -0
- package/esm/checker/Checker.js +18 -1
- package/esm/checker/checks/aor.js +17 -0
- package/esm/checker/checks/api.js +17 -0
- package/esm/checker/checks/index.js +18 -1
- package/esm/checker/checks/webrtc-transport.js +18 -1
- package/esm/checker/checks/webrtc.js +18 -1
- package/esm/domain/AdHocAPIConference.js +21 -0
- package/esm/domain/CallLog.js +6 -0
- package/esm/domain/CallSession.js +14 -0
- package/esm/domain/Features.js +17 -0
- package/esm/domain/Phone/CTIPhone.js +31 -0
- package/esm/domain/Phone/WebRTCPhone.js +65 -15
- package/esm/domain/Profile.js +6 -0
- package/esm/domain/__tests__/CallLog.test.js +10 -0
- 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 +93 -22
- package/esm/service/CallApi.js +17 -0
- package/esm/service/getApiClient.js +17 -0
- package/esm/simple/Auth.js +93 -22
- package/esm/simple/Configuration.js +93 -22
- package/esm/simple/Directory.js +17 -0
- package/esm/simple/Phone.js +93 -22
- package/esm/simple/index.js +93 -22
- package/esm/simple/room/LocalParticipant.js +93 -22
- package/esm/simple/room/Participant.js +93 -22
- package/esm/simple/room/RemoteParticipant.js +93 -22
- package/esm/simple/room/Room.js +93 -22
- package/esm/simple/room/SipRoom.js +93 -22
- package/esm/simple/room/Stream.js +93 -22
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +93 -22
- package/esm/simple/utils.js +93 -22
- package/esm/web-rtc-client.js +18 -1
- package/lib/__tests__/api-client.test.js +17 -0
- package/lib/__tests__/web-rtc-client.test.js +18 -1
- package/lib/api/auth.js +5 -0
- package/lib/api/call-logd.js +6 -0
- package/lib/api/chatd.js +6 -0
- package/lib/api/confd.js +6 -0
- package/lib/api-client.js +17 -0
- package/lib/checker/Checker.js +18 -1
- package/lib/checker/checks/aor.js +17 -0
- package/lib/checker/checks/api.js +17 -0
- package/lib/checker/checks/index.js +18 -1
- package/lib/checker/checks/webrtc-transport.js +18 -1
- package/lib/checker/checks/webrtc.js +18 -1
- package/lib/domain/AdHocAPIConference.js +21 -0
- package/lib/domain/CallLog.js +6 -0
- package/lib/domain/CallSession.js +14 -0
- package/lib/domain/Features.js +17 -0
- package/lib/domain/Phone/CTIPhone.js +31 -0
- package/lib/domain/Phone/WebRTCPhone.js +65 -15
- package/lib/domain/Profile.js +6 -0
- package/lib/domain/__tests__/CallLog.test.js +10 -0
- 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 +93 -22
- package/lib/service/CallApi.js +17 -0
- package/lib/service/getApiClient.js +17 -0
- package/lib/simple/Auth.js +93 -22
- package/lib/simple/Configuration.js +93 -22
- package/lib/simple/Directory.js +17 -0
- package/lib/simple/Phone.js +93 -22
- package/lib/simple/index.js +93 -22
- package/lib/simple/room/LocalParticipant.js +93 -22
- package/lib/simple/room/Participant.js +93 -22
- package/lib/simple/room/RemoteParticipant.js +93 -22
- package/lib/simple/room/Room.js +93 -22
- package/lib/simple/room/SipRoom.js +93 -22
- package/lib/simple/room/Stream.js +93 -22
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +93 -22
- package/lib/simple/utils.js +93 -22
- package/lib/web-rtc-client.js +18 -1
- package/package.json +1 -1
- package/src/api/auth.js +5 -0
- package/src/domain/AdHocAPIConference.js +4 -0
- package/src/domain/CallLog.js +6 -0
- package/src/domain/CallSession.js +14 -0
- package/src/domain/Phone/WebRTCPhone.js +51 -15
- package/src/domain/Profile.js +6 -0
- package/src/domain/__tests__/CallLog.test.js +4 -0
- package/src/simple/Phone.js +6 -6
- package/src/web-rtc-client.js +1 -1
|
@@ -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) {
|
|
@@ -1731,6 +1749,12 @@ class WebRTCPhone extends Emitter {
|
|
|
1731
1749
|
return Promise.resolve(null);
|
|
1732
1750
|
}
|
|
1733
1751
|
|
|
1752
|
+
const sipSessionId = this.getSipSessionIdFromCallSession(callSession);
|
|
1753
|
+
if (sipSessionId && !(sipSessionId in this.callSessions)) {
|
|
1754
|
+
logger.warn('Call session already ended or not found, can\'t accept it.', { sipSessionId });
|
|
1755
|
+
return Promise.resolve(null);
|
|
1756
|
+
}
|
|
1757
|
+
|
|
1734
1758
|
if (callSession.getId() in this.acceptedSessions) {
|
|
1735
1759
|
logger.warn('CallSession already accepted.', { id: callSession ? callSession.getId() : 'n/a' });
|
|
1736
1760
|
return Promise.resolve(callSession.sipCallId);
|
|
@@ -1810,22 +1834,22 @@ class WebRTCPhone extends Emitter {
|
|
|
1810
1834
|
}
|
|
1811
1835
|
}
|
|
1812
1836
|
|
|
1813
|
-
hold(callSession , withEvent = true
|
|
1837
|
+
hold(callSession , withEvent = true) {
|
|
1814
1838
|
logger.info('WebRTC hold', { id: callSession.getId() });
|
|
1815
1839
|
|
|
1816
1840
|
const sipSession = this.findSipSession(callSession);
|
|
1817
1841
|
|
|
1818
|
-
return sipSession ? this.holdSipSession(sipSession, callSession, withEvent
|
|
1842
|
+
return sipSession ? this.holdSipSession(sipSession, callSession, withEvent) : null;
|
|
1819
1843
|
}
|
|
1820
1844
|
|
|
1821
1845
|
// @Deprecated
|
|
1822
|
-
unhold(callSession , withEvent = true
|
|
1846
|
+
unhold(callSession , withEvent = true) {
|
|
1823
1847
|
console.warn('Please note that `phone.unhold()` is being deprecated; `phone.resume()` is the preferred method');
|
|
1824
1848
|
|
|
1825
|
-
return this.resume(callSession,
|
|
1849
|
+
return this.resume(callSession, withEvent);
|
|
1826
1850
|
}
|
|
1827
1851
|
|
|
1828
|
-
resume(callSession ,
|
|
1852
|
+
resume(callSession , withEvent = true) {
|
|
1829
1853
|
logger.info('WebRTC resume called', { id: callSession ? callSession.getId() : null });
|
|
1830
1854
|
|
|
1831
1855
|
const sipSession = this.findSipSession(callSession);
|
|
@@ -1838,10 +1862,14 @@ class WebRTCPhone extends Emitter {
|
|
|
1838
1862
|
// Hold current session if different from the current one (we don't want 2 sessions active at the same time).
|
|
1839
1863
|
if (this.currentSipSession && this.currentSipSession.id !== sipSession.id) {
|
|
1840
1864
|
logger.info('WebRTC hold call after resume', { id: this.currentSipSession.id });
|
|
1841
|
-
this.holdSipSession(
|
|
1865
|
+
this.holdSipSession(
|
|
1866
|
+
this.currentSipSession,
|
|
1867
|
+
this.currentCallSession,
|
|
1868
|
+
withEvent,
|
|
1869
|
+
);
|
|
1842
1870
|
}
|
|
1843
1871
|
|
|
1844
|
-
const promise = this.unholdSipSession(sipSession, callSession, withEvent
|
|
1872
|
+
const promise = this.unholdSipSession(sipSession, callSession, withEvent);
|
|
1845
1873
|
this.currentSipSession = sipSession;
|
|
1846
1874
|
if (callSession) {
|
|
1847
1875
|
this.currentCallSession = callSession;
|
|
@@ -1854,7 +1882,6 @@ class WebRTCPhone extends Emitter {
|
|
|
1854
1882
|
sipSession ,
|
|
1855
1883
|
callSession ,
|
|
1856
1884
|
withEvent = true,
|
|
1857
|
-
isConference = false,
|
|
1858
1885
|
) {
|
|
1859
1886
|
if (!sipSession) {
|
|
1860
1887
|
return new Promise((resolve, reject) => reject(new Error('No session to hold')));
|
|
@@ -1875,6 +1902,8 @@ class WebRTCPhone extends Emitter {
|
|
|
1875
1902
|
await this.client.downgradeToAudio(sipSession);
|
|
1876
1903
|
}
|
|
1877
1904
|
|
|
1905
|
+
const isConference = !!callSession && callSession.isConference();
|
|
1906
|
+
|
|
1878
1907
|
const promise = this.client.hold(sipSession, isConference, hasVideo);
|
|
1879
1908
|
if (withEvent) {
|
|
1880
1909
|
this.eventEmitter.emit(ON_CALL_HELD, this._createCallSession(sipSession, callSession));
|
|
@@ -1887,11 +1916,13 @@ class WebRTCPhone extends Emitter {
|
|
|
1887
1916
|
sipSession ,
|
|
1888
1917
|
callSession ,
|
|
1889
1918
|
withEvent = true,
|
|
1890
|
-
isConference = false,
|
|
1891
1919
|
) {
|
|
1892
1920
|
if (!sipSession) {
|
|
1893
1921
|
return new Promise((resolve, reject) => reject(new Error('No session to unhold')));
|
|
1894
1922
|
}
|
|
1923
|
+
|
|
1924
|
+
const isConference = !!callSession && callSession.isConference();
|
|
1925
|
+
|
|
1895
1926
|
const sessionId = this.getSipSessionId(sipSession);
|
|
1896
1927
|
logger.info('WebRTC unhold sip session', { sessionId, isConference });
|
|
1897
1928
|
|
|
@@ -2033,7 +2064,11 @@ class WebRTCPhone extends Emitter {
|
|
|
2033
2064
|
await this.client.register();
|
|
2034
2065
|
}
|
|
2035
2066
|
if (this.currentSipSession) {
|
|
2036
|
-
this.holdSipSession(
|
|
2067
|
+
this.holdSipSession(
|
|
2068
|
+
this.currentSipSession,
|
|
2069
|
+
this.currentCallSession,
|
|
2070
|
+
true,
|
|
2071
|
+
).catch(e => {
|
|
2037
2072
|
logger.warn('Unable to hold current session when making another call', e);
|
|
2038
2073
|
});
|
|
2039
2074
|
}
|
|
@@ -2048,6 +2083,7 @@ class WebRTCPhone extends Emitter {
|
|
|
2048
2083
|
return Promise.resolve(null);
|
|
2049
2084
|
}
|
|
2050
2085
|
const callSession = this._createOutgoingCallSession(sipSession, cameraEnabled || false);
|
|
2086
|
+
callSession.setIsConference(conference);
|
|
2051
2087
|
callSession.creationTime = new Date();
|
|
2052
2088
|
this._updateCallSession(callSession);
|
|
2053
2089
|
|
|
@@ -2355,9 +2391,17 @@ class WebRTCPhone extends Emitter {
|
|
|
2355
2391
|
});
|
|
2356
2392
|
|
|
2357
2393
|
this.client.on(this.client.ACCEPTED, (sipSession ) => {
|
|
2358
|
-
|
|
2394
|
+
const sessionId = this.getSipSessionId(sipSession);
|
|
2395
|
+
const hasSession = sessionId in this.callSessions;
|
|
2396
|
+
|
|
2397
|
+
logger.info('WebRTC call accepted', { sipId: sessionId, hasSession });
|
|
2398
|
+
|
|
2399
|
+
if (!hasSession) {
|
|
2400
|
+
logger.warn('Call accepted ignored, session is no longer present in the WebRtcPhone', { sessionId });
|
|
2401
|
+
return;
|
|
2402
|
+
}
|
|
2359
2403
|
|
|
2360
|
-
this._onCallAccepted(sipSession, this.client.hasVideo(
|
|
2404
|
+
this._onCallAccepted(sipSession, this.client.hasVideo(sessionId));
|
|
2361
2405
|
|
|
2362
2406
|
if (this.audioOutputDeviceId) {
|
|
2363
2407
|
this.client.changeAudioOutputDevice(this.audioOutputDeviceId);
|
|
@@ -2493,9 +2537,14 @@ class WebRTCPhone extends Emitter {
|
|
|
2493
2537
|
return this.client.getSipSessionId(sipSession);
|
|
2494
2538
|
}
|
|
2495
2539
|
|
|
2496
|
-
|
|
2540
|
+
getSipSessionIdFromCallSession(callSession ) {
|
|
2497
2541
|
const sipSession = this.findSipSession(callSession);
|
|
2498
|
-
|
|
2542
|
+
|
|
2543
|
+
return sipSession ? this.getSipSessionId(sipSession) : null;
|
|
2544
|
+
}
|
|
2545
|
+
|
|
2546
|
+
_updateCallSession(callSession ) {
|
|
2547
|
+
const sipSessionId = this.getSipSessionIdFromCallSession(callSession);
|
|
2499
2548
|
|
|
2500
2549
|
if (sipSessionId) {
|
|
2501
2550
|
this.callSessions[sipSessionId] = callSession;
|
|
@@ -2613,6 +2662,7 @@ class WebRTCPhone extends Emitter {
|
|
|
2613
2662
|
recording: fromSession ? fromSession.isRecording() : false,
|
|
2614
2663
|
recordingPaused: false, // @TODO
|
|
2615
2664
|
sipSession,
|
|
2665
|
+
conference: !!fromSession && fromSession.isConference(),
|
|
2616
2666
|
...extra,
|
|
2617
2667
|
});
|
|
2618
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
|
}
|
|
@@ -93,11 +93,13 @@ class Recording {
|
|
|
93
93
|
|
|
94
94
|
|
|
95
95
|
|
|
96
|
+
|
|
96
97
|
|
|
97
98
|
|
|
98
99
|
|
|
99
100
|
|
|
100
101
|
|
|
102
|
+
|
|
101
103
|
|
|
102
104
|
|
|
103
105
|
|
|
@@ -118,10 +120,12 @@ class Recording {
|
|
|
118
120
|
|
|
119
121
|
|
|
120
122
|
|
|
123
|
+
|
|
121
124
|
|
|
122
125
|
|
|
123
126
|
|
|
124
127
|
|
|
128
|
+
|
|
125
129
|
|
|
126
130
|
|
|
127
131
|
|
|
@@ -183,10 +187,12 @@ class CallLog {
|
|
|
183
187
|
|| plain.destination_extension
|
|
184
188
|
|| `meeting-${plain.requested_name || plain.destination_name || ''}`,
|
|
185
189
|
name: plain.requested_name || plain.destination_name || '',
|
|
190
|
+
uuid: plain.destination_user_uuid,
|
|
186
191
|
},
|
|
187
192
|
source: {
|
|
188
193
|
extension: plain.source_extension,
|
|
189
194
|
name: plain.source_name,
|
|
195
|
+
uuid: plain.source_user_uuid,
|
|
190
196
|
},
|
|
191
197
|
id: plain.id,
|
|
192
198
|
duration: (plain.duration || 0) * 1000, // duration is in seconds
|
|
@@ -329,8 +335,10 @@ describe('CallLog domain', () => {
|
|
|
329
335
|
call_direction: 'outbound',
|
|
330
336
|
source_extension: '8020',
|
|
331
337
|
source_name: 'Jonathan Lessard',
|
|
338
|
+
source_user_uuid: '123',
|
|
332
339
|
destination_extension: '4182250459',
|
|
333
340
|
destination_name: null,
|
|
341
|
+
destination_user_uuid: '456',
|
|
334
342
|
duration: 4,
|
|
335
343
|
start: '2017-08-06T13:50:55.819057+00:00',
|
|
336
344
|
end: '2017-08-08T13:51:23.822529+00:00',
|
|
@@ -361,10 +369,12 @@ describe('CallLog domain', () => {
|
|
|
361
369
|
destination: {
|
|
362
370
|
extension: '4182250459',
|
|
363
371
|
name: '',
|
|
372
|
+
uuid: '456',
|
|
364
373
|
},
|
|
365
374
|
source: {
|
|
366
375
|
extension: '8020',
|
|
367
376
|
name: 'Jonathan Lessard',
|
|
377
|
+
uuid: '123',
|
|
368
378
|
},
|
|
369
379
|
id: 215,
|
|
370
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
|
}
|