@wazo/sdk 0.37.1 → 0.37.2
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/dist/wazo-sdk.js +5 -5
- package/esm/__tests__/api-client.test.js +7 -1
- package/esm/__tests__/web-rtc-client.test.js +13 -1
- package/esm/api/agentd.js +7 -1
- package/esm/api/amid.js +7 -1
- package/esm/api/application.js +7 -1
- package/esm/api/auth.js +7 -1
- package/esm/api/call-logd.js +7 -1
- package/esm/api/calld.js +7 -1
- package/esm/api/chatd.js +7 -1
- package/esm/api/confd.js +7 -1
- package/esm/api/ctid-ng.js +7 -1
- package/esm/api/dird.js +7 -1
- package/esm/api/webhookd.js +7 -1
- package/esm/api-client.js +7 -1
- package/esm/checker/Checker.js +13 -1
- package/esm/checker/checks/aor.js +7 -1
- package/esm/checker/checks/api.js +7 -1
- package/esm/checker/checks/index.js +13 -1
- package/esm/checker/checks/wazo-websocket.js +7 -1
- package/esm/checker/checks/webrtc-transport.js +13 -1
- package/esm/checker/checks/webrtc.js +13 -1
- package/esm/domain/AdHocAPIConference.js +7 -1
- package/esm/domain/Features.js +7 -1
- package/esm/domain/Phone/CTIPhone.js +11 -1
- package/esm/domain/Phone/WebRTCPhone.js +7 -1
- package/esm/index.js +5648 -5229
- package/esm/lib/WazoSessionDescriptionHandler.js +7 -1
- package/esm/service/CallApi.js +7 -1
- package/esm/service/IssueReporter.js +7 -1
- package/esm/service/__tests__/IssueReporter.test.js +9 -1
- package/esm/service/getApiClient.js +7 -1
- package/esm/simple/Auth.js +426 -9
- package/esm/simple/Configuration.js +426 -9
- package/esm/simple/Directory.js +7 -1
- package/esm/simple/Phone.js +426 -9
- package/esm/simple/Websocket.js +7 -1
- package/esm/simple/index.js +426 -9
- package/esm/simple/room/LocalParticipant.js +426 -9
- package/esm/simple/room/Participant.js +426 -9
- package/esm/simple/room/RemoteParticipant.js +426 -9
- package/esm/simple/room/Room.js +426 -9
- package/esm/simple/room/Stream.js +426 -9
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +426 -9
- package/esm/simple/utils.js +426 -9
- package/esm/utils/__tests__/api-requester.test.js +7 -1
- package/esm/utils/api-requester.js +7 -1
- package/esm/web-rtc-client.js +13 -1
- package/esm/websocket-client.js +7 -1
- package/lib/__tests__/api-client.test.js +7 -1
- package/lib/__tests__/web-rtc-client.test.js +13 -1
- package/lib/api/agentd.js +7 -1
- package/lib/api/amid.js +7 -1
- package/lib/api/application.js +7 -1
- package/lib/api/auth.js +7 -1
- package/lib/api/call-logd.js +7 -1
- package/lib/api/calld.js +7 -1
- package/lib/api/chatd.js +7 -1
- package/lib/api/confd.js +7 -1
- package/lib/api/ctid-ng.js +7 -1
- package/lib/api/dird.js +7 -1
- package/lib/api/webhookd.js +7 -1
- package/lib/api-client.js +7 -1
- package/lib/checker/Checker.js +13 -1
- package/lib/checker/checks/aor.js +7 -1
- package/lib/checker/checks/api.js +7 -1
- package/lib/checker/checks/index.js +13 -1
- package/lib/checker/checks/wazo-websocket.js +7 -1
- package/lib/checker/checks/webrtc-transport.js +13 -1
- package/lib/checker/checks/webrtc.js +13 -1
- package/lib/domain/AdHocAPIConference.js +7 -1
- package/lib/domain/Features.js +7 -1
- package/lib/domain/Phone/CTIPhone.js +11 -1
- package/lib/domain/Phone/WebRTCPhone.js +7 -1
- package/lib/index.js +5648 -5229
- package/lib/lib/WazoSessionDescriptionHandler.js +7 -1
- package/lib/service/CallApi.js +7 -1
- package/lib/service/IssueReporter.js +7 -1
- package/lib/service/__tests__/IssueReporter.test.js +9 -1
- package/lib/service/getApiClient.js +7 -1
- package/lib/simple/Auth.js +426 -9
- package/lib/simple/Configuration.js +426 -9
- package/lib/simple/Directory.js +7 -1
- package/lib/simple/Phone.js +426 -9
- package/lib/simple/Websocket.js +7 -1
- package/lib/simple/index.js +426 -9
- package/lib/simple/room/LocalParticipant.js +426 -9
- package/lib/simple/room/Participant.js +426 -9
- package/lib/simple/room/RemoteParticipant.js +426 -9
- package/lib/simple/room/Room.js +426 -9
- package/lib/simple/room/Stream.js +426 -9
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +426 -9
- package/lib/simple/utils.js +426 -9
- package/lib/utils/__tests__/api-requester.test.js +7 -1
- package/lib/utils/api-requester.js +7 -1
- package/lib/web-rtc-client.js +13 -1
- package/lib/websocket-client.js +7 -1
- package/package.json +1 -1
- package/src/domain/Phone/CTIPhone.js +4 -0
- package/src/domain/Phone/Phone.js +2 -0
- package/src/index.js +4 -0
- package/src/service/IssueReporter.js +7 -1
- package/src/service/__tests__/IssueReporter.test.js +2 -0
- package/src/simple/index.js +4 -0
- package/src/web-rtc-client.js +6 -0
package/esm/simple/utils.js
CHANGED
|
@@ -1809,7 +1809,13 @@ class IssueReporter {
|
|
|
1809
1809
|
}
|
|
1810
1810
|
|
|
1811
1811
|
_isLevelAbove(level1 , level2 ) {
|
|
1812
|
-
|
|
1812
|
+
const index1 = LOG_LEVELS.indexOf(level1);
|
|
1813
|
+
const index2 = LOG_LEVELS.indexOf(level2);
|
|
1814
|
+
if (index1 === -1 || index2 === -1) {
|
|
1815
|
+
return false;
|
|
1816
|
+
}
|
|
1817
|
+
|
|
1818
|
+
return index1 > index2;
|
|
1813
1819
|
}
|
|
1814
1820
|
|
|
1815
1821
|
_makeCategory(category ) {
|
|
@@ -1832,7 +1838,7 @@ var IssueReporter$1 = new IssueReporter();
|
|
|
1832
1838
|
|
|
1833
1839
|
const methods = ['head', 'get', 'post', 'put', 'delete'];
|
|
1834
1840
|
|
|
1835
|
-
const logger$
|
|
1841
|
+
const logger$b = IssueReporter$1 ? IssueReporter$1.loggerFor('api') : console;
|
|
1836
1842
|
|
|
1837
1843
|
// Use a function here to be able to mock it in tests
|
|
1838
1844
|
const realFetch = () => {
|
|
@@ -1971,7 +1977,7 @@ class ApiRequester {
|
|
|
1971
1977
|
};
|
|
1972
1978
|
|
|
1973
1979
|
if (this.refreshTokenPromise) {
|
|
1974
|
-
logger$
|
|
1980
|
+
logger$b.info('A token is already refreshing, waiting ...', { url });
|
|
1975
1981
|
await this.refreshTokenPromise;
|
|
1976
1982
|
}
|
|
1977
1983
|
|
|
@@ -1991,7 +1997,7 @@ class ApiRequester {
|
|
|
1991
1997
|
return promise.then(async (err ) => {
|
|
1992
1998
|
// Check if the token is still valid
|
|
1993
1999
|
if (firstCall && this._checkTokenExpired(response, err)) {
|
|
1994
|
-
logger$
|
|
2000
|
+
logger$b.warn('token expired', { error: err.reason });
|
|
1995
2001
|
// Replay the call after refreshing the token
|
|
1996
2002
|
return this._replayWithNewToken(err, path, method, body, headers, parse);
|
|
1997
2003
|
}
|
|
@@ -2001,7 +2007,7 @@ class ApiRequester {
|
|
|
2001
2007
|
: exceptionClass.fromResponse(err, response.status);
|
|
2002
2008
|
|
|
2003
2009
|
if (this.shouldLogErrors) {
|
|
2004
|
-
logger$
|
|
2010
|
+
logger$b.error('API error', error);
|
|
2005
2011
|
}
|
|
2006
2012
|
|
|
2007
2013
|
throw error;
|
|
@@ -2011,7 +2017,7 @@ class ApiRequester {
|
|
|
2011
2017
|
return newParse(response, isJson);
|
|
2012
2018
|
}).catch(error => {
|
|
2013
2019
|
if (this.shouldLogErrors) {
|
|
2014
|
-
logger$
|
|
2020
|
+
logger$b.error('Fetch failed', { url, options, message: error.message, stack: error.stack });
|
|
2015
2021
|
}
|
|
2016
2022
|
|
|
2017
2023
|
throw error;
|
|
@@ -2039,13 +2045,13 @@ class ApiRequester {
|
|
|
2039
2045
|
) {
|
|
2040
2046
|
const isTokenNotFound = this._isTokenNotFound(err);
|
|
2041
2047
|
let newPath = path;
|
|
2042
|
-
logger$
|
|
2048
|
+
logger$b.info('refreshing token', { inProgress: !!this.refreshTokenPromise });
|
|
2043
2049
|
|
|
2044
2050
|
this.refreshTokenPromise = this.refreshTokenPromise || this.refreshTokenCallback();
|
|
2045
2051
|
|
|
2046
2052
|
return this.refreshTokenPromise.then(() => {
|
|
2047
2053
|
this.refreshTokenPromise = null;
|
|
2048
|
-
logger$
|
|
2054
|
+
logger$b.info('token refreshed', { isTokenNotFound });
|
|
2049
2055
|
if (isTokenNotFound) {
|
|
2050
2056
|
const pathParts = path.split('/');
|
|
2051
2057
|
pathParts.pop();
|
|
@@ -3726,11 +3732,414 @@ class IndirectTransfer {
|
|
|
3726
3732
|
}
|
|
3727
3733
|
|
|
3728
3734
|
//
|
|
3735
|
+
|
|
3736
|
+
class CallApi {
|
|
3737
|
+
static async fetchCallLogs(offset , limit ) {
|
|
3738
|
+
return getApiClient().callLogd.listCallLogs(offset, limit);
|
|
3739
|
+
}
|
|
3740
|
+
|
|
3741
|
+
static async fetchDistinctCallLogs(offset , limit , distinct = 'peer_exten') {
|
|
3742
|
+
return getApiClient().callLogd.listDistinctCallLogs(offset, limit, distinct);
|
|
3743
|
+
}
|
|
3744
|
+
|
|
3745
|
+
static async fetchActiveCalls() {
|
|
3746
|
+
return getApiClient().calld.listCalls();
|
|
3747
|
+
}
|
|
3748
|
+
|
|
3749
|
+
static async fetchCallLogsFromDate(from , number ) {
|
|
3750
|
+
return getApiClient().callLogd.listCallLogsFromDate(from, number);
|
|
3751
|
+
}
|
|
3752
|
+
|
|
3753
|
+
static async search(query , limit ) {
|
|
3754
|
+
return getApiClient().callLogd.search(query, limit);
|
|
3755
|
+
}
|
|
3756
|
+
|
|
3757
|
+
static async searchBy(field , value , limit ) {
|
|
3758
|
+
return getApiClient().callLogd.searchBy(field, value, limit);
|
|
3759
|
+
}
|
|
3760
|
+
|
|
3761
|
+
static async fetchSIP(session , line ) {
|
|
3762
|
+
const lineToUse = line || session.primaryLine();
|
|
3763
|
+
return getApiClient().confd.getUserLineSip(session.uuid, lineToUse ? lineToUse.id : null);
|
|
3764
|
+
}
|
|
3765
|
+
|
|
3766
|
+
static async cancelCall(callSession ) {
|
|
3767
|
+
return getApiClient().calld.cancelCall(callSession.callId);
|
|
3768
|
+
}
|
|
3769
|
+
|
|
3770
|
+
static async makeCall(callFromLine , extension , isMobile = false,
|
|
3771
|
+
callbackAllLines = false) {
|
|
3772
|
+
const lineId = callFromLine ? callFromLine.id : null;
|
|
3773
|
+
|
|
3774
|
+
const response = await getApiClient().calld.makeCall(extension, isMobile, lineId, callbackAllLines);
|
|
3775
|
+
return Call.parse(response);
|
|
3776
|
+
}
|
|
3777
|
+
|
|
3778
|
+
static async relocateCall(callId , line , contactIdentifier ) {
|
|
3779
|
+
return getApiClient().calld.relocateCall(callId, 'line', line, contactIdentifier);
|
|
3780
|
+
}
|
|
3781
|
+
|
|
3782
|
+
static async hold(callId ) {
|
|
3783
|
+
return getApiClient().calld.hold(callId);
|
|
3784
|
+
}
|
|
3785
|
+
|
|
3786
|
+
static async resume(callId ) {
|
|
3787
|
+
return getApiClient().calld.resume(callId);
|
|
3788
|
+
}
|
|
3789
|
+
|
|
3790
|
+
static async mute(callId ) {
|
|
3791
|
+
return getApiClient().calld.mute(callId);
|
|
3792
|
+
}
|
|
3793
|
+
|
|
3794
|
+
static async sendDTMF(callId , digits ) {
|
|
3795
|
+
return getApiClient().calld.sendDTMF(callId, digits);
|
|
3796
|
+
}
|
|
3797
|
+
|
|
3798
|
+
static async unmute(callId ) {
|
|
3799
|
+
return getApiClient().calld.unmute(callId);
|
|
3800
|
+
}
|
|
3801
|
+
|
|
3802
|
+
static async transferCall(callId , number , flow ) {
|
|
3803
|
+
return getApiClient().calld.transferCall(callId, number, flow);
|
|
3804
|
+
}
|
|
3805
|
+
|
|
3806
|
+
static async cancelCallTransfer(transferId ) {
|
|
3807
|
+
return getApiClient().calld.cancelCallTransfer(transferId);
|
|
3808
|
+
}
|
|
3809
|
+
|
|
3810
|
+
static async confirmCallTransfer(transferId ) {
|
|
3811
|
+
return getApiClient().calld.confirmCallTransfer(transferId);
|
|
3812
|
+
}
|
|
3813
|
+
}
|
|
3814
|
+
|
|
3815
|
+
//
|
|
3816
|
+
|
|
3817
|
+
const TRANSFER_FLOW_ATTENDED = 'attended';
|
|
3729
3818
|
const TRANSFER_FLOW_BLIND = 'blind';
|
|
3730
3819
|
|
|
3731
3820
|
// const MINIMUM_WAZO_ENGINE_VERSION_FOR_CTI_HOLD = '20.11';
|
|
3732
3821
|
|
|
3733
|
-
IssueReporter$1 ? IssueReporter$1.loggerFor('cti-phone') : console;
|
|
3822
|
+
const logger$a = IssueReporter$1 ? IssueReporter$1.loggerFor('cti-phone') : console;
|
|
3823
|
+
|
|
3824
|
+
class CTIPhone extends Emitter {
|
|
3825
|
+
|
|
3826
|
+
|
|
3827
|
+
|
|
3828
|
+
|
|
3829
|
+
|
|
3830
|
+
|
|
3831
|
+
|
|
3832
|
+
|
|
3833
|
+
constructor(session , isMobile = false, callbackAllLines = false) {
|
|
3834
|
+
super();
|
|
3835
|
+
logger$a.info('CTI Phone created');
|
|
3836
|
+
this.session = session;
|
|
3837
|
+
this.isMobile = isMobile;
|
|
3838
|
+
this.callbackAllLines = callbackAllLines;
|
|
3839
|
+
}
|
|
3840
|
+
|
|
3841
|
+
getOptions() {
|
|
3842
|
+
// @FIXME: temporarily disabling this option
|
|
3843
|
+
// const hold = this.session.hasEngineVersionGte(MINIMUM_WAZO_ENGINE_VERSION_FOR_CTI_HOLD);
|
|
3844
|
+
|
|
3845
|
+
return {
|
|
3846
|
+
accept: false,
|
|
3847
|
+
decline: true,
|
|
3848
|
+
mute: true,
|
|
3849
|
+
hold: false,
|
|
3850
|
+
transfer: true,
|
|
3851
|
+
sendKey: true,
|
|
3852
|
+
addParticipant: false,
|
|
3853
|
+
record: true,
|
|
3854
|
+
merge: false,
|
|
3855
|
+
};
|
|
3856
|
+
}
|
|
3857
|
+
|
|
3858
|
+
hasAnActiveCall() {
|
|
3859
|
+
return !!this.currentCall;
|
|
3860
|
+
}
|
|
3861
|
+
|
|
3862
|
+
callCount() {
|
|
3863
|
+
return this.currentCall ? 1 : 0;
|
|
3864
|
+
}
|
|
3865
|
+
|
|
3866
|
+
isWebRTC() {
|
|
3867
|
+
return false;
|
|
3868
|
+
}
|
|
3869
|
+
|
|
3870
|
+
getUserAgent() {
|
|
3871
|
+
return 'cti-phone';
|
|
3872
|
+
}
|
|
3873
|
+
|
|
3874
|
+
startHeartbeat() {
|
|
3875
|
+
}
|
|
3876
|
+
|
|
3877
|
+
setOnHeartbeatTimeout() {
|
|
3878
|
+
}
|
|
3879
|
+
|
|
3880
|
+
setOnHeartbeatCallback() {
|
|
3881
|
+
}
|
|
3882
|
+
|
|
3883
|
+
stopHeartbeat() {
|
|
3884
|
+
}
|
|
3885
|
+
|
|
3886
|
+
bindClientEvents() {
|
|
3887
|
+
}
|
|
3888
|
+
|
|
3889
|
+
onConnect() {
|
|
3890
|
+
}
|
|
3891
|
+
|
|
3892
|
+
onDisconnect() {
|
|
3893
|
+
}
|
|
3894
|
+
|
|
3895
|
+
async makeCall(number , line ) {
|
|
3896
|
+
logger$a.info('make CTI call', { number });
|
|
3897
|
+
|
|
3898
|
+
if (!number) {
|
|
3899
|
+
return null;
|
|
3900
|
+
}
|
|
3901
|
+
try {
|
|
3902
|
+
this.currentCall = await CallApi.makeCall(line, number, this.isMobile, this.callbackAllLines);
|
|
3903
|
+
} catch (_) {
|
|
3904
|
+
// We have to deal with error like `User has no mobile phone number` error in the UI.
|
|
3905
|
+
}
|
|
3906
|
+
if (!this.currentCall) {
|
|
3907
|
+
return null;
|
|
3908
|
+
}
|
|
3909
|
+
const callSession = CallSession.parseCall(this.currentCall);
|
|
3910
|
+
this.eventEmitter.emit('onCallOutgoing', callSession);
|
|
3911
|
+
|
|
3912
|
+
return callSession;
|
|
3913
|
+
}
|
|
3914
|
+
|
|
3915
|
+
accept(callSession ) {
|
|
3916
|
+
if (!callSession) {
|
|
3917
|
+
return Promise.resolve(null);
|
|
3918
|
+
}
|
|
3919
|
+
logger$a.info('accept CTI call', { callId: callSession.getId(), number: callSession.number });
|
|
3920
|
+
|
|
3921
|
+
if (!this.currentCall) {
|
|
3922
|
+
this.currentCall = callSession.call;
|
|
3923
|
+
}
|
|
3924
|
+
|
|
3925
|
+
return Promise.resolve(callSession.getId());
|
|
3926
|
+
}
|
|
3927
|
+
|
|
3928
|
+
endCurrentCall(callSession ) {
|
|
3929
|
+
if (!callSession) {
|
|
3930
|
+
return;
|
|
3931
|
+
}
|
|
3932
|
+
logger$a.info('end current CTI call', { callId: callSession.getId(), number: callSession.number });
|
|
3933
|
+
|
|
3934
|
+
this.currentCall = undefined;
|
|
3935
|
+
this.eventEmitter.emit('onCallEnded', callSession);
|
|
3936
|
+
}
|
|
3937
|
+
|
|
3938
|
+
async hangup(callSession ) {
|
|
3939
|
+
if (!callSession) {
|
|
3940
|
+
return Promise.resolve(false);
|
|
3941
|
+
}
|
|
3942
|
+
logger$a.info('hangup CTI call', { callId: callSession.getId(), number: callSession.number });
|
|
3943
|
+
|
|
3944
|
+
try {
|
|
3945
|
+
await CallApi.cancelCall(callSession);
|
|
3946
|
+
if (this.currentCall && callSession.callId === this.currentCall.id) {
|
|
3947
|
+
this.endCurrentCall(callSession);
|
|
3948
|
+
}
|
|
3949
|
+
|
|
3950
|
+
this.eventEmitter.emit('onCallEnded', callSession);
|
|
3951
|
+
return true;
|
|
3952
|
+
} catch (e) {
|
|
3953
|
+
logger$a.error('hangup CTI call, error', e);
|
|
3954
|
+
|
|
3955
|
+
this.eventEmitter.emit('onCallFailed', callSession);
|
|
3956
|
+
return false;
|
|
3957
|
+
}
|
|
3958
|
+
}
|
|
3959
|
+
|
|
3960
|
+
ignore() {}
|
|
3961
|
+
|
|
3962
|
+
async reject(callSession ) {
|
|
3963
|
+
if (!callSession) {
|
|
3964
|
+
return;
|
|
3965
|
+
}
|
|
3966
|
+
logger$a.info('reject CTI call', { callId: callSession.getId(), number: callSession.number });
|
|
3967
|
+
|
|
3968
|
+
await CallApi.cancelCall(callSession);
|
|
3969
|
+
this.eventEmitter.emit('onCallEnded', callSession);
|
|
3970
|
+
}
|
|
3971
|
+
|
|
3972
|
+
async transfer(callSession , number ) {
|
|
3973
|
+
if (!callSession) {
|
|
3974
|
+
return;
|
|
3975
|
+
}
|
|
3976
|
+
logger$a.info('transfer CTI call', { callId: callSession.getId(), number: callSession.number, to: number });
|
|
3977
|
+
|
|
3978
|
+
await CallApi.transferCall(callSession.callId, number, TRANSFER_FLOW_BLIND);
|
|
3979
|
+
}
|
|
3980
|
+
|
|
3981
|
+
indirectTransfer() {}
|
|
3982
|
+
|
|
3983
|
+
async initiateCTIIndirectTransfer(callSession , number ) {
|
|
3984
|
+
if (!callSession) {
|
|
3985
|
+
return;
|
|
3986
|
+
}
|
|
3987
|
+
logger$a.info('indirect CTI transfer', { callId: callSession.getId(), number: callSession.number, to: number });
|
|
3988
|
+
|
|
3989
|
+
return CallApi.transferCall(callSession.callId, number, TRANSFER_FLOW_ATTENDED);
|
|
3990
|
+
}
|
|
3991
|
+
|
|
3992
|
+
async cancelCTIIndirectTransfer(transferId ) {
|
|
3993
|
+
logger$a.info('cancel CTI transfer', { transferId });
|
|
3994
|
+
|
|
3995
|
+
return CallApi.cancelCallTransfer(transferId);
|
|
3996
|
+
}
|
|
3997
|
+
|
|
3998
|
+
async confirmCTIIndirectTransfer(transferId ) {
|
|
3999
|
+
logger$a.info('confirm CTI transfer', { transferId });
|
|
4000
|
+
|
|
4001
|
+
return CallApi.confirmCallTransfer(transferId);
|
|
4002
|
+
}
|
|
4003
|
+
|
|
4004
|
+
sendKey(callSession , digits ) {
|
|
4005
|
+
if (!callSession) {
|
|
4006
|
+
return;
|
|
4007
|
+
}
|
|
4008
|
+
logger$a.info('send CTI key', { callId: callSession.getId(), number: callSession.number, digits });
|
|
4009
|
+
|
|
4010
|
+
return CallApi.sendDTMF(callSession.callId, digits);
|
|
4011
|
+
}
|
|
4012
|
+
|
|
4013
|
+
onConnectionMade() {
|
|
4014
|
+
logger$a.info('on CTI connection made');
|
|
4015
|
+
|
|
4016
|
+
this.eventEmitter.emit('onCallAccepted');
|
|
4017
|
+
}
|
|
4018
|
+
|
|
4019
|
+
async close() {
|
|
4020
|
+
logger$a.info('CTI close');
|
|
4021
|
+
|
|
4022
|
+
return Promise.resolve();
|
|
4023
|
+
}
|
|
4024
|
+
|
|
4025
|
+
async hold(callSession ) {
|
|
4026
|
+
if (!callSession) {
|
|
4027
|
+
return;
|
|
4028
|
+
}
|
|
4029
|
+
logger$a.info('CTI hold', { callId: callSession.getId(), number: callSession.number });
|
|
4030
|
+
|
|
4031
|
+
return CallApi.hold(callSession.callId);
|
|
4032
|
+
}
|
|
4033
|
+
|
|
4034
|
+
async resume(callSession ) {
|
|
4035
|
+
if (!callSession) {
|
|
4036
|
+
return;
|
|
4037
|
+
}
|
|
4038
|
+
logger$a.info('CTI resume', { callId: callSession.getId(), number: callSession.number });
|
|
4039
|
+
|
|
4040
|
+
return CallApi.resume(callSession.callId);
|
|
4041
|
+
}
|
|
4042
|
+
|
|
4043
|
+
async mute(callSession ) {
|
|
4044
|
+
if (!callSession) {
|
|
4045
|
+
return;
|
|
4046
|
+
}
|
|
4047
|
+
logger$a.info('CTI mute', { callId: callSession.getId(), number: callSession.number });
|
|
4048
|
+
|
|
4049
|
+
return CallApi.mute(callSession.callId);
|
|
4050
|
+
}
|
|
4051
|
+
|
|
4052
|
+
async unmute(callSession ) {
|
|
4053
|
+
if (!callSession) {
|
|
4054
|
+
return;
|
|
4055
|
+
}
|
|
4056
|
+
logger$a.info('CTI unmute', { callId: callSession.getId(), number: callSession.number });
|
|
4057
|
+
|
|
4058
|
+
return CallApi.unmute(callSession.callId);
|
|
4059
|
+
}
|
|
4060
|
+
|
|
4061
|
+
putOnSpeaker() {}
|
|
4062
|
+
|
|
4063
|
+
putOffSpeaker() {}
|
|
4064
|
+
|
|
4065
|
+
turnCameraOff() {}
|
|
4066
|
+
|
|
4067
|
+
turnCameraOn() {}
|
|
4068
|
+
|
|
4069
|
+
changeAudioInputDevice() {}
|
|
4070
|
+
|
|
4071
|
+
changeVideoInputDevice() {}
|
|
4072
|
+
|
|
4073
|
+
changeAudioDevice() {}
|
|
4074
|
+
|
|
4075
|
+
changeRingDevice() {}
|
|
4076
|
+
|
|
4077
|
+
changeAudioVolume() {}
|
|
4078
|
+
|
|
4079
|
+
changeRingVolume() {}
|
|
4080
|
+
|
|
4081
|
+
hasVideo() {
|
|
4082
|
+
return false;
|
|
4083
|
+
}
|
|
4084
|
+
|
|
4085
|
+
getLocalStreamForCall() {
|
|
4086
|
+
return null;
|
|
4087
|
+
}
|
|
4088
|
+
|
|
4089
|
+
getRemoteStreamForCall() {
|
|
4090
|
+
return null;
|
|
4091
|
+
}
|
|
4092
|
+
|
|
4093
|
+
getLocalVideoStream() {
|
|
4094
|
+
return null;
|
|
4095
|
+
}
|
|
4096
|
+
|
|
4097
|
+
setActiveSipSession() {}
|
|
4098
|
+
|
|
4099
|
+
isRegistered() {
|
|
4100
|
+
return true;
|
|
4101
|
+
}
|
|
4102
|
+
|
|
4103
|
+
hasIncomingCallSession() {
|
|
4104
|
+
return true;
|
|
4105
|
+
}
|
|
4106
|
+
|
|
4107
|
+
hasActiveRemoteVideoStream() {
|
|
4108
|
+
return false;
|
|
4109
|
+
}
|
|
4110
|
+
|
|
4111
|
+
getCurrentCallSession() {
|
|
4112
|
+
return this.currentCall ? CallSession.parseCall(this.currentCall) : null;
|
|
4113
|
+
}
|
|
4114
|
+
|
|
4115
|
+
enableRinging() {}
|
|
4116
|
+
|
|
4117
|
+
sendMessage() {}
|
|
4118
|
+
|
|
4119
|
+
disableRinging() {}
|
|
4120
|
+
|
|
4121
|
+
getLocalStream() {
|
|
4122
|
+
return null;
|
|
4123
|
+
}
|
|
4124
|
+
|
|
4125
|
+
getRemoteStream() {
|
|
4126
|
+
return null;
|
|
4127
|
+
}
|
|
4128
|
+
|
|
4129
|
+
getRemoteVideoStream() {
|
|
4130
|
+
return null;
|
|
4131
|
+
}
|
|
4132
|
+
|
|
4133
|
+
getRemoteAudioStream() {
|
|
4134
|
+
return null;
|
|
4135
|
+
}
|
|
4136
|
+
|
|
4137
|
+
hasLocalVideo() {
|
|
4138
|
+
return false;
|
|
4139
|
+
}
|
|
4140
|
+
|
|
4141
|
+
useLocalVideoElement() {}
|
|
4142
|
+
}
|
|
3734
4143
|
|
|
3735
4144
|
/* */
|
|
3736
4145
|
|
|
@@ -6534,6 +6943,9 @@ class WebRTCClient extends Emitter {
|
|
|
6534
6943
|
if (!this._isWeb()) {
|
|
6535
6944
|
options.sessionDescriptionHandlerModifiers = [holdModifier];
|
|
6536
6945
|
}
|
|
6946
|
+
options.sessionDescriptionHandlerOptions = {
|
|
6947
|
+
constraints: options.constraints,
|
|
6948
|
+
};
|
|
6537
6949
|
|
|
6538
6950
|
// Send re-INVITE
|
|
6539
6951
|
return session.invite(options);
|
|
@@ -6573,6 +6985,9 @@ class WebRTCClient extends Emitter {
|
|
|
6573
6985
|
// (eg: holdModifier)
|
|
6574
6986
|
options.sessionDescriptionHandlerModifiers = [];
|
|
6575
6987
|
}
|
|
6988
|
+
options.sessionDescriptionHandlerOptions = {
|
|
6989
|
+
constraints: options.constraints,
|
|
6990
|
+
};
|
|
6576
6991
|
|
|
6577
6992
|
// Send re-INVITE
|
|
6578
6993
|
return session.invite(options);
|
|
@@ -12168,6 +12583,7 @@ const Wazo = {
|
|
|
12168
12583
|
ServerError,
|
|
12169
12584
|
Call,
|
|
12170
12585
|
CallLog,
|
|
12586
|
+
CTIPhone,
|
|
12171
12587
|
Recording,
|
|
12172
12588
|
ChatMessage,
|
|
12173
12589
|
ChatRoom,
|
|
@@ -12183,6 +12599,7 @@ const Wazo = {
|
|
|
12183
12599
|
CallSession,
|
|
12184
12600
|
IndirectTransfer,
|
|
12185
12601
|
SwitchboardCall,
|
|
12602
|
+
WebRTCPhone,
|
|
12186
12603
|
},
|
|
12187
12604
|
|
|
12188
12605
|
// Api
|
|
@@ -305,7 +305,13 @@ class IssueReporter {
|
|
|
305
305
|
}
|
|
306
306
|
|
|
307
307
|
_isLevelAbove(level1 , level2 ) {
|
|
308
|
-
|
|
308
|
+
const index1 = LOG_LEVELS.indexOf(level1);
|
|
309
|
+
const index2 = LOG_LEVELS.indexOf(level2);
|
|
310
|
+
if (index1 === -1 || index2 === -1) {
|
|
311
|
+
return false;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
return index1 > index2;
|
|
309
315
|
}
|
|
310
316
|
|
|
311
317
|
_makeCategory(category ) {
|
|
@@ -305,7 +305,13 @@ class IssueReporter {
|
|
|
305
305
|
}
|
|
306
306
|
|
|
307
307
|
_isLevelAbove(level1 , level2 ) {
|
|
308
|
-
|
|
308
|
+
const index1 = LOG_LEVELS.indexOf(level1);
|
|
309
|
+
const index2 = LOG_LEVELS.indexOf(level2);
|
|
310
|
+
if (index1 === -1 || index2 === -1) {
|
|
311
|
+
return false;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
return index1 > index2;
|
|
309
315
|
}
|
|
310
316
|
|
|
311
317
|
_makeCategory(category ) {
|
package/esm/web-rtc-client.js
CHANGED
|
@@ -591,7 +591,13 @@ class IssueReporter {
|
|
|
591
591
|
}
|
|
592
592
|
|
|
593
593
|
_isLevelAbove(level1 , level2 ) {
|
|
594
|
-
|
|
594
|
+
const index1 = LOG_LEVELS.indexOf(level1);
|
|
595
|
+
const index2 = LOG_LEVELS.indexOf(level2);
|
|
596
|
+
if (index1 === -1 || index2 === -1) {
|
|
597
|
+
return false;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
return index1 > index2;
|
|
595
601
|
}
|
|
596
602
|
|
|
597
603
|
_makeCategory(category ) {
|
|
@@ -5695,6 +5701,9 @@ class WebRTCClient extends Emitter {
|
|
|
5695
5701
|
if (!this._isWeb()) {
|
|
5696
5702
|
options.sessionDescriptionHandlerModifiers = [holdModifier];
|
|
5697
5703
|
}
|
|
5704
|
+
options.sessionDescriptionHandlerOptions = {
|
|
5705
|
+
constraints: options.constraints,
|
|
5706
|
+
};
|
|
5698
5707
|
|
|
5699
5708
|
// Send re-INVITE
|
|
5700
5709
|
return session.invite(options);
|
|
@@ -5734,6 +5743,9 @@ class WebRTCClient extends Emitter {
|
|
|
5734
5743
|
// (eg: holdModifier)
|
|
5735
5744
|
options.sessionDescriptionHandlerModifiers = [];
|
|
5736
5745
|
}
|
|
5746
|
+
options.sessionDescriptionHandlerOptions = {
|
|
5747
|
+
constraints: options.constraints,
|
|
5748
|
+
};
|
|
5737
5749
|
|
|
5738
5750
|
// Send re-INVITE
|
|
5739
5751
|
return session.invite(options);
|
package/esm/websocket-client.js
CHANGED
|
@@ -300,7 +300,13 @@ class IssueReporter {
|
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
_isLevelAbove(level1 , level2 ) {
|
|
303
|
-
|
|
303
|
+
const index1 = LOG_LEVELS.indexOf(level1);
|
|
304
|
+
const index2 = LOG_LEVELS.indexOf(level2);
|
|
305
|
+
if (index1 === -1 || index2 === -1) {
|
|
306
|
+
return false;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
return index1 > index2;
|
|
304
310
|
}
|
|
305
311
|
|
|
306
312
|
_makeCategory(category ) {
|
|
@@ -315,7 +315,13 @@ class IssueReporter {
|
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
_isLevelAbove(level1 , level2 ) {
|
|
318
|
-
|
|
318
|
+
const index1 = LOG_LEVELS.indexOf(level1);
|
|
319
|
+
const index2 = LOG_LEVELS.indexOf(level2);
|
|
320
|
+
if (index1 === -1 || index2 === -1) {
|
|
321
|
+
return false;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
return index1 > index2;
|
|
319
325
|
}
|
|
320
326
|
|
|
321
327
|
_makeCategory(category ) {
|
|
@@ -600,7 +600,13 @@ class IssueReporter {
|
|
|
600
600
|
}
|
|
601
601
|
|
|
602
602
|
_isLevelAbove(level1 , level2 ) {
|
|
603
|
-
|
|
603
|
+
const index1 = LOG_LEVELS.indexOf(level1);
|
|
604
|
+
const index2 = LOG_LEVELS.indexOf(level2);
|
|
605
|
+
if (index1 === -1 || index2 === -1) {
|
|
606
|
+
return false;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
return index1 > index2;
|
|
604
610
|
}
|
|
605
611
|
|
|
606
612
|
_makeCategory(category ) {
|
|
@@ -5701,6 +5707,9 @@ class WebRTCClient extends Emitter {
|
|
|
5701
5707
|
if (!this._isWeb()) {
|
|
5702
5708
|
options.sessionDescriptionHandlerModifiers = [modifiers.holdModifier];
|
|
5703
5709
|
}
|
|
5710
|
+
options.sessionDescriptionHandlerOptions = {
|
|
5711
|
+
constraints: options.constraints,
|
|
5712
|
+
};
|
|
5704
5713
|
|
|
5705
5714
|
// Send re-INVITE
|
|
5706
5715
|
return session.invite(options);
|
|
@@ -5740,6 +5749,9 @@ class WebRTCClient extends Emitter {
|
|
|
5740
5749
|
// (eg: holdModifier)
|
|
5741
5750
|
options.sessionDescriptionHandlerModifiers = [];
|
|
5742
5751
|
}
|
|
5752
|
+
options.sessionDescriptionHandlerOptions = {
|
|
5753
|
+
constraints: options.constraints,
|
|
5754
|
+
};
|
|
5743
5755
|
|
|
5744
5756
|
// Send re-INVITE
|
|
5745
5757
|
return session.invite(options);
|
package/lib/api/agentd.js
CHANGED
|
@@ -311,7 +311,13 @@ class IssueReporter {
|
|
|
311
311
|
}
|
|
312
312
|
|
|
313
313
|
_isLevelAbove(level1 , level2 ) {
|
|
314
|
-
|
|
314
|
+
const index1 = LOG_LEVELS.indexOf(level1);
|
|
315
|
+
const index2 = LOG_LEVELS.indexOf(level2);
|
|
316
|
+
if (index1 === -1 || index2 === -1) {
|
|
317
|
+
return false;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
return index1 > index2;
|
|
315
321
|
}
|
|
316
322
|
|
|
317
323
|
_makeCategory(category ) {
|
package/lib/api/amid.js
CHANGED
|
@@ -250,7 +250,13 @@ class IssueReporter {
|
|
|
250
250
|
}
|
|
251
251
|
|
|
252
252
|
_isLevelAbove(level1 , level2 ) {
|
|
253
|
-
|
|
253
|
+
const index1 = LOG_LEVELS.indexOf(level1);
|
|
254
|
+
const index2 = LOG_LEVELS.indexOf(level2);
|
|
255
|
+
if (index1 === -1 || index2 === -1) {
|
|
256
|
+
return false;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
return index1 > index2;
|
|
254
260
|
}
|
|
255
261
|
|
|
256
262
|
_makeCategory(category ) {
|
package/lib/api/application.js
CHANGED
|
@@ -311,7 +311,13 @@ class IssueReporter {
|
|
|
311
311
|
}
|
|
312
312
|
|
|
313
313
|
_isLevelAbove(level1 , level2 ) {
|
|
314
|
-
|
|
314
|
+
const index1 = LOG_LEVELS.indexOf(level1);
|
|
315
|
+
const index2 = LOG_LEVELS.indexOf(level2);
|
|
316
|
+
if (index1 === -1 || index2 === -1) {
|
|
317
|
+
return false;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
return index1 > index2;
|
|
315
321
|
}
|
|
316
322
|
|
|
317
323
|
_makeCategory(category ) {
|