@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
|
@@ -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);
|
|
@@ -12124,6 +12539,7 @@ const Wazo = {
|
|
|
12124
12539
|
ServerError,
|
|
12125
12540
|
Call,
|
|
12126
12541
|
CallLog,
|
|
12542
|
+
CTIPhone,
|
|
12127
12543
|
Recording,
|
|
12128
12544
|
ChatMessage,
|
|
12129
12545
|
ChatRoom,
|
|
@@ -12139,6 +12555,7 @@ const Wazo = {
|
|
|
12139
12555
|
CallSession,
|
|
12140
12556
|
IndirectTransfer,
|
|
12141
12557
|
SwitchboardCall,
|
|
12558
|
+
WebRTCPhone,
|
|
12142
12559
|
},
|
|
12143
12560
|
|
|
12144
12561
|
// Api
|