@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
|
@@ -1819,7 +1819,13 @@ class IssueReporter {
|
|
|
1819
1819
|
}
|
|
1820
1820
|
|
|
1821
1821
|
_isLevelAbove(level1 , level2 ) {
|
|
1822
|
-
|
|
1822
|
+
const index1 = LOG_LEVELS.indexOf(level1);
|
|
1823
|
+
const index2 = LOG_LEVELS.indexOf(level2);
|
|
1824
|
+
if (index1 === -1 || index2 === -1) {
|
|
1825
|
+
return false;
|
|
1826
|
+
}
|
|
1827
|
+
|
|
1828
|
+
return index1 > index2;
|
|
1823
1829
|
}
|
|
1824
1830
|
|
|
1825
1831
|
_makeCategory(category ) {
|
|
@@ -1842,7 +1848,7 @@ var IssueReporter$1 = new IssueReporter();
|
|
|
1842
1848
|
|
|
1843
1849
|
const methods = ['head', 'get', 'post', 'put', 'delete'];
|
|
1844
1850
|
|
|
1845
|
-
const logger$
|
|
1851
|
+
const logger$b = IssueReporter$1 ? IssueReporter$1.loggerFor('api') : console;
|
|
1846
1852
|
|
|
1847
1853
|
// Use a function here to be able to mock it in tests
|
|
1848
1854
|
const realFetch = () => {
|
|
@@ -1981,7 +1987,7 @@ class ApiRequester {
|
|
|
1981
1987
|
};
|
|
1982
1988
|
|
|
1983
1989
|
if (this.refreshTokenPromise) {
|
|
1984
|
-
logger$
|
|
1990
|
+
logger$b.info('A token is already refreshing, waiting ...', { url });
|
|
1985
1991
|
await this.refreshTokenPromise;
|
|
1986
1992
|
}
|
|
1987
1993
|
|
|
@@ -2001,7 +2007,7 @@ class ApiRequester {
|
|
|
2001
2007
|
return promise.then(async (err ) => {
|
|
2002
2008
|
// Check if the token is still valid
|
|
2003
2009
|
if (firstCall && this._checkTokenExpired(response, err)) {
|
|
2004
|
-
logger$
|
|
2010
|
+
logger$b.warn('token expired', { error: err.reason });
|
|
2005
2011
|
// Replay the call after refreshing the token
|
|
2006
2012
|
return this._replayWithNewToken(err, path, method, body, headers, parse);
|
|
2007
2013
|
}
|
|
@@ -2011,7 +2017,7 @@ class ApiRequester {
|
|
|
2011
2017
|
: exceptionClass.fromResponse(err, response.status);
|
|
2012
2018
|
|
|
2013
2019
|
if (this.shouldLogErrors) {
|
|
2014
|
-
logger$
|
|
2020
|
+
logger$b.error('API error', error);
|
|
2015
2021
|
}
|
|
2016
2022
|
|
|
2017
2023
|
throw error;
|
|
@@ -2021,7 +2027,7 @@ class ApiRequester {
|
|
|
2021
2027
|
return newParse(response, isJson);
|
|
2022
2028
|
}).catch(error => {
|
|
2023
2029
|
if (this.shouldLogErrors) {
|
|
2024
|
-
logger$
|
|
2030
|
+
logger$b.error('Fetch failed', { url, options, message: error.message, stack: error.stack });
|
|
2025
2031
|
}
|
|
2026
2032
|
|
|
2027
2033
|
throw error;
|
|
@@ -2049,13 +2055,13 @@ class ApiRequester {
|
|
|
2049
2055
|
) {
|
|
2050
2056
|
const isTokenNotFound = this._isTokenNotFound(err);
|
|
2051
2057
|
let newPath = path;
|
|
2052
|
-
logger$
|
|
2058
|
+
logger$b.info('refreshing token', { inProgress: !!this.refreshTokenPromise });
|
|
2053
2059
|
|
|
2054
2060
|
this.refreshTokenPromise = this.refreshTokenPromise || this.refreshTokenCallback();
|
|
2055
2061
|
|
|
2056
2062
|
return this.refreshTokenPromise.then(() => {
|
|
2057
2063
|
this.refreshTokenPromise = null;
|
|
2058
|
-
logger$
|
|
2064
|
+
logger$b.info('token refreshed', { isTokenNotFound });
|
|
2059
2065
|
if (isTokenNotFound) {
|
|
2060
2066
|
const pathParts = path.split('/');
|
|
2061
2067
|
pathParts.pop();
|
|
@@ -3736,11 +3742,414 @@ class IndirectTransfer {
|
|
|
3736
3742
|
}
|
|
3737
3743
|
|
|
3738
3744
|
//
|
|
3745
|
+
|
|
3746
|
+
class CallApi {
|
|
3747
|
+
static async fetchCallLogs(offset , limit ) {
|
|
3748
|
+
return getApiClient().callLogd.listCallLogs(offset, limit);
|
|
3749
|
+
}
|
|
3750
|
+
|
|
3751
|
+
static async fetchDistinctCallLogs(offset , limit , distinct = 'peer_exten') {
|
|
3752
|
+
return getApiClient().callLogd.listDistinctCallLogs(offset, limit, distinct);
|
|
3753
|
+
}
|
|
3754
|
+
|
|
3755
|
+
static async fetchActiveCalls() {
|
|
3756
|
+
return getApiClient().calld.listCalls();
|
|
3757
|
+
}
|
|
3758
|
+
|
|
3759
|
+
static async fetchCallLogsFromDate(from , number ) {
|
|
3760
|
+
return getApiClient().callLogd.listCallLogsFromDate(from, number);
|
|
3761
|
+
}
|
|
3762
|
+
|
|
3763
|
+
static async search(query , limit ) {
|
|
3764
|
+
return getApiClient().callLogd.search(query, limit);
|
|
3765
|
+
}
|
|
3766
|
+
|
|
3767
|
+
static async searchBy(field , value , limit ) {
|
|
3768
|
+
return getApiClient().callLogd.searchBy(field, value, limit);
|
|
3769
|
+
}
|
|
3770
|
+
|
|
3771
|
+
static async fetchSIP(session , line ) {
|
|
3772
|
+
const lineToUse = line || session.primaryLine();
|
|
3773
|
+
return getApiClient().confd.getUserLineSip(session.uuid, lineToUse ? lineToUse.id : null);
|
|
3774
|
+
}
|
|
3775
|
+
|
|
3776
|
+
static async cancelCall(callSession ) {
|
|
3777
|
+
return getApiClient().calld.cancelCall(callSession.callId);
|
|
3778
|
+
}
|
|
3779
|
+
|
|
3780
|
+
static async makeCall(callFromLine , extension , isMobile = false,
|
|
3781
|
+
callbackAllLines = false) {
|
|
3782
|
+
const lineId = callFromLine ? callFromLine.id : null;
|
|
3783
|
+
|
|
3784
|
+
const response = await getApiClient().calld.makeCall(extension, isMobile, lineId, callbackAllLines);
|
|
3785
|
+
return Call.parse(response);
|
|
3786
|
+
}
|
|
3787
|
+
|
|
3788
|
+
static async relocateCall(callId , line , contactIdentifier ) {
|
|
3789
|
+
return getApiClient().calld.relocateCall(callId, 'line', line, contactIdentifier);
|
|
3790
|
+
}
|
|
3791
|
+
|
|
3792
|
+
static async hold(callId ) {
|
|
3793
|
+
return getApiClient().calld.hold(callId);
|
|
3794
|
+
}
|
|
3795
|
+
|
|
3796
|
+
static async resume(callId ) {
|
|
3797
|
+
return getApiClient().calld.resume(callId);
|
|
3798
|
+
}
|
|
3799
|
+
|
|
3800
|
+
static async mute(callId ) {
|
|
3801
|
+
return getApiClient().calld.mute(callId);
|
|
3802
|
+
}
|
|
3803
|
+
|
|
3804
|
+
static async sendDTMF(callId , digits ) {
|
|
3805
|
+
return getApiClient().calld.sendDTMF(callId, digits);
|
|
3806
|
+
}
|
|
3807
|
+
|
|
3808
|
+
static async unmute(callId ) {
|
|
3809
|
+
return getApiClient().calld.unmute(callId);
|
|
3810
|
+
}
|
|
3811
|
+
|
|
3812
|
+
static async transferCall(callId , number , flow ) {
|
|
3813
|
+
return getApiClient().calld.transferCall(callId, number, flow);
|
|
3814
|
+
}
|
|
3815
|
+
|
|
3816
|
+
static async cancelCallTransfer(transferId ) {
|
|
3817
|
+
return getApiClient().calld.cancelCallTransfer(transferId);
|
|
3818
|
+
}
|
|
3819
|
+
|
|
3820
|
+
static async confirmCallTransfer(transferId ) {
|
|
3821
|
+
return getApiClient().calld.confirmCallTransfer(transferId);
|
|
3822
|
+
}
|
|
3823
|
+
}
|
|
3824
|
+
|
|
3825
|
+
//
|
|
3826
|
+
|
|
3827
|
+
const TRANSFER_FLOW_ATTENDED = 'attended';
|
|
3739
3828
|
const TRANSFER_FLOW_BLIND = 'blind';
|
|
3740
3829
|
|
|
3741
3830
|
// const MINIMUM_WAZO_ENGINE_VERSION_FOR_CTI_HOLD = '20.11';
|
|
3742
3831
|
|
|
3743
|
-
IssueReporter$1 ? IssueReporter$1.loggerFor('cti-phone') : console;
|
|
3832
|
+
const logger$a = IssueReporter$1 ? IssueReporter$1.loggerFor('cti-phone') : console;
|
|
3833
|
+
|
|
3834
|
+
class CTIPhone extends Emitter {
|
|
3835
|
+
|
|
3836
|
+
|
|
3837
|
+
|
|
3838
|
+
|
|
3839
|
+
|
|
3840
|
+
|
|
3841
|
+
|
|
3842
|
+
|
|
3843
|
+
constructor(session , isMobile = false, callbackAllLines = false) {
|
|
3844
|
+
super();
|
|
3845
|
+
logger$a.info('CTI Phone created');
|
|
3846
|
+
this.session = session;
|
|
3847
|
+
this.isMobile = isMobile;
|
|
3848
|
+
this.callbackAllLines = callbackAllLines;
|
|
3849
|
+
}
|
|
3850
|
+
|
|
3851
|
+
getOptions() {
|
|
3852
|
+
// @FIXME: temporarily disabling this option
|
|
3853
|
+
// const hold = this.session.hasEngineVersionGte(MINIMUM_WAZO_ENGINE_VERSION_FOR_CTI_HOLD);
|
|
3854
|
+
|
|
3855
|
+
return {
|
|
3856
|
+
accept: false,
|
|
3857
|
+
decline: true,
|
|
3858
|
+
mute: true,
|
|
3859
|
+
hold: false,
|
|
3860
|
+
transfer: true,
|
|
3861
|
+
sendKey: true,
|
|
3862
|
+
addParticipant: false,
|
|
3863
|
+
record: true,
|
|
3864
|
+
merge: false,
|
|
3865
|
+
};
|
|
3866
|
+
}
|
|
3867
|
+
|
|
3868
|
+
hasAnActiveCall() {
|
|
3869
|
+
return !!this.currentCall;
|
|
3870
|
+
}
|
|
3871
|
+
|
|
3872
|
+
callCount() {
|
|
3873
|
+
return this.currentCall ? 1 : 0;
|
|
3874
|
+
}
|
|
3875
|
+
|
|
3876
|
+
isWebRTC() {
|
|
3877
|
+
return false;
|
|
3878
|
+
}
|
|
3879
|
+
|
|
3880
|
+
getUserAgent() {
|
|
3881
|
+
return 'cti-phone';
|
|
3882
|
+
}
|
|
3883
|
+
|
|
3884
|
+
startHeartbeat() {
|
|
3885
|
+
}
|
|
3886
|
+
|
|
3887
|
+
setOnHeartbeatTimeout() {
|
|
3888
|
+
}
|
|
3889
|
+
|
|
3890
|
+
setOnHeartbeatCallback() {
|
|
3891
|
+
}
|
|
3892
|
+
|
|
3893
|
+
stopHeartbeat() {
|
|
3894
|
+
}
|
|
3895
|
+
|
|
3896
|
+
bindClientEvents() {
|
|
3897
|
+
}
|
|
3898
|
+
|
|
3899
|
+
onConnect() {
|
|
3900
|
+
}
|
|
3901
|
+
|
|
3902
|
+
onDisconnect() {
|
|
3903
|
+
}
|
|
3904
|
+
|
|
3905
|
+
async makeCall(number , line ) {
|
|
3906
|
+
logger$a.info('make CTI call', { number });
|
|
3907
|
+
|
|
3908
|
+
if (!number) {
|
|
3909
|
+
return null;
|
|
3910
|
+
}
|
|
3911
|
+
try {
|
|
3912
|
+
this.currentCall = await CallApi.makeCall(line, number, this.isMobile, this.callbackAllLines);
|
|
3913
|
+
} catch (_) {
|
|
3914
|
+
// We have to deal with error like `User has no mobile phone number` error in the UI.
|
|
3915
|
+
}
|
|
3916
|
+
if (!this.currentCall) {
|
|
3917
|
+
return null;
|
|
3918
|
+
}
|
|
3919
|
+
const callSession = CallSession.parseCall(this.currentCall);
|
|
3920
|
+
this.eventEmitter.emit('onCallOutgoing', callSession);
|
|
3921
|
+
|
|
3922
|
+
return callSession;
|
|
3923
|
+
}
|
|
3924
|
+
|
|
3925
|
+
accept(callSession ) {
|
|
3926
|
+
if (!callSession) {
|
|
3927
|
+
return Promise.resolve(null);
|
|
3928
|
+
}
|
|
3929
|
+
logger$a.info('accept CTI call', { callId: callSession.getId(), number: callSession.number });
|
|
3930
|
+
|
|
3931
|
+
if (!this.currentCall) {
|
|
3932
|
+
this.currentCall = callSession.call;
|
|
3933
|
+
}
|
|
3934
|
+
|
|
3935
|
+
return Promise.resolve(callSession.getId());
|
|
3936
|
+
}
|
|
3937
|
+
|
|
3938
|
+
endCurrentCall(callSession ) {
|
|
3939
|
+
if (!callSession) {
|
|
3940
|
+
return;
|
|
3941
|
+
}
|
|
3942
|
+
logger$a.info('end current CTI call', { callId: callSession.getId(), number: callSession.number });
|
|
3943
|
+
|
|
3944
|
+
this.currentCall = undefined;
|
|
3945
|
+
this.eventEmitter.emit('onCallEnded', callSession);
|
|
3946
|
+
}
|
|
3947
|
+
|
|
3948
|
+
async hangup(callSession ) {
|
|
3949
|
+
if (!callSession) {
|
|
3950
|
+
return Promise.resolve(false);
|
|
3951
|
+
}
|
|
3952
|
+
logger$a.info('hangup CTI call', { callId: callSession.getId(), number: callSession.number });
|
|
3953
|
+
|
|
3954
|
+
try {
|
|
3955
|
+
await CallApi.cancelCall(callSession);
|
|
3956
|
+
if (this.currentCall && callSession.callId === this.currentCall.id) {
|
|
3957
|
+
this.endCurrentCall(callSession);
|
|
3958
|
+
}
|
|
3959
|
+
|
|
3960
|
+
this.eventEmitter.emit('onCallEnded', callSession);
|
|
3961
|
+
return true;
|
|
3962
|
+
} catch (e) {
|
|
3963
|
+
logger$a.error('hangup CTI call, error', e);
|
|
3964
|
+
|
|
3965
|
+
this.eventEmitter.emit('onCallFailed', callSession);
|
|
3966
|
+
return false;
|
|
3967
|
+
}
|
|
3968
|
+
}
|
|
3969
|
+
|
|
3970
|
+
ignore() {}
|
|
3971
|
+
|
|
3972
|
+
async reject(callSession ) {
|
|
3973
|
+
if (!callSession) {
|
|
3974
|
+
return;
|
|
3975
|
+
}
|
|
3976
|
+
logger$a.info('reject CTI call', { callId: callSession.getId(), number: callSession.number });
|
|
3977
|
+
|
|
3978
|
+
await CallApi.cancelCall(callSession);
|
|
3979
|
+
this.eventEmitter.emit('onCallEnded', callSession);
|
|
3980
|
+
}
|
|
3981
|
+
|
|
3982
|
+
async transfer(callSession , number ) {
|
|
3983
|
+
if (!callSession) {
|
|
3984
|
+
return;
|
|
3985
|
+
}
|
|
3986
|
+
logger$a.info('transfer CTI call', { callId: callSession.getId(), number: callSession.number, to: number });
|
|
3987
|
+
|
|
3988
|
+
await CallApi.transferCall(callSession.callId, number, TRANSFER_FLOW_BLIND);
|
|
3989
|
+
}
|
|
3990
|
+
|
|
3991
|
+
indirectTransfer() {}
|
|
3992
|
+
|
|
3993
|
+
async initiateCTIIndirectTransfer(callSession , number ) {
|
|
3994
|
+
if (!callSession) {
|
|
3995
|
+
return;
|
|
3996
|
+
}
|
|
3997
|
+
logger$a.info('indirect CTI transfer', { callId: callSession.getId(), number: callSession.number, to: number });
|
|
3998
|
+
|
|
3999
|
+
return CallApi.transferCall(callSession.callId, number, TRANSFER_FLOW_ATTENDED);
|
|
4000
|
+
}
|
|
4001
|
+
|
|
4002
|
+
async cancelCTIIndirectTransfer(transferId ) {
|
|
4003
|
+
logger$a.info('cancel CTI transfer', { transferId });
|
|
4004
|
+
|
|
4005
|
+
return CallApi.cancelCallTransfer(transferId);
|
|
4006
|
+
}
|
|
4007
|
+
|
|
4008
|
+
async confirmCTIIndirectTransfer(transferId ) {
|
|
4009
|
+
logger$a.info('confirm CTI transfer', { transferId });
|
|
4010
|
+
|
|
4011
|
+
return CallApi.confirmCallTransfer(transferId);
|
|
4012
|
+
}
|
|
4013
|
+
|
|
4014
|
+
sendKey(callSession , digits ) {
|
|
4015
|
+
if (!callSession) {
|
|
4016
|
+
return;
|
|
4017
|
+
}
|
|
4018
|
+
logger$a.info('send CTI key', { callId: callSession.getId(), number: callSession.number, digits });
|
|
4019
|
+
|
|
4020
|
+
return CallApi.sendDTMF(callSession.callId, digits);
|
|
4021
|
+
}
|
|
4022
|
+
|
|
4023
|
+
onConnectionMade() {
|
|
4024
|
+
logger$a.info('on CTI connection made');
|
|
4025
|
+
|
|
4026
|
+
this.eventEmitter.emit('onCallAccepted');
|
|
4027
|
+
}
|
|
4028
|
+
|
|
4029
|
+
async close() {
|
|
4030
|
+
logger$a.info('CTI close');
|
|
4031
|
+
|
|
4032
|
+
return Promise.resolve();
|
|
4033
|
+
}
|
|
4034
|
+
|
|
4035
|
+
async hold(callSession ) {
|
|
4036
|
+
if (!callSession) {
|
|
4037
|
+
return;
|
|
4038
|
+
}
|
|
4039
|
+
logger$a.info('CTI hold', { callId: callSession.getId(), number: callSession.number });
|
|
4040
|
+
|
|
4041
|
+
return CallApi.hold(callSession.callId);
|
|
4042
|
+
}
|
|
4043
|
+
|
|
4044
|
+
async resume(callSession ) {
|
|
4045
|
+
if (!callSession) {
|
|
4046
|
+
return;
|
|
4047
|
+
}
|
|
4048
|
+
logger$a.info('CTI resume', { callId: callSession.getId(), number: callSession.number });
|
|
4049
|
+
|
|
4050
|
+
return CallApi.resume(callSession.callId);
|
|
4051
|
+
}
|
|
4052
|
+
|
|
4053
|
+
async mute(callSession ) {
|
|
4054
|
+
if (!callSession) {
|
|
4055
|
+
return;
|
|
4056
|
+
}
|
|
4057
|
+
logger$a.info('CTI mute', { callId: callSession.getId(), number: callSession.number });
|
|
4058
|
+
|
|
4059
|
+
return CallApi.mute(callSession.callId);
|
|
4060
|
+
}
|
|
4061
|
+
|
|
4062
|
+
async unmute(callSession ) {
|
|
4063
|
+
if (!callSession) {
|
|
4064
|
+
return;
|
|
4065
|
+
}
|
|
4066
|
+
logger$a.info('CTI unmute', { callId: callSession.getId(), number: callSession.number });
|
|
4067
|
+
|
|
4068
|
+
return CallApi.unmute(callSession.callId);
|
|
4069
|
+
}
|
|
4070
|
+
|
|
4071
|
+
putOnSpeaker() {}
|
|
4072
|
+
|
|
4073
|
+
putOffSpeaker() {}
|
|
4074
|
+
|
|
4075
|
+
turnCameraOff() {}
|
|
4076
|
+
|
|
4077
|
+
turnCameraOn() {}
|
|
4078
|
+
|
|
4079
|
+
changeAudioInputDevice() {}
|
|
4080
|
+
|
|
4081
|
+
changeVideoInputDevice() {}
|
|
4082
|
+
|
|
4083
|
+
changeAudioDevice() {}
|
|
4084
|
+
|
|
4085
|
+
changeRingDevice() {}
|
|
4086
|
+
|
|
4087
|
+
changeAudioVolume() {}
|
|
4088
|
+
|
|
4089
|
+
changeRingVolume() {}
|
|
4090
|
+
|
|
4091
|
+
hasVideo() {
|
|
4092
|
+
return false;
|
|
4093
|
+
}
|
|
4094
|
+
|
|
4095
|
+
getLocalStreamForCall() {
|
|
4096
|
+
return null;
|
|
4097
|
+
}
|
|
4098
|
+
|
|
4099
|
+
getRemoteStreamForCall() {
|
|
4100
|
+
return null;
|
|
4101
|
+
}
|
|
4102
|
+
|
|
4103
|
+
getLocalVideoStream() {
|
|
4104
|
+
return null;
|
|
4105
|
+
}
|
|
4106
|
+
|
|
4107
|
+
setActiveSipSession() {}
|
|
4108
|
+
|
|
4109
|
+
isRegistered() {
|
|
4110
|
+
return true;
|
|
4111
|
+
}
|
|
4112
|
+
|
|
4113
|
+
hasIncomingCallSession() {
|
|
4114
|
+
return true;
|
|
4115
|
+
}
|
|
4116
|
+
|
|
4117
|
+
hasActiveRemoteVideoStream() {
|
|
4118
|
+
return false;
|
|
4119
|
+
}
|
|
4120
|
+
|
|
4121
|
+
getCurrentCallSession() {
|
|
4122
|
+
return this.currentCall ? CallSession.parseCall(this.currentCall) : null;
|
|
4123
|
+
}
|
|
4124
|
+
|
|
4125
|
+
enableRinging() {}
|
|
4126
|
+
|
|
4127
|
+
sendMessage() {}
|
|
4128
|
+
|
|
4129
|
+
disableRinging() {}
|
|
4130
|
+
|
|
4131
|
+
getLocalStream() {
|
|
4132
|
+
return null;
|
|
4133
|
+
}
|
|
4134
|
+
|
|
4135
|
+
getRemoteStream() {
|
|
4136
|
+
return null;
|
|
4137
|
+
}
|
|
4138
|
+
|
|
4139
|
+
getRemoteVideoStream() {
|
|
4140
|
+
return null;
|
|
4141
|
+
}
|
|
4142
|
+
|
|
4143
|
+
getRemoteAudioStream() {
|
|
4144
|
+
return null;
|
|
4145
|
+
}
|
|
4146
|
+
|
|
4147
|
+
hasLocalVideo() {
|
|
4148
|
+
return false;
|
|
4149
|
+
}
|
|
4150
|
+
|
|
4151
|
+
useLocalVideoElement() {}
|
|
4152
|
+
}
|
|
3744
4153
|
|
|
3745
4154
|
/* */
|
|
3746
4155
|
|
|
@@ -6282,6 +6691,9 @@ class WebRTCClient extends Emitter {
|
|
|
6282
6691
|
if (!this._isWeb()) {
|
|
6283
6692
|
options.sessionDescriptionHandlerModifiers = [modifiers.holdModifier];
|
|
6284
6693
|
}
|
|
6694
|
+
options.sessionDescriptionHandlerOptions = {
|
|
6695
|
+
constraints: options.constraints,
|
|
6696
|
+
};
|
|
6285
6697
|
|
|
6286
6698
|
// Send re-INVITE
|
|
6287
6699
|
return session.invite(options);
|
|
@@ -6321,6 +6733,9 @@ class WebRTCClient extends Emitter {
|
|
|
6321
6733
|
// (eg: holdModifier)
|
|
6322
6734
|
options.sessionDescriptionHandlerModifiers = [];
|
|
6323
6735
|
}
|
|
6736
|
+
options.sessionDescriptionHandlerOptions = {
|
|
6737
|
+
constraints: options.constraints,
|
|
6738
|
+
};
|
|
6324
6739
|
|
|
6325
6740
|
// Send re-INVITE
|
|
6326
6741
|
return session.invite(options);
|
|
@@ -11915,6 +12330,7 @@ const Wazo = {
|
|
|
11915
12330
|
ServerError,
|
|
11916
12331
|
Call,
|
|
11917
12332
|
CallLog,
|
|
12333
|
+
CTIPhone,
|
|
11918
12334
|
Recording,
|
|
11919
12335
|
ChatMessage,
|
|
11920
12336
|
ChatRoom,
|
|
@@ -11930,6 +12346,7 @@ const Wazo = {
|
|
|
11930
12346
|
CallSession,
|
|
11931
12347
|
IndirectTransfer,
|
|
11932
12348
|
SwitchboardCall,
|
|
12349
|
+
WebRTCPhone,
|
|
11933
12350
|
},
|
|
11934
12351
|
|
|
11935
12352
|
// Api
|
package/lib/simple/Directory.js
CHANGED
|
@@ -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 ) {
|