@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
|
@@ -128,7 +128,7 @@ const isMobile = () => typeof navigator !== 'undefined' && navigator.product ===
|
|
|
128
128
|
|
|
129
129
|
const methods = ['head', 'get', 'post', 'put', 'delete'];
|
|
130
130
|
|
|
131
|
-
const logger$
|
|
131
|
+
const logger$b = IssueReporter$1 ? IssueReporter$1.loggerFor('api') : console;
|
|
132
132
|
|
|
133
133
|
// Use a function here to be able to mock it in tests
|
|
134
134
|
const realFetch = () => {
|
|
@@ -267,7 +267,7 @@ class ApiRequester {
|
|
|
267
267
|
};
|
|
268
268
|
|
|
269
269
|
if (this.refreshTokenPromise) {
|
|
270
|
-
logger$
|
|
270
|
+
logger$b.info('A token is already refreshing, waiting ...', { url });
|
|
271
271
|
await this.refreshTokenPromise;
|
|
272
272
|
}
|
|
273
273
|
|
|
@@ -287,7 +287,7 @@ class ApiRequester {
|
|
|
287
287
|
return promise.then(async (err ) => {
|
|
288
288
|
// Check if the token is still valid
|
|
289
289
|
if (firstCall && this._checkTokenExpired(response, err)) {
|
|
290
|
-
logger$
|
|
290
|
+
logger$b.warn('token expired', { error: err.reason });
|
|
291
291
|
// Replay the call after refreshing the token
|
|
292
292
|
return this._replayWithNewToken(err, path, method, body, headers, parse);
|
|
293
293
|
}
|
|
@@ -297,7 +297,7 @@ class ApiRequester {
|
|
|
297
297
|
: exceptionClass.fromResponse(err, response.status);
|
|
298
298
|
|
|
299
299
|
if (this.shouldLogErrors) {
|
|
300
|
-
logger$
|
|
300
|
+
logger$b.error('API error', error);
|
|
301
301
|
}
|
|
302
302
|
|
|
303
303
|
throw error;
|
|
@@ -307,7 +307,7 @@ class ApiRequester {
|
|
|
307
307
|
return newParse(response, isJson);
|
|
308
308
|
}).catch(error => {
|
|
309
309
|
if (this.shouldLogErrors) {
|
|
310
|
-
logger$
|
|
310
|
+
logger$b.error('Fetch failed', { url, options, message: error.message, stack: error.stack });
|
|
311
311
|
}
|
|
312
312
|
|
|
313
313
|
throw error;
|
|
@@ -335,13 +335,13 @@ class ApiRequester {
|
|
|
335
335
|
) {
|
|
336
336
|
const isTokenNotFound = this._isTokenNotFound(err);
|
|
337
337
|
let newPath = path;
|
|
338
|
-
logger$
|
|
338
|
+
logger$b.info('refreshing token', { inProgress: !!this.refreshTokenPromise });
|
|
339
339
|
|
|
340
340
|
this.refreshTokenPromise = this.refreshTokenPromise || this.refreshTokenCallback();
|
|
341
341
|
|
|
342
342
|
return this.refreshTokenPromise.then(() => {
|
|
343
343
|
this.refreshTokenPromise = null;
|
|
344
|
-
logger$
|
|
344
|
+
logger$b.info('token refreshed', { isTokenNotFound });
|
|
345
345
|
if (isTokenNotFound) {
|
|
346
346
|
const pathParts = path.split('/');
|
|
347
347
|
pathParts.pop();
|
|
@@ -619,7 +619,13 @@ class IssueReporter {
|
|
|
619
619
|
}
|
|
620
620
|
|
|
621
621
|
_isLevelAbove(level1 , level2 ) {
|
|
622
|
-
|
|
622
|
+
const index1 = LOG_LEVELS.indexOf(level1);
|
|
623
|
+
const index2 = LOG_LEVELS.indexOf(level2);
|
|
624
|
+
if (index1 === -1 || index2 === -1) {
|
|
625
|
+
return false;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
return index1 > index2;
|
|
623
629
|
}
|
|
624
630
|
|
|
625
631
|
_makeCategory(category ) {
|
|
@@ -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);
|
|
@@ -11150,6 +11565,7 @@ const Wazo = {
|
|
|
11150
11565
|
ServerError,
|
|
11151
11566
|
Call,
|
|
11152
11567
|
CallLog,
|
|
11568
|
+
CTIPhone,
|
|
11153
11569
|
Recording,
|
|
11154
11570
|
ChatMessage,
|
|
11155
11571
|
ChatRoom,
|
|
@@ -11165,6 +11581,7 @@ const Wazo = {
|
|
|
11165
11581
|
CallSession,
|
|
11166
11582
|
IndirectTransfer,
|
|
11167
11583
|
SwitchboardCall,
|
|
11584
|
+
WebRTCPhone,
|
|
11168
11585
|
},
|
|
11169
11586
|
|
|
11170
11587
|
// Api
|