@wazo/sdk 0.37.42 → 0.38.1
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/README.md +218 -0
- package/dist/wazo-sdk.js +5 -5
- package/esm/__tests__/api-client.test.js +12 -7
- package/esm/__tests__/web-rtc-client.test.js +17 -10
- package/esm/api/agentd.js +12 -7
- package/esm/api/amid.js +12 -7
- package/esm/api/application.js +12 -7
- package/esm/api/auth.js +12 -7
- package/esm/api/call-logd.js +12 -7
- package/esm/api/calld.js +12 -7
- package/esm/api/chatd.js +12 -7
- package/esm/api/confd.js +12 -7
- package/esm/api/ctid-ng.js +12 -7
- package/esm/api/dird.js +12 -7
- package/esm/api/webhookd.js +12 -7
- package/esm/api-client.js +12 -7
- package/esm/checker/Checker.js +18 -11
- package/esm/checker/checks/aor.js +12 -7
- package/esm/checker/checks/api.js +12 -7
- package/esm/checker/checks/index.js +18 -11
- package/esm/checker/checks/wazo-websocket.js +13 -8
- package/esm/checker/checks/webrtc-transport.js +17 -10
- package/esm/checker/checks/webrtc.js +17 -10
- package/esm/domain/AdHocAPIConference.js +12 -7
- package/esm/domain/Features.js +12 -7
- package/esm/domain/Phone/CTIPhone.js +12 -7
- package/esm/domain/Phone/WebRTCPhone.js +12 -7
- package/esm/index.js +347 -11
- package/esm/lib/WazoSessionDescriptionHandler.js +12 -7
- package/esm/service/CallApi.js +12 -7
- package/esm/service/IssueReporter.js +12 -7
- package/esm/service/__tests__/IssueReporter.test.js +18 -7
- package/esm/service/getApiClient.js +12 -7
- package/esm/simple/Auth.js +347 -11
- package/esm/simple/Configuration.js +347 -11
- package/esm/simple/Directory.js +12 -7
- package/esm/simple/Phone.js +347 -11
- package/esm/simple/Softphone.js +329 -0
- package/esm/simple/Websocket.js +13 -8
- package/esm/simple/index.js +347 -11
- package/esm/simple/room/LocalParticipant.js +347 -11
- package/esm/simple/room/Participant.js +347 -11
- package/esm/simple/room/RemoteParticipant.js +347 -11
- package/esm/simple/room/Room.js +347 -11
- package/esm/simple/room/SipRoom.js +347 -11
- package/esm/simple/room/Stream.js +347 -11
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +347 -11
- package/esm/simple/utils.js +347 -11
- package/esm/utils/__tests__/api-requester.test.js +12 -7
- package/esm/utils/api-requester.js +12 -7
- package/esm/web-rtc-client.js +17 -10
- package/esm/websocket-client.js +13 -8
- package/lib/__tests__/api-client.test.js +12 -7
- package/lib/__tests__/web-rtc-client.test.js +17 -10
- package/lib/api/agentd.js +12 -7
- package/lib/api/amid.js +12 -7
- package/lib/api/application.js +12 -7
- package/lib/api/auth.js +12 -7
- package/lib/api/call-logd.js +12 -7
- package/lib/api/calld.js +12 -7
- package/lib/api/chatd.js +12 -7
- package/lib/api/confd.js +12 -7
- package/lib/api/ctid-ng.js +12 -7
- package/lib/api/dird.js +12 -7
- package/lib/api/webhookd.js +12 -7
- package/lib/api-client.js +12 -7
- package/lib/checker/Checker.js +18 -11
- package/lib/checker/checks/aor.js +12 -7
- package/lib/checker/checks/api.js +12 -7
- package/lib/checker/checks/index.js +18 -11
- package/lib/checker/checks/wazo-websocket.js +13 -8
- package/lib/checker/checks/webrtc-transport.js +17 -10
- package/lib/checker/checks/webrtc.js +17 -10
- package/lib/domain/AdHocAPIConference.js +12 -7
- package/lib/domain/Features.js +12 -7
- package/lib/domain/Phone/CTIPhone.js +12 -7
- package/lib/domain/Phone/WebRTCPhone.js +12 -7
- package/lib/index.js +347 -11
- package/lib/lib/WazoSessionDescriptionHandler.js +12 -7
- package/lib/service/CallApi.js +12 -7
- package/lib/service/IssueReporter.js +12 -7
- package/lib/service/__tests__/IssueReporter.test.js +18 -7
- package/lib/service/getApiClient.js +12 -7
- package/lib/simple/Auth.js +347 -11
- package/lib/simple/Configuration.js +347 -11
- package/lib/simple/Directory.js +12 -7
- package/lib/simple/Phone.js +347 -11
- package/lib/simple/Softphone.js +331 -0
- package/lib/simple/Websocket.js +13 -8
- package/lib/simple/index.js +347 -11
- package/lib/simple/room/LocalParticipant.js +347 -11
- package/lib/simple/room/Participant.js +347 -11
- package/lib/simple/room/RemoteParticipant.js +347 -11
- package/lib/simple/room/Room.js +347 -11
- package/lib/simple/room/SipRoom.js +347 -11
- package/lib/simple/room/Stream.js +347 -11
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +347 -11
- package/lib/simple/utils.js +347 -11
- package/lib/utils/__tests__/api-requester.test.js +12 -7
- package/lib/utils/api-requester.js +12 -7
- package/lib/web-rtc-client.js +17 -10
- package/lib/websocket-client.js +13 -8
- package/package.json +1 -1
- package/src/service/IssueReporter.js +12 -7
- package/src/service/__tests__/IssueReporter.test.js +6 -0
- package/src/simple/Softphone.js +327 -0
- package/src/simple/index.js +2 -0
- package/src/web-rtc-client.js +5 -3
- package/src/websocket-client.js +1 -1
|
@@ -690,13 +690,9 @@ class IssueReporter {
|
|
|
690
690
|
|
|
691
691
|
setTimeout(() => {
|
|
692
692
|
if (isArray) {
|
|
693
|
-
payload = payload.map(message =>
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
});
|
|
697
|
-
} else {
|
|
698
|
-
// $FlowFixMe
|
|
699
|
-
payload._retry = retry + 1;
|
|
693
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
694
|
+
} else if (payload && typeof payload === 'object') {
|
|
695
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
700
696
|
}
|
|
701
697
|
|
|
702
698
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -704,6 +700,15 @@ class IssueReporter {
|
|
|
704
700
|
});
|
|
705
701
|
}
|
|
706
702
|
|
|
703
|
+
_writeRetryCount(message , count ) {
|
|
704
|
+
if (message && typeof message === 'object') {
|
|
705
|
+
// $FlowFixMe
|
|
706
|
+
message._retry = count;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
return message;
|
|
710
|
+
}
|
|
711
|
+
|
|
707
712
|
_isLevelAbove(level1 , level2 ) {
|
|
708
713
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
709
714
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -7485,8 +7490,10 @@ class WebRTCClient extends Emitter {
|
|
|
7485
7490
|
conference: isConference,
|
|
7486
7491
|
};
|
|
7487
7492
|
|
|
7488
|
-
// Avoid sdh to
|
|
7489
|
-
session.sessionDescriptionHandler
|
|
7493
|
+
// Avoid sdh to create a new stream
|
|
7494
|
+
if (session.sessionDescriptionHandler) {
|
|
7495
|
+
session.sessionDescriptionHandler.localMediaStreamConstraints = options.constraints;
|
|
7496
|
+
}
|
|
7490
7497
|
|
|
7491
7498
|
// Send re-INVITE
|
|
7492
7499
|
return session.invite(options);
|
|
@@ -8329,7 +8336,7 @@ class WebRTCClient extends Emitter {
|
|
|
8329
8336
|
}
|
|
8330
8337
|
|
|
8331
8338
|
async _onHeartbeatTimeout() {
|
|
8332
|
-
logger$8.
|
|
8339
|
+
logger$8.warn('sdk webrtc heartbeat timed out', { userAgent: !!this.userAgent, cb: !!this.heartbeatTimeoutCb });
|
|
8333
8340
|
|
|
8334
8341
|
if (this.heartbeatTimeoutCb) {
|
|
8335
8342
|
this.heartbeatTimeoutCb();
|
|
@@ -11497,7 +11504,7 @@ class WebSocketClient extends Emitter {
|
|
|
11497
11504
|
this.close();
|
|
11498
11505
|
}
|
|
11499
11506
|
const url = `wss://${this.host || ''}/api/websocketd/?token=${this.token || ''}&version=${this.version}`;
|
|
11500
|
-
logger$5.
|
|
11507
|
+
logger$5.info('Wazo WS url computed to reconnect', { url });
|
|
11501
11508
|
|
|
11502
11509
|
return url;
|
|
11503
11510
|
}
|
|
@@ -13833,6 +13840,334 @@ class Checker {
|
|
|
13833
13840
|
}
|
|
13834
13841
|
}
|
|
13835
13842
|
|
|
13843
|
+
//
|
|
13844
|
+
/* eslint-disable no-unused-vars */
|
|
13845
|
+
/* global window, document */
|
|
13846
|
+
const BRIDGE_CONFIG_RETRIEVED = 'bridge/CONFIG_RETRIEVED';
|
|
13847
|
+
const BRIDGE_ENABLE_CARD = 'bridge/ENABLE_CARD';
|
|
13848
|
+
const BRIDGE_CHANGE_REQUIRED_SUBSCRIPTION_TYPE = 'bridge/CHANGE_REQUIRED_SUBSCRIPTION_TYPE';
|
|
13849
|
+
const BRIDGE_CREATE_OR_UPDATE_CARD = 'bridge/BRIDGE_CREATE_OR_UPDATE_CARD';
|
|
13850
|
+
const BRIDGE_OPTIONS_FETCHED = 'bridge/BRIDGE_OPTIONS_FETCHED';
|
|
13851
|
+
const BRIDGE_OPTIONS_FOUND = 'bridge/BRIDGE_OPTIONS_FOUND';
|
|
13852
|
+
const BRIDGE_SEARCH_OPTIONS = 'bridge/BRIDGE_SEARCH_OPTIONS';
|
|
13853
|
+
const BRIDGE_DISPLAY_LINKED_OPTION = 'bridge/DISPLAY_LINKED_OPTION';
|
|
13854
|
+
const BRIDGE_UPDATE_FORM_SCHEMA = 'bridge/BRIDGE_UPDATE_FORM_SCHEMA';
|
|
13855
|
+
const BRIDGE_WAZO_CONTACT_SEARCH = 'bridge/BRIDGE_WAZO_CONTACT_SEARCH';
|
|
13856
|
+
const BRIDGE_ON_AGENT_LOGGED_IN = 'bridge/BRIDGE_ON_AGENT_LOGGED_IN';
|
|
13857
|
+
const BRIDGE_ON_AGENT_LOGGED_OUT = 'bridge/BRIDGE_ON_AGENT_LOGGED_OUT';
|
|
13858
|
+
const BRIDGE_ON_AGENT_PAUSED = 'bridge/BRIDGE_ON_AGENT_PAUSED';
|
|
13859
|
+
const BRIDGE_ON_AGENT_RESUMED = 'bridge/BRIDGE_ON_AGENT_RESUMED';
|
|
13860
|
+
const BRIDGE_ON_LANGUAGE_CHANGED = 'bridge/BRIDGE_ON_LANGUAGE_CHANGED';
|
|
13861
|
+
const BRIDGE_ON_CALL_HELD = 'bridge/BRIDGE_ON_CALL_HELD';
|
|
13862
|
+
const BRIDGE_ON_CALL_RESUMED = 'bridge/BRIDGE_ON_CALL_RESUMED';
|
|
13863
|
+
const BRIDGE_ON_CALL_MUTED = 'bridge/BRIDGE_ON_CALL_MUTED';
|
|
13864
|
+
const BRIDGE_ON_CALL_UN_MUTED = 'bridge/BRIDGE_ON_CALL_UN_MUTED';
|
|
13865
|
+
const BRIDGE_ON_DTMF = 'bridge/BRIDGE_ON_DTMF';
|
|
13866
|
+
const BRIDGE_ON_DIRECT_TRANSFER = 'bridge/BRIDGE_ON_DIRECT_TRANSFER';
|
|
13867
|
+
const BRIDGE_ON_CREATE_INDIRECT_TRANSFER = 'bridge/BRIDGE_ON_CREATE_INDIRECT_TRANSFER';
|
|
13868
|
+
const BRIDGE_ON_CANCEL_INDIRECT_TRANSFER = 'bridge/BRIDGE_ON_CANCEL_INDIRECT_TRANSFER';
|
|
13869
|
+
const BRIDGE_ON_CONFIRM_INDIRECT_TRANSFER = 'bridge/BRIDGE_ON_CONFIRM_INDIRECT_TRANSFER';
|
|
13870
|
+
const BRIDGE_ON_INDIRECT_TRANSFER_CALL_MADE = 'bridge/BRIDGE_ON_INDIRECT_TRANSFER_CALL_MADE';
|
|
13871
|
+
const BRIDGE_ON_INDIRECT_TRANSFER_DONE = 'bridge/BRIDGE_ON_INDIRECT_TRANSFER_DONE';
|
|
13872
|
+
const BRIDGE_ON_START_RECORDING = 'bridge/BRIDGE_ON_START_RECORDING';
|
|
13873
|
+
const BRIDGE_ON_STOP_RECORDING = 'bridge/BRIDGE_ON_STOP_RECORDING';
|
|
13874
|
+
|
|
13875
|
+
const SDK_CLICK_TO_CALL = 'sdk/CLICK_TO_CALL';
|
|
13876
|
+
const SDK_ON_CALL_MADE = 'sdk/SDK_ON_CALL_MADE';
|
|
13877
|
+
const SDK_CALL_ENDED = 'sdk/ON_CALL_ENDED';
|
|
13878
|
+
const SDK_CALL_INCOMING = 'sdk/SDK_CALL_INCOMING';
|
|
13879
|
+
const SDK_AUTHENTICATED = 'sdk/SDK_AUTHENTICATED';
|
|
13880
|
+
const SDK_LOGGED_OUT = 'sdk/SDK_LOGGED_OUT';
|
|
13881
|
+
|
|
13882
|
+
class Softphone {
|
|
13883
|
+
url = 'https://softphone.wazo.io';
|
|
13884
|
+
width = 500;
|
|
13885
|
+
height = 600;
|
|
13886
|
+
displayed = false;
|
|
13887
|
+
iframe = null;
|
|
13888
|
+
|
|
13889
|
+
onLinkEnabled(link ) {}
|
|
13890
|
+
onIFrameLoaded() {}
|
|
13891
|
+
|
|
13892
|
+
onCallMade(call ) {}
|
|
13893
|
+
onCallIncoming(call ) {}
|
|
13894
|
+
onCallEnded(call , card , direction , fromExtension ) {}
|
|
13895
|
+
onCardSaved(card ) {}
|
|
13896
|
+
onAuthenticated(session ) {}
|
|
13897
|
+
onLoggedOut() {}
|
|
13898
|
+
onSearchOptions(fieldId , query ) {}
|
|
13899
|
+
onDisplayLinkedOption(optionId ) {}
|
|
13900
|
+
onWazoContactSearch(query ) {}
|
|
13901
|
+
onAgentLoggedIn() {}
|
|
13902
|
+
onAgentLoggedOut() {}
|
|
13903
|
+
onAgentPaused() {}
|
|
13904
|
+
onAgentResumed() {}
|
|
13905
|
+
onLanguageChanged(language ) {}
|
|
13906
|
+
onCallHeld() {}
|
|
13907
|
+
onCallResumed() {}
|
|
13908
|
+
onCallMuted() {}
|
|
13909
|
+
onCallUnMuted() {}
|
|
13910
|
+
onDtmfSent(tone ) {}
|
|
13911
|
+
onDirectTransfer(number ) {}
|
|
13912
|
+
onCreateIndirectTransfer(number ) {}
|
|
13913
|
+
onCancelIndirectTransfer() {}
|
|
13914
|
+
onConfirmIndirectTransfer() {}
|
|
13915
|
+
onIndirectCallMade(call ) {}
|
|
13916
|
+
onIndirectTransferDone(call ) {}
|
|
13917
|
+
onStartRecording() {}
|
|
13918
|
+
onStopRecording() {}
|
|
13919
|
+
onUnHandledEvent(event ) {}
|
|
13920
|
+
|
|
13921
|
+
init({ url, width, height, server, port, language, wrapUpDuration, shouldDisplayLinkedEntities,
|
|
13922
|
+
allowContactCreation, withCard, subscriptionType, enableAgent } = {}) {
|
|
13923
|
+
if (url) {
|
|
13924
|
+
this.url = url;
|
|
13925
|
+
}
|
|
13926
|
+
if (width) {
|
|
13927
|
+
this.width = width;
|
|
13928
|
+
}
|
|
13929
|
+
if (height) {
|
|
13930
|
+
this.height = height;
|
|
13931
|
+
}
|
|
13932
|
+
|
|
13933
|
+
window.addEventListener('message', this._onMessage.bind(this), false);
|
|
13934
|
+
|
|
13935
|
+
if (!server) {
|
|
13936
|
+
// eslint-disable-next-line no-param-reassign
|
|
13937
|
+
server = 'stack.dev.wazo.io';
|
|
13938
|
+
}
|
|
13939
|
+
|
|
13940
|
+
this._createIframe(() => {
|
|
13941
|
+
this._sendMessage(BRIDGE_CONFIG_RETRIEVED, {
|
|
13942
|
+
config: {
|
|
13943
|
+
server,
|
|
13944
|
+
port,
|
|
13945
|
+
language,
|
|
13946
|
+
wrapUpDuration,
|
|
13947
|
+
shouldDisplayLinkedEntities,
|
|
13948
|
+
allowContactCreation,
|
|
13949
|
+
},
|
|
13950
|
+
});
|
|
13951
|
+
|
|
13952
|
+
if (withCard) {
|
|
13953
|
+
this._sendMessage(BRIDGE_ENABLE_CARD);
|
|
13954
|
+
}
|
|
13955
|
+
|
|
13956
|
+
if (subscriptionType) {
|
|
13957
|
+
this._sendMessage(BRIDGE_CHANGE_REQUIRED_SUBSCRIPTION_TYPE, { subscriptionType });
|
|
13958
|
+
}
|
|
13959
|
+
|
|
13960
|
+
this.onIFrameLoaded();
|
|
13961
|
+
});
|
|
13962
|
+
}
|
|
13963
|
+
|
|
13964
|
+
parseLinks() {
|
|
13965
|
+
const links = this._getLinks();
|
|
13966
|
+
|
|
13967
|
+
links.forEach(link => {
|
|
13968
|
+
link.setAttribute('data-wazo-parsed', true);
|
|
13969
|
+
link.addEventListener('click', this._onLinkClick.bind(this));
|
|
13970
|
+
this.onLinkEnabled(link);
|
|
13971
|
+
});
|
|
13972
|
+
}
|
|
13973
|
+
|
|
13974
|
+
makeCall(number ) {
|
|
13975
|
+
this.displaySoftphone();
|
|
13976
|
+
|
|
13977
|
+
this._sendMessage(SDK_CLICK_TO_CALL, { number });
|
|
13978
|
+
}
|
|
13979
|
+
|
|
13980
|
+
toggleSoftphoneDisplay() {
|
|
13981
|
+
if (this.displayed) {
|
|
13982
|
+
this.hideSoftphone();
|
|
13983
|
+
} else {
|
|
13984
|
+
this.displaySoftphone();
|
|
13985
|
+
}
|
|
13986
|
+
}
|
|
13987
|
+
|
|
13988
|
+
displaySoftphone() {
|
|
13989
|
+
if (!this.iframe) {
|
|
13990
|
+
this._createIframe();
|
|
13991
|
+
}
|
|
13992
|
+
|
|
13993
|
+
if (this.iframe) {
|
|
13994
|
+
this.iframe.style.display = 'block';
|
|
13995
|
+
}
|
|
13996
|
+
|
|
13997
|
+
this.displayed = true;
|
|
13998
|
+
}
|
|
13999
|
+
|
|
14000
|
+
hideSoftphone() {
|
|
14001
|
+
if (this.iframe) {
|
|
14002
|
+
this.iframe.style.display = 'none';
|
|
14003
|
+
}
|
|
14004
|
+
this.displayed = false;
|
|
14005
|
+
}
|
|
14006
|
+
|
|
14007
|
+
optionsFetched(fieldId , options ) {
|
|
14008
|
+
this._sendMessage(BRIDGE_OPTIONS_FETCHED, { fieldId, options });
|
|
14009
|
+
}
|
|
14010
|
+
|
|
14011
|
+
onOptionsResults(fieldId , options ) {
|
|
14012
|
+
this._sendMessage(BRIDGE_OPTIONS_FOUND, { fieldId, options });
|
|
14013
|
+
}
|
|
14014
|
+
|
|
14015
|
+
setFormSchema(schema , uiSchema ) {
|
|
14016
|
+
this._sendMessage(BRIDGE_UPDATE_FORM_SCHEMA, { schema, uiSchema });
|
|
14017
|
+
}
|
|
14018
|
+
|
|
14019
|
+
_createIframe(cb = () => {}) {
|
|
14020
|
+
this.iframe = document.createElement('iframe');
|
|
14021
|
+
// $FlowFixMe
|
|
14022
|
+
this.iframe.width = this.width;
|
|
14023
|
+
// $FlowFixMe
|
|
14024
|
+
this.iframe.height = this.height;
|
|
14025
|
+
// $FlowFixMe
|
|
14026
|
+
this.iframe.allow = 'camera *; microphone *; autoplay *; display-capture *';
|
|
14027
|
+
this.iframe.style.position = 'absolute';
|
|
14028
|
+
this.iframe.style.left = '0';
|
|
14029
|
+
this.iframe.style.bottom = '0';
|
|
14030
|
+
this.iframe.style.border = '1px solid #aaa';
|
|
14031
|
+
this.iframe.style.backgroundColor = 'white';
|
|
14032
|
+
this.iframe.src = this.url;
|
|
14033
|
+
this.iframe.style.display = 'none';
|
|
14034
|
+
this.iframe.id = 'wazo-softphone';
|
|
14035
|
+
|
|
14036
|
+
this.iframe.onload = cb;
|
|
14037
|
+
|
|
14038
|
+
// $FlowFixMe
|
|
14039
|
+
document.body.appendChild(this.iframe);
|
|
14040
|
+
}
|
|
14041
|
+
|
|
14042
|
+
_getLinks() {
|
|
14043
|
+
return [].slice.call(document.querySelectorAll('a:not([data-wazo-parsed])'), 0)
|
|
14044
|
+
.filter(link => link.href.indexOf('tel:') === 0 || link.href.indexOf('callto:') === 0);
|
|
14045
|
+
}
|
|
14046
|
+
|
|
14047
|
+
_onLinkClick(e ) {
|
|
14048
|
+
e.preventDefault();
|
|
14049
|
+
const number = e.target.href.split(':')[1];
|
|
14050
|
+
|
|
14051
|
+
this.makeCall(number);
|
|
14052
|
+
}
|
|
14053
|
+
|
|
14054
|
+
_onAuthenticated() {
|
|
14055
|
+
this.parseLinks();
|
|
14056
|
+
}
|
|
14057
|
+
|
|
14058
|
+
_onMessage(event ) {
|
|
14059
|
+
if (!event.data) {
|
|
14060
|
+
return;
|
|
14061
|
+
}
|
|
14062
|
+
|
|
14063
|
+
switch (event.data.type) {
|
|
14064
|
+
case SDK_ON_CALL_MADE:
|
|
14065
|
+
this.onCallMade(event.data.callSession);
|
|
14066
|
+
break;
|
|
14067
|
+
case SDK_CALL_ENDED: {
|
|
14068
|
+
const { callSession, content, direction, userExtension } = event.data;
|
|
14069
|
+
this.onCallEnded(callSession, content, direction, userExtension);
|
|
14070
|
+
break;
|
|
14071
|
+
}
|
|
14072
|
+
case SDK_CALL_INCOMING:
|
|
14073
|
+
this.onCallIncoming(event.data.callSession);
|
|
14074
|
+
break;
|
|
14075
|
+
case SDK_AUTHENTICATED:
|
|
14076
|
+
// $FlowFixMe
|
|
14077
|
+
this._onAuthenticated(event.data.session);
|
|
14078
|
+
this.onAuthenticated(event.data.session);
|
|
14079
|
+
break;
|
|
14080
|
+
case SDK_LOGGED_OUT:
|
|
14081
|
+
this.onLoggedOut();
|
|
14082
|
+
break;
|
|
14083
|
+
case BRIDGE_CREATE_OR_UPDATE_CARD: {
|
|
14084
|
+
const { content } = event.data;
|
|
14085
|
+
this.onCardSaved(content);
|
|
14086
|
+
break;
|
|
14087
|
+
}
|
|
14088
|
+
case BRIDGE_SEARCH_OPTIONS: {
|
|
14089
|
+
const { fieldId, query } = event.data;
|
|
14090
|
+
this.onSearchOptions(fieldId, query);
|
|
14091
|
+
break;
|
|
14092
|
+
}
|
|
14093
|
+
case BRIDGE_DISPLAY_LINKED_OPTION:
|
|
14094
|
+
this.onDisplayLinkedOption(event.data.linkedOptionId);
|
|
14095
|
+
break;
|
|
14096
|
+
case BRIDGE_WAZO_CONTACT_SEARCH:
|
|
14097
|
+
this.onWazoContactSearch(event.data.query);
|
|
14098
|
+
break;
|
|
14099
|
+
case BRIDGE_ON_AGENT_LOGGED_IN:
|
|
14100
|
+
this.onAgentLoggedIn();
|
|
14101
|
+
break;
|
|
14102
|
+
case BRIDGE_ON_AGENT_LOGGED_OUT:
|
|
14103
|
+
this.onAgentLoggedOut();
|
|
14104
|
+
break;
|
|
14105
|
+
case BRIDGE_ON_AGENT_PAUSED:
|
|
14106
|
+
this.onAgentPaused();
|
|
14107
|
+
break;
|
|
14108
|
+
case BRIDGE_ON_AGENT_RESUMED:
|
|
14109
|
+
this.onAgentResumed();
|
|
14110
|
+
break;
|
|
14111
|
+
case BRIDGE_ON_LANGUAGE_CHANGED:
|
|
14112
|
+
this.onLanguageChanged(event.data.language);
|
|
14113
|
+
break;
|
|
14114
|
+
case BRIDGE_ON_CALL_HELD:
|
|
14115
|
+
this.onCallHeld();
|
|
14116
|
+
break;
|
|
14117
|
+
case BRIDGE_ON_CALL_RESUMED:
|
|
14118
|
+
this.onCallResumed();
|
|
14119
|
+
break;
|
|
14120
|
+
case BRIDGE_ON_CALL_MUTED:
|
|
14121
|
+
this.onCallMuted();
|
|
14122
|
+
break;
|
|
14123
|
+
case BRIDGE_ON_CALL_UN_MUTED:
|
|
14124
|
+
this.onCallUnMuted();
|
|
14125
|
+
break;
|
|
14126
|
+
case BRIDGE_ON_DTMF:
|
|
14127
|
+
this.onDtmfSent(event.data.tone);
|
|
14128
|
+
break;
|
|
14129
|
+
case BRIDGE_ON_DIRECT_TRANSFER:
|
|
14130
|
+
this.onDirectTransfer(event.data.number);
|
|
14131
|
+
break;
|
|
14132
|
+
case BRIDGE_ON_CREATE_INDIRECT_TRANSFER:
|
|
14133
|
+
this.onCreateIndirectTransfer(event.data.number);
|
|
14134
|
+
break;
|
|
14135
|
+
case BRIDGE_ON_CANCEL_INDIRECT_TRANSFER:
|
|
14136
|
+
this.onCancelIndirectTransfer();
|
|
14137
|
+
break;
|
|
14138
|
+
case BRIDGE_ON_CONFIRM_INDIRECT_TRANSFER:
|
|
14139
|
+
this.onConfirmIndirectTransfer();
|
|
14140
|
+
break;
|
|
14141
|
+
case BRIDGE_ON_INDIRECT_TRANSFER_CALL_MADE:
|
|
14142
|
+
this.onIndirectCallMade(event.data.call);
|
|
14143
|
+
break;
|
|
14144
|
+
case BRIDGE_ON_INDIRECT_TRANSFER_DONE:
|
|
14145
|
+
this.onIndirectTransferDone(event.data.call);
|
|
14146
|
+
break;
|
|
14147
|
+
case BRIDGE_ON_START_RECORDING:
|
|
14148
|
+
this.onStartRecording();
|
|
14149
|
+
break;
|
|
14150
|
+
case BRIDGE_ON_STOP_RECORDING:
|
|
14151
|
+
this.onStopRecording();
|
|
14152
|
+
break;
|
|
14153
|
+
default:
|
|
14154
|
+
this.onUnHandledEvent(event);
|
|
14155
|
+
break;
|
|
14156
|
+
}
|
|
14157
|
+
}
|
|
14158
|
+
|
|
14159
|
+
_sendMessage(type , payload = {}) {
|
|
14160
|
+
if (!this.iframe) {
|
|
14161
|
+
console.warn(`Could not send message of type ${type} to the Wazo Softphone, iframe not created yet`);
|
|
14162
|
+
return;
|
|
14163
|
+
}
|
|
14164
|
+
|
|
14165
|
+
this.iframe.contentWindow.postMessage({ type, ...payload }, '*');
|
|
14166
|
+
}
|
|
14167
|
+
}
|
|
14168
|
+
|
|
14169
|
+
var Softphone$1 = new Softphone();
|
|
14170
|
+
|
|
13836
14171
|
/* global window */
|
|
13837
14172
|
|
|
13838
14173
|
const Wazo = {
|
|
@@ -13853,6 +14188,7 @@ const Wazo = {
|
|
|
13853
14188
|
loggerFor: IssueReporter$1.loggerFor.bind(IssueReporter$1),
|
|
13854
14189
|
Features: Features$1,
|
|
13855
14190
|
Checker,
|
|
14191
|
+
Softphone: Softphone$1,
|
|
13856
14192
|
|
|
13857
14193
|
// Domain
|
|
13858
14194
|
domain: {
|