@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
|
@@ -1919,13 +1919,9 @@ class IssueReporter {
|
|
|
1919
1919
|
|
|
1920
1920
|
setTimeout(() => {
|
|
1921
1921
|
if (isArray) {
|
|
1922
|
-
payload = payload.map(message =>
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
});
|
|
1926
|
-
} else {
|
|
1927
|
-
// $FlowFixMe
|
|
1928
|
-
payload._retry = retry + 1;
|
|
1922
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
1923
|
+
} else if (payload && typeof payload === 'object') {
|
|
1924
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
1929
1925
|
}
|
|
1930
1926
|
|
|
1931
1927
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -1933,6 +1929,15 @@ class IssueReporter {
|
|
|
1933
1929
|
});
|
|
1934
1930
|
}
|
|
1935
1931
|
|
|
1932
|
+
_writeRetryCount(message , count ) {
|
|
1933
|
+
if (message && typeof message === 'object') {
|
|
1934
|
+
// $FlowFixMe
|
|
1935
|
+
message._retry = count;
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
return message;
|
|
1939
|
+
}
|
|
1940
|
+
|
|
1936
1941
|
_isLevelAbove(level1 , level2 ) {
|
|
1937
1942
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
1938
1943
|
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
|
}
|
|
@@ -13914,6 +13921,334 @@ class Checker {
|
|
|
13914
13921
|
}
|
|
13915
13922
|
}
|
|
13916
13923
|
|
|
13924
|
+
//
|
|
13925
|
+
/* eslint-disable no-unused-vars */
|
|
13926
|
+
/* global window, document */
|
|
13927
|
+
const BRIDGE_CONFIG_RETRIEVED = 'bridge/CONFIG_RETRIEVED';
|
|
13928
|
+
const BRIDGE_ENABLE_CARD = 'bridge/ENABLE_CARD';
|
|
13929
|
+
const BRIDGE_CHANGE_REQUIRED_SUBSCRIPTION_TYPE = 'bridge/CHANGE_REQUIRED_SUBSCRIPTION_TYPE';
|
|
13930
|
+
const BRIDGE_CREATE_OR_UPDATE_CARD = 'bridge/BRIDGE_CREATE_OR_UPDATE_CARD';
|
|
13931
|
+
const BRIDGE_OPTIONS_FETCHED = 'bridge/BRIDGE_OPTIONS_FETCHED';
|
|
13932
|
+
const BRIDGE_OPTIONS_FOUND = 'bridge/BRIDGE_OPTIONS_FOUND';
|
|
13933
|
+
const BRIDGE_SEARCH_OPTIONS = 'bridge/BRIDGE_SEARCH_OPTIONS';
|
|
13934
|
+
const BRIDGE_DISPLAY_LINKED_OPTION = 'bridge/DISPLAY_LINKED_OPTION';
|
|
13935
|
+
const BRIDGE_UPDATE_FORM_SCHEMA = 'bridge/BRIDGE_UPDATE_FORM_SCHEMA';
|
|
13936
|
+
const BRIDGE_WAZO_CONTACT_SEARCH = 'bridge/BRIDGE_WAZO_CONTACT_SEARCH';
|
|
13937
|
+
const BRIDGE_ON_AGENT_LOGGED_IN = 'bridge/BRIDGE_ON_AGENT_LOGGED_IN';
|
|
13938
|
+
const BRIDGE_ON_AGENT_LOGGED_OUT = 'bridge/BRIDGE_ON_AGENT_LOGGED_OUT';
|
|
13939
|
+
const BRIDGE_ON_AGENT_PAUSED = 'bridge/BRIDGE_ON_AGENT_PAUSED';
|
|
13940
|
+
const BRIDGE_ON_AGENT_RESUMED = 'bridge/BRIDGE_ON_AGENT_RESUMED';
|
|
13941
|
+
const BRIDGE_ON_LANGUAGE_CHANGED = 'bridge/BRIDGE_ON_LANGUAGE_CHANGED';
|
|
13942
|
+
const BRIDGE_ON_CALL_HELD = 'bridge/BRIDGE_ON_CALL_HELD';
|
|
13943
|
+
const BRIDGE_ON_CALL_RESUMED = 'bridge/BRIDGE_ON_CALL_RESUMED';
|
|
13944
|
+
const BRIDGE_ON_CALL_MUTED = 'bridge/BRIDGE_ON_CALL_MUTED';
|
|
13945
|
+
const BRIDGE_ON_CALL_UN_MUTED = 'bridge/BRIDGE_ON_CALL_UN_MUTED';
|
|
13946
|
+
const BRIDGE_ON_DTMF = 'bridge/BRIDGE_ON_DTMF';
|
|
13947
|
+
const BRIDGE_ON_DIRECT_TRANSFER = 'bridge/BRIDGE_ON_DIRECT_TRANSFER';
|
|
13948
|
+
const BRIDGE_ON_CREATE_INDIRECT_TRANSFER = 'bridge/BRIDGE_ON_CREATE_INDIRECT_TRANSFER';
|
|
13949
|
+
const BRIDGE_ON_CANCEL_INDIRECT_TRANSFER = 'bridge/BRIDGE_ON_CANCEL_INDIRECT_TRANSFER';
|
|
13950
|
+
const BRIDGE_ON_CONFIRM_INDIRECT_TRANSFER = 'bridge/BRIDGE_ON_CONFIRM_INDIRECT_TRANSFER';
|
|
13951
|
+
const BRIDGE_ON_INDIRECT_TRANSFER_CALL_MADE = 'bridge/BRIDGE_ON_INDIRECT_TRANSFER_CALL_MADE';
|
|
13952
|
+
const BRIDGE_ON_INDIRECT_TRANSFER_DONE = 'bridge/BRIDGE_ON_INDIRECT_TRANSFER_DONE';
|
|
13953
|
+
const BRIDGE_ON_START_RECORDING = 'bridge/BRIDGE_ON_START_RECORDING';
|
|
13954
|
+
const BRIDGE_ON_STOP_RECORDING = 'bridge/BRIDGE_ON_STOP_RECORDING';
|
|
13955
|
+
|
|
13956
|
+
const SDK_CLICK_TO_CALL = 'sdk/CLICK_TO_CALL';
|
|
13957
|
+
const SDK_ON_CALL_MADE = 'sdk/SDK_ON_CALL_MADE';
|
|
13958
|
+
const SDK_CALL_ENDED = 'sdk/ON_CALL_ENDED';
|
|
13959
|
+
const SDK_CALL_INCOMING = 'sdk/SDK_CALL_INCOMING';
|
|
13960
|
+
const SDK_AUTHENTICATED = 'sdk/SDK_AUTHENTICATED';
|
|
13961
|
+
const SDK_LOGGED_OUT = 'sdk/SDK_LOGGED_OUT';
|
|
13962
|
+
|
|
13963
|
+
class Softphone {
|
|
13964
|
+
url = 'https://softphone.wazo.io';
|
|
13965
|
+
width = 500;
|
|
13966
|
+
height = 600;
|
|
13967
|
+
displayed = false;
|
|
13968
|
+
iframe = null;
|
|
13969
|
+
|
|
13970
|
+
onLinkEnabled(link ) {}
|
|
13971
|
+
onIFrameLoaded() {}
|
|
13972
|
+
|
|
13973
|
+
onCallMade(call ) {}
|
|
13974
|
+
onCallIncoming(call ) {}
|
|
13975
|
+
onCallEnded(call , card , direction , fromExtension ) {}
|
|
13976
|
+
onCardSaved(card ) {}
|
|
13977
|
+
onAuthenticated(session ) {}
|
|
13978
|
+
onLoggedOut() {}
|
|
13979
|
+
onSearchOptions(fieldId , query ) {}
|
|
13980
|
+
onDisplayLinkedOption(optionId ) {}
|
|
13981
|
+
onWazoContactSearch(query ) {}
|
|
13982
|
+
onAgentLoggedIn() {}
|
|
13983
|
+
onAgentLoggedOut() {}
|
|
13984
|
+
onAgentPaused() {}
|
|
13985
|
+
onAgentResumed() {}
|
|
13986
|
+
onLanguageChanged(language ) {}
|
|
13987
|
+
onCallHeld() {}
|
|
13988
|
+
onCallResumed() {}
|
|
13989
|
+
onCallMuted() {}
|
|
13990
|
+
onCallUnMuted() {}
|
|
13991
|
+
onDtmfSent(tone ) {}
|
|
13992
|
+
onDirectTransfer(number ) {}
|
|
13993
|
+
onCreateIndirectTransfer(number ) {}
|
|
13994
|
+
onCancelIndirectTransfer() {}
|
|
13995
|
+
onConfirmIndirectTransfer() {}
|
|
13996
|
+
onIndirectCallMade(call ) {}
|
|
13997
|
+
onIndirectTransferDone(call ) {}
|
|
13998
|
+
onStartRecording() {}
|
|
13999
|
+
onStopRecording() {}
|
|
14000
|
+
onUnHandledEvent(event ) {}
|
|
14001
|
+
|
|
14002
|
+
init({ url, width, height, server, port, language, wrapUpDuration, shouldDisplayLinkedEntities,
|
|
14003
|
+
allowContactCreation, withCard, subscriptionType, enableAgent } = {}) {
|
|
14004
|
+
if (url) {
|
|
14005
|
+
this.url = url;
|
|
14006
|
+
}
|
|
14007
|
+
if (width) {
|
|
14008
|
+
this.width = width;
|
|
14009
|
+
}
|
|
14010
|
+
if (height) {
|
|
14011
|
+
this.height = height;
|
|
14012
|
+
}
|
|
14013
|
+
|
|
14014
|
+
window.addEventListener('message', this._onMessage.bind(this), false);
|
|
14015
|
+
|
|
14016
|
+
if (!server) {
|
|
14017
|
+
// eslint-disable-next-line no-param-reassign
|
|
14018
|
+
server = 'stack.dev.wazo.io';
|
|
14019
|
+
}
|
|
14020
|
+
|
|
14021
|
+
this._createIframe(() => {
|
|
14022
|
+
this._sendMessage(BRIDGE_CONFIG_RETRIEVED, {
|
|
14023
|
+
config: {
|
|
14024
|
+
server,
|
|
14025
|
+
port,
|
|
14026
|
+
language,
|
|
14027
|
+
wrapUpDuration,
|
|
14028
|
+
shouldDisplayLinkedEntities,
|
|
14029
|
+
allowContactCreation,
|
|
14030
|
+
},
|
|
14031
|
+
});
|
|
14032
|
+
|
|
14033
|
+
if (withCard) {
|
|
14034
|
+
this._sendMessage(BRIDGE_ENABLE_CARD);
|
|
14035
|
+
}
|
|
14036
|
+
|
|
14037
|
+
if (subscriptionType) {
|
|
14038
|
+
this._sendMessage(BRIDGE_CHANGE_REQUIRED_SUBSCRIPTION_TYPE, { subscriptionType });
|
|
14039
|
+
}
|
|
14040
|
+
|
|
14041
|
+
this.onIFrameLoaded();
|
|
14042
|
+
});
|
|
14043
|
+
}
|
|
14044
|
+
|
|
14045
|
+
parseLinks() {
|
|
14046
|
+
const links = this._getLinks();
|
|
14047
|
+
|
|
14048
|
+
links.forEach(link => {
|
|
14049
|
+
link.setAttribute('data-wazo-parsed', true);
|
|
14050
|
+
link.addEventListener('click', this._onLinkClick.bind(this));
|
|
14051
|
+
this.onLinkEnabled(link);
|
|
14052
|
+
});
|
|
14053
|
+
}
|
|
14054
|
+
|
|
14055
|
+
makeCall(number ) {
|
|
14056
|
+
this.displaySoftphone();
|
|
14057
|
+
|
|
14058
|
+
this._sendMessage(SDK_CLICK_TO_CALL, { number });
|
|
14059
|
+
}
|
|
14060
|
+
|
|
14061
|
+
toggleSoftphoneDisplay() {
|
|
14062
|
+
if (this.displayed) {
|
|
14063
|
+
this.hideSoftphone();
|
|
14064
|
+
} else {
|
|
14065
|
+
this.displaySoftphone();
|
|
14066
|
+
}
|
|
14067
|
+
}
|
|
14068
|
+
|
|
14069
|
+
displaySoftphone() {
|
|
14070
|
+
if (!this.iframe) {
|
|
14071
|
+
this._createIframe();
|
|
14072
|
+
}
|
|
14073
|
+
|
|
14074
|
+
if (this.iframe) {
|
|
14075
|
+
this.iframe.style.display = 'block';
|
|
14076
|
+
}
|
|
14077
|
+
|
|
14078
|
+
this.displayed = true;
|
|
14079
|
+
}
|
|
14080
|
+
|
|
14081
|
+
hideSoftphone() {
|
|
14082
|
+
if (this.iframe) {
|
|
14083
|
+
this.iframe.style.display = 'none';
|
|
14084
|
+
}
|
|
14085
|
+
this.displayed = false;
|
|
14086
|
+
}
|
|
14087
|
+
|
|
14088
|
+
optionsFetched(fieldId , options ) {
|
|
14089
|
+
this._sendMessage(BRIDGE_OPTIONS_FETCHED, { fieldId, options });
|
|
14090
|
+
}
|
|
14091
|
+
|
|
14092
|
+
onOptionsResults(fieldId , options ) {
|
|
14093
|
+
this._sendMessage(BRIDGE_OPTIONS_FOUND, { fieldId, options });
|
|
14094
|
+
}
|
|
14095
|
+
|
|
14096
|
+
setFormSchema(schema , uiSchema ) {
|
|
14097
|
+
this._sendMessage(BRIDGE_UPDATE_FORM_SCHEMA, { schema, uiSchema });
|
|
14098
|
+
}
|
|
14099
|
+
|
|
14100
|
+
_createIframe(cb = () => {}) {
|
|
14101
|
+
this.iframe = document.createElement('iframe');
|
|
14102
|
+
// $FlowFixMe
|
|
14103
|
+
this.iframe.width = this.width;
|
|
14104
|
+
// $FlowFixMe
|
|
14105
|
+
this.iframe.height = this.height;
|
|
14106
|
+
// $FlowFixMe
|
|
14107
|
+
this.iframe.allow = 'camera *; microphone *; autoplay *; display-capture *';
|
|
14108
|
+
this.iframe.style.position = 'absolute';
|
|
14109
|
+
this.iframe.style.left = '0';
|
|
14110
|
+
this.iframe.style.bottom = '0';
|
|
14111
|
+
this.iframe.style.border = '1px solid #aaa';
|
|
14112
|
+
this.iframe.style.backgroundColor = 'white';
|
|
14113
|
+
this.iframe.src = this.url;
|
|
14114
|
+
this.iframe.style.display = 'none';
|
|
14115
|
+
this.iframe.id = 'wazo-softphone';
|
|
14116
|
+
|
|
14117
|
+
this.iframe.onload = cb;
|
|
14118
|
+
|
|
14119
|
+
// $FlowFixMe
|
|
14120
|
+
document.body.appendChild(this.iframe);
|
|
14121
|
+
}
|
|
14122
|
+
|
|
14123
|
+
_getLinks() {
|
|
14124
|
+
return [].slice.call(document.querySelectorAll('a:not([data-wazo-parsed])'), 0)
|
|
14125
|
+
.filter(link => link.href.indexOf('tel:') === 0 || link.href.indexOf('callto:') === 0);
|
|
14126
|
+
}
|
|
14127
|
+
|
|
14128
|
+
_onLinkClick(e ) {
|
|
14129
|
+
e.preventDefault();
|
|
14130
|
+
const number = e.target.href.split(':')[1];
|
|
14131
|
+
|
|
14132
|
+
this.makeCall(number);
|
|
14133
|
+
}
|
|
14134
|
+
|
|
14135
|
+
_onAuthenticated() {
|
|
14136
|
+
this.parseLinks();
|
|
14137
|
+
}
|
|
14138
|
+
|
|
14139
|
+
_onMessage(event ) {
|
|
14140
|
+
if (!event.data) {
|
|
14141
|
+
return;
|
|
14142
|
+
}
|
|
14143
|
+
|
|
14144
|
+
switch (event.data.type) {
|
|
14145
|
+
case SDK_ON_CALL_MADE:
|
|
14146
|
+
this.onCallMade(event.data.callSession);
|
|
14147
|
+
break;
|
|
14148
|
+
case SDK_CALL_ENDED: {
|
|
14149
|
+
const { callSession, content, direction, userExtension } = event.data;
|
|
14150
|
+
this.onCallEnded(callSession, content, direction, userExtension);
|
|
14151
|
+
break;
|
|
14152
|
+
}
|
|
14153
|
+
case SDK_CALL_INCOMING:
|
|
14154
|
+
this.onCallIncoming(event.data.callSession);
|
|
14155
|
+
break;
|
|
14156
|
+
case SDK_AUTHENTICATED:
|
|
14157
|
+
// $FlowFixMe
|
|
14158
|
+
this._onAuthenticated(event.data.session);
|
|
14159
|
+
this.onAuthenticated(event.data.session);
|
|
14160
|
+
break;
|
|
14161
|
+
case SDK_LOGGED_OUT:
|
|
14162
|
+
this.onLoggedOut();
|
|
14163
|
+
break;
|
|
14164
|
+
case BRIDGE_CREATE_OR_UPDATE_CARD: {
|
|
14165
|
+
const { content } = event.data;
|
|
14166
|
+
this.onCardSaved(content);
|
|
14167
|
+
break;
|
|
14168
|
+
}
|
|
14169
|
+
case BRIDGE_SEARCH_OPTIONS: {
|
|
14170
|
+
const { fieldId, query } = event.data;
|
|
14171
|
+
this.onSearchOptions(fieldId, query);
|
|
14172
|
+
break;
|
|
14173
|
+
}
|
|
14174
|
+
case BRIDGE_DISPLAY_LINKED_OPTION:
|
|
14175
|
+
this.onDisplayLinkedOption(event.data.linkedOptionId);
|
|
14176
|
+
break;
|
|
14177
|
+
case BRIDGE_WAZO_CONTACT_SEARCH:
|
|
14178
|
+
this.onWazoContactSearch(event.data.query);
|
|
14179
|
+
break;
|
|
14180
|
+
case BRIDGE_ON_AGENT_LOGGED_IN:
|
|
14181
|
+
this.onAgentLoggedIn();
|
|
14182
|
+
break;
|
|
14183
|
+
case BRIDGE_ON_AGENT_LOGGED_OUT:
|
|
14184
|
+
this.onAgentLoggedOut();
|
|
14185
|
+
break;
|
|
14186
|
+
case BRIDGE_ON_AGENT_PAUSED:
|
|
14187
|
+
this.onAgentPaused();
|
|
14188
|
+
break;
|
|
14189
|
+
case BRIDGE_ON_AGENT_RESUMED:
|
|
14190
|
+
this.onAgentResumed();
|
|
14191
|
+
break;
|
|
14192
|
+
case BRIDGE_ON_LANGUAGE_CHANGED:
|
|
14193
|
+
this.onLanguageChanged(event.data.language);
|
|
14194
|
+
break;
|
|
14195
|
+
case BRIDGE_ON_CALL_HELD:
|
|
14196
|
+
this.onCallHeld();
|
|
14197
|
+
break;
|
|
14198
|
+
case BRIDGE_ON_CALL_RESUMED:
|
|
14199
|
+
this.onCallResumed();
|
|
14200
|
+
break;
|
|
14201
|
+
case BRIDGE_ON_CALL_MUTED:
|
|
14202
|
+
this.onCallMuted();
|
|
14203
|
+
break;
|
|
14204
|
+
case BRIDGE_ON_CALL_UN_MUTED:
|
|
14205
|
+
this.onCallUnMuted();
|
|
14206
|
+
break;
|
|
14207
|
+
case BRIDGE_ON_DTMF:
|
|
14208
|
+
this.onDtmfSent(event.data.tone);
|
|
14209
|
+
break;
|
|
14210
|
+
case BRIDGE_ON_DIRECT_TRANSFER:
|
|
14211
|
+
this.onDirectTransfer(event.data.number);
|
|
14212
|
+
break;
|
|
14213
|
+
case BRIDGE_ON_CREATE_INDIRECT_TRANSFER:
|
|
14214
|
+
this.onCreateIndirectTransfer(event.data.number);
|
|
14215
|
+
break;
|
|
14216
|
+
case BRIDGE_ON_CANCEL_INDIRECT_TRANSFER:
|
|
14217
|
+
this.onCancelIndirectTransfer();
|
|
14218
|
+
break;
|
|
14219
|
+
case BRIDGE_ON_CONFIRM_INDIRECT_TRANSFER:
|
|
14220
|
+
this.onConfirmIndirectTransfer();
|
|
14221
|
+
break;
|
|
14222
|
+
case BRIDGE_ON_INDIRECT_TRANSFER_CALL_MADE:
|
|
14223
|
+
this.onIndirectCallMade(event.data.call);
|
|
14224
|
+
break;
|
|
14225
|
+
case BRIDGE_ON_INDIRECT_TRANSFER_DONE:
|
|
14226
|
+
this.onIndirectTransferDone(event.data.call);
|
|
14227
|
+
break;
|
|
14228
|
+
case BRIDGE_ON_START_RECORDING:
|
|
14229
|
+
this.onStartRecording();
|
|
14230
|
+
break;
|
|
14231
|
+
case BRIDGE_ON_STOP_RECORDING:
|
|
14232
|
+
this.onStopRecording();
|
|
14233
|
+
break;
|
|
14234
|
+
default:
|
|
14235
|
+
this.onUnHandledEvent(event);
|
|
14236
|
+
break;
|
|
14237
|
+
}
|
|
14238
|
+
}
|
|
14239
|
+
|
|
14240
|
+
_sendMessage(type , payload = {}) {
|
|
14241
|
+
if (!this.iframe) {
|
|
14242
|
+
console.warn(`Could not send message of type ${type} to the Wazo Softphone, iframe not created yet`);
|
|
14243
|
+
return;
|
|
14244
|
+
}
|
|
14245
|
+
|
|
14246
|
+
this.iframe.contentWindow.postMessage({ type, ...payload }, '*');
|
|
14247
|
+
}
|
|
14248
|
+
}
|
|
14249
|
+
|
|
14250
|
+
var Softphone$1 = new Softphone();
|
|
14251
|
+
|
|
13917
14252
|
/* global window */
|
|
13918
14253
|
|
|
13919
14254
|
const Wazo = {
|
|
@@ -13934,6 +14269,7 @@ const Wazo = {
|
|
|
13934
14269
|
loggerFor: IssueReporter$1.loggerFor.bind(IssueReporter$1),
|
|
13935
14270
|
Features: Features$1,
|
|
13936
14271
|
Checker,
|
|
14272
|
+
Softphone: Softphone$1,
|
|
13937
14273
|
|
|
13938
14274
|
// Domain
|
|
13939
14275
|
domain: {
|