@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
|
@@ -138,7 +138,7 @@ const isMobile = () => typeof navigator !== 'undefined' && navigator.product ===
|
|
|
138
138
|
|
|
139
139
|
const methods = ['head', 'get', 'post', 'put', 'delete'];
|
|
140
140
|
|
|
141
|
-
const logger$
|
|
141
|
+
const logger$b = IssueReporter$1 ? IssueReporter$1.loggerFor('api') : console;
|
|
142
142
|
|
|
143
143
|
// Use a function here to be able to mock it in tests
|
|
144
144
|
const realFetch = () => {
|
|
@@ -277,7 +277,7 @@ class ApiRequester {
|
|
|
277
277
|
};
|
|
278
278
|
|
|
279
279
|
if (this.refreshTokenPromise) {
|
|
280
|
-
logger$
|
|
280
|
+
logger$b.info('A token is already refreshing, waiting ...', { url });
|
|
281
281
|
await this.refreshTokenPromise;
|
|
282
282
|
}
|
|
283
283
|
|
|
@@ -297,7 +297,7 @@ class ApiRequester {
|
|
|
297
297
|
return promise.then(async (err ) => {
|
|
298
298
|
// Check if the token is still valid
|
|
299
299
|
if (firstCall && this._checkTokenExpired(response, err)) {
|
|
300
|
-
logger$
|
|
300
|
+
logger$b.warn('token expired', { error: err.reason });
|
|
301
301
|
// Replay the call after refreshing the token
|
|
302
302
|
return this._replayWithNewToken(err, path, method, body, headers, parse);
|
|
303
303
|
}
|
|
@@ -307,7 +307,7 @@ class ApiRequester {
|
|
|
307
307
|
: exceptionClass.fromResponse(err, response.status);
|
|
308
308
|
|
|
309
309
|
if (this.shouldLogErrors) {
|
|
310
|
-
logger$
|
|
310
|
+
logger$b.error('API error', error);
|
|
311
311
|
}
|
|
312
312
|
|
|
313
313
|
throw error;
|
|
@@ -317,7 +317,7 @@ class ApiRequester {
|
|
|
317
317
|
return newParse(response, isJson);
|
|
318
318
|
}).catch(error => {
|
|
319
319
|
if (this.shouldLogErrors) {
|
|
320
|
-
logger$
|
|
320
|
+
logger$b.error('Fetch failed', { url, options, message: error.message, stack: error.stack });
|
|
321
321
|
}
|
|
322
322
|
|
|
323
323
|
throw error;
|
|
@@ -345,13 +345,13 @@ class ApiRequester {
|
|
|
345
345
|
) {
|
|
346
346
|
const isTokenNotFound = this._isTokenNotFound(err);
|
|
347
347
|
let newPath = path;
|
|
348
|
-
logger$
|
|
348
|
+
logger$b.info('refreshing token', { inProgress: !!this.refreshTokenPromise });
|
|
349
349
|
|
|
350
350
|
this.refreshTokenPromise = this.refreshTokenPromise || this.refreshTokenCallback();
|
|
351
351
|
|
|
352
352
|
return this.refreshTokenPromise.then(() => {
|
|
353
353
|
this.refreshTokenPromise = null;
|
|
354
|
-
logger$
|
|
354
|
+
logger$b.info('token refreshed', { isTokenNotFound });
|
|
355
355
|
if (isTokenNotFound) {
|
|
356
356
|
const pathParts = path.split('/');
|
|
357
357
|
pathParts.pop();
|
|
@@ -629,7 +629,13 @@ class IssueReporter {
|
|
|
629
629
|
}
|
|
630
630
|
|
|
631
631
|
_isLevelAbove(level1 , level2 ) {
|
|
632
|
-
|
|
632
|
+
const index1 = LOG_LEVELS.indexOf(level1);
|
|
633
|
+
const index2 = LOG_LEVELS.indexOf(level2);
|
|
634
|
+
if (index1 === -1 || index2 === -1) {
|
|
635
|
+
return false;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
return index1 > index2;
|
|
633
639
|
}
|
|
634
640
|
|
|
635
641
|
_makeCategory(category ) {
|
|
@@ -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
|
|
|
@@ -6544,6 +6953,9 @@ class WebRTCClient extends Emitter {
|
|
|
6544
6953
|
if (!this._isWeb()) {
|
|
6545
6954
|
options.sessionDescriptionHandlerModifiers = [modifiers.holdModifier];
|
|
6546
6955
|
}
|
|
6956
|
+
options.sessionDescriptionHandlerOptions = {
|
|
6957
|
+
constraints: options.constraints,
|
|
6958
|
+
};
|
|
6547
6959
|
|
|
6548
6960
|
// Send re-INVITE
|
|
6549
6961
|
return session.invite(options);
|
|
@@ -6583,6 +6995,9 @@ class WebRTCClient extends Emitter {
|
|
|
6583
6995
|
// (eg: holdModifier)
|
|
6584
6996
|
options.sessionDescriptionHandlerModifiers = [];
|
|
6585
6997
|
}
|
|
6998
|
+
options.sessionDescriptionHandlerOptions = {
|
|
6999
|
+
constraints: options.constraints,
|
|
7000
|
+
};
|
|
6586
7001
|
|
|
6587
7002
|
// Send re-INVITE
|
|
6588
7003
|
return session.invite(options);
|
|
@@ -11160,6 +11575,7 @@ const Wazo = {
|
|
|
11160
11575
|
ServerError,
|
|
11161
11576
|
Call,
|
|
11162
11577
|
CallLog,
|
|
11578
|
+
CTIPhone,
|
|
11163
11579
|
Recording,
|
|
11164
11580
|
ChatMessage,
|
|
11165
11581
|
ChatRoom,
|
|
@@ -11175,6 +11591,7 @@ const Wazo = {
|
|
|
11175
11591
|
CallSession,
|
|
11176
11592
|
IndirectTransfer,
|
|
11177
11593
|
SwitchboardCall,
|
|
11594
|
+
WebRTCPhone,
|
|
11178
11595
|
},
|
|
11179
11596
|
|
|
11180
11597
|
// Api
|