@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
package/esm/simple/index.js
CHANGED
|
@@ -1909,13 +1909,9 @@ class IssueReporter {
|
|
|
1909
1909
|
|
|
1910
1910
|
setTimeout(() => {
|
|
1911
1911
|
if (isArray) {
|
|
1912
|
-
payload = payload.map(message =>
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
});
|
|
1916
|
-
} else {
|
|
1917
|
-
// $FlowFixMe
|
|
1918
|
-
payload._retry = retry + 1;
|
|
1912
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
1913
|
+
} else if (payload && typeof payload === 'object') {
|
|
1914
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
1919
1915
|
}
|
|
1920
1916
|
|
|
1921
1917
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -1923,6 +1919,15 @@ class IssueReporter {
|
|
|
1923
1919
|
});
|
|
1924
1920
|
}
|
|
1925
1921
|
|
|
1922
|
+
_writeRetryCount(message , count ) {
|
|
1923
|
+
if (message && typeof message === 'object') {
|
|
1924
|
+
// $FlowFixMe
|
|
1925
|
+
message._retry = count;
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
return message;
|
|
1929
|
+
}
|
|
1930
|
+
|
|
1926
1931
|
_isLevelAbove(level1 , level2 ) {
|
|
1927
1932
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
1928
1933
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -7475,8 +7480,10 @@ class WebRTCClient extends Emitter {
|
|
|
7475
7480
|
conference: isConference,
|
|
7476
7481
|
};
|
|
7477
7482
|
|
|
7478
|
-
// Avoid sdh to
|
|
7479
|
-
session.sessionDescriptionHandler
|
|
7483
|
+
// Avoid sdh to create a new stream
|
|
7484
|
+
if (session.sessionDescriptionHandler) {
|
|
7485
|
+
session.sessionDescriptionHandler.localMediaStreamConstraints = options.constraints;
|
|
7486
|
+
}
|
|
7480
7487
|
|
|
7481
7488
|
// Send re-INVITE
|
|
7482
7489
|
return session.invite(options);
|
|
@@ -8319,7 +8326,7 @@ class WebRTCClient extends Emitter {
|
|
|
8319
8326
|
}
|
|
8320
8327
|
|
|
8321
8328
|
async _onHeartbeatTimeout() {
|
|
8322
|
-
logger$8.
|
|
8329
|
+
logger$8.warn('sdk webrtc heartbeat timed out', { userAgent: !!this.userAgent, cb: !!this.heartbeatTimeoutCb });
|
|
8323
8330
|
|
|
8324
8331
|
if (this.heartbeatTimeoutCb) {
|
|
8325
8332
|
this.heartbeatTimeoutCb();
|
|
@@ -11487,7 +11494,7 @@ class WebSocketClient extends Emitter {
|
|
|
11487
11494
|
this.close();
|
|
11488
11495
|
}
|
|
11489
11496
|
const url = `wss://${this.host || ''}/api/websocketd/?token=${this.token || ''}&version=${this.version}`;
|
|
11490
|
-
logger$5.
|
|
11497
|
+
logger$5.info('Wazo WS url computed to reconnect', { url });
|
|
11491
11498
|
|
|
11492
11499
|
return url;
|
|
11493
11500
|
}
|
|
@@ -13962,6 +13969,334 @@ class Checker {
|
|
|
13962
13969
|
}
|
|
13963
13970
|
}
|
|
13964
13971
|
|
|
13972
|
+
//
|
|
13973
|
+
/* eslint-disable no-unused-vars */
|
|
13974
|
+
/* global window, document */
|
|
13975
|
+
const BRIDGE_CONFIG_RETRIEVED = 'bridge/CONFIG_RETRIEVED';
|
|
13976
|
+
const BRIDGE_ENABLE_CARD = 'bridge/ENABLE_CARD';
|
|
13977
|
+
const BRIDGE_CHANGE_REQUIRED_SUBSCRIPTION_TYPE = 'bridge/CHANGE_REQUIRED_SUBSCRIPTION_TYPE';
|
|
13978
|
+
const BRIDGE_CREATE_OR_UPDATE_CARD = 'bridge/BRIDGE_CREATE_OR_UPDATE_CARD';
|
|
13979
|
+
const BRIDGE_OPTIONS_FETCHED = 'bridge/BRIDGE_OPTIONS_FETCHED';
|
|
13980
|
+
const BRIDGE_OPTIONS_FOUND = 'bridge/BRIDGE_OPTIONS_FOUND';
|
|
13981
|
+
const BRIDGE_SEARCH_OPTIONS = 'bridge/BRIDGE_SEARCH_OPTIONS';
|
|
13982
|
+
const BRIDGE_DISPLAY_LINKED_OPTION = 'bridge/DISPLAY_LINKED_OPTION';
|
|
13983
|
+
const BRIDGE_UPDATE_FORM_SCHEMA = 'bridge/BRIDGE_UPDATE_FORM_SCHEMA';
|
|
13984
|
+
const BRIDGE_WAZO_CONTACT_SEARCH = 'bridge/BRIDGE_WAZO_CONTACT_SEARCH';
|
|
13985
|
+
const BRIDGE_ON_AGENT_LOGGED_IN = 'bridge/BRIDGE_ON_AGENT_LOGGED_IN';
|
|
13986
|
+
const BRIDGE_ON_AGENT_LOGGED_OUT = 'bridge/BRIDGE_ON_AGENT_LOGGED_OUT';
|
|
13987
|
+
const BRIDGE_ON_AGENT_PAUSED = 'bridge/BRIDGE_ON_AGENT_PAUSED';
|
|
13988
|
+
const BRIDGE_ON_AGENT_RESUMED = 'bridge/BRIDGE_ON_AGENT_RESUMED';
|
|
13989
|
+
const BRIDGE_ON_LANGUAGE_CHANGED = 'bridge/BRIDGE_ON_LANGUAGE_CHANGED';
|
|
13990
|
+
const BRIDGE_ON_CALL_HELD = 'bridge/BRIDGE_ON_CALL_HELD';
|
|
13991
|
+
const BRIDGE_ON_CALL_RESUMED = 'bridge/BRIDGE_ON_CALL_RESUMED';
|
|
13992
|
+
const BRIDGE_ON_CALL_MUTED = 'bridge/BRIDGE_ON_CALL_MUTED';
|
|
13993
|
+
const BRIDGE_ON_CALL_UN_MUTED = 'bridge/BRIDGE_ON_CALL_UN_MUTED';
|
|
13994
|
+
const BRIDGE_ON_DTMF = 'bridge/BRIDGE_ON_DTMF';
|
|
13995
|
+
const BRIDGE_ON_DIRECT_TRANSFER = 'bridge/BRIDGE_ON_DIRECT_TRANSFER';
|
|
13996
|
+
const BRIDGE_ON_CREATE_INDIRECT_TRANSFER = 'bridge/BRIDGE_ON_CREATE_INDIRECT_TRANSFER';
|
|
13997
|
+
const BRIDGE_ON_CANCEL_INDIRECT_TRANSFER = 'bridge/BRIDGE_ON_CANCEL_INDIRECT_TRANSFER';
|
|
13998
|
+
const BRIDGE_ON_CONFIRM_INDIRECT_TRANSFER = 'bridge/BRIDGE_ON_CONFIRM_INDIRECT_TRANSFER';
|
|
13999
|
+
const BRIDGE_ON_INDIRECT_TRANSFER_CALL_MADE = 'bridge/BRIDGE_ON_INDIRECT_TRANSFER_CALL_MADE';
|
|
14000
|
+
const BRIDGE_ON_INDIRECT_TRANSFER_DONE = 'bridge/BRIDGE_ON_INDIRECT_TRANSFER_DONE';
|
|
14001
|
+
const BRIDGE_ON_START_RECORDING = 'bridge/BRIDGE_ON_START_RECORDING';
|
|
14002
|
+
const BRIDGE_ON_STOP_RECORDING = 'bridge/BRIDGE_ON_STOP_RECORDING';
|
|
14003
|
+
|
|
14004
|
+
const SDK_CLICK_TO_CALL = 'sdk/CLICK_TO_CALL';
|
|
14005
|
+
const SDK_ON_CALL_MADE = 'sdk/SDK_ON_CALL_MADE';
|
|
14006
|
+
const SDK_CALL_ENDED = 'sdk/ON_CALL_ENDED';
|
|
14007
|
+
const SDK_CALL_INCOMING = 'sdk/SDK_CALL_INCOMING';
|
|
14008
|
+
const SDK_AUTHENTICATED = 'sdk/SDK_AUTHENTICATED';
|
|
14009
|
+
const SDK_LOGGED_OUT = 'sdk/SDK_LOGGED_OUT';
|
|
14010
|
+
|
|
14011
|
+
class Softphone {
|
|
14012
|
+
url = 'https://softphone.wazo.io';
|
|
14013
|
+
width = 500;
|
|
14014
|
+
height = 600;
|
|
14015
|
+
displayed = false;
|
|
14016
|
+
iframe = null;
|
|
14017
|
+
|
|
14018
|
+
onLinkEnabled(link ) {}
|
|
14019
|
+
onIFrameLoaded() {}
|
|
14020
|
+
|
|
14021
|
+
onCallMade(call ) {}
|
|
14022
|
+
onCallIncoming(call ) {}
|
|
14023
|
+
onCallEnded(call , card , direction , fromExtension ) {}
|
|
14024
|
+
onCardSaved(card ) {}
|
|
14025
|
+
onAuthenticated(session ) {}
|
|
14026
|
+
onLoggedOut() {}
|
|
14027
|
+
onSearchOptions(fieldId , query ) {}
|
|
14028
|
+
onDisplayLinkedOption(optionId ) {}
|
|
14029
|
+
onWazoContactSearch(query ) {}
|
|
14030
|
+
onAgentLoggedIn() {}
|
|
14031
|
+
onAgentLoggedOut() {}
|
|
14032
|
+
onAgentPaused() {}
|
|
14033
|
+
onAgentResumed() {}
|
|
14034
|
+
onLanguageChanged(language ) {}
|
|
14035
|
+
onCallHeld() {}
|
|
14036
|
+
onCallResumed() {}
|
|
14037
|
+
onCallMuted() {}
|
|
14038
|
+
onCallUnMuted() {}
|
|
14039
|
+
onDtmfSent(tone ) {}
|
|
14040
|
+
onDirectTransfer(number ) {}
|
|
14041
|
+
onCreateIndirectTransfer(number ) {}
|
|
14042
|
+
onCancelIndirectTransfer() {}
|
|
14043
|
+
onConfirmIndirectTransfer() {}
|
|
14044
|
+
onIndirectCallMade(call ) {}
|
|
14045
|
+
onIndirectTransferDone(call ) {}
|
|
14046
|
+
onStartRecording() {}
|
|
14047
|
+
onStopRecording() {}
|
|
14048
|
+
onUnHandledEvent(event ) {}
|
|
14049
|
+
|
|
14050
|
+
init({ url, width, height, server, port, language, wrapUpDuration, shouldDisplayLinkedEntities,
|
|
14051
|
+
allowContactCreation, withCard, subscriptionType, enableAgent } = {}) {
|
|
14052
|
+
if (url) {
|
|
14053
|
+
this.url = url;
|
|
14054
|
+
}
|
|
14055
|
+
if (width) {
|
|
14056
|
+
this.width = width;
|
|
14057
|
+
}
|
|
14058
|
+
if (height) {
|
|
14059
|
+
this.height = height;
|
|
14060
|
+
}
|
|
14061
|
+
|
|
14062
|
+
window.addEventListener('message', this._onMessage.bind(this), false);
|
|
14063
|
+
|
|
14064
|
+
if (!server) {
|
|
14065
|
+
// eslint-disable-next-line no-param-reassign
|
|
14066
|
+
server = 'stack.dev.wazo.io';
|
|
14067
|
+
}
|
|
14068
|
+
|
|
14069
|
+
this._createIframe(() => {
|
|
14070
|
+
this._sendMessage(BRIDGE_CONFIG_RETRIEVED, {
|
|
14071
|
+
config: {
|
|
14072
|
+
server,
|
|
14073
|
+
port,
|
|
14074
|
+
language,
|
|
14075
|
+
wrapUpDuration,
|
|
14076
|
+
shouldDisplayLinkedEntities,
|
|
14077
|
+
allowContactCreation,
|
|
14078
|
+
},
|
|
14079
|
+
});
|
|
14080
|
+
|
|
14081
|
+
if (withCard) {
|
|
14082
|
+
this._sendMessage(BRIDGE_ENABLE_CARD);
|
|
14083
|
+
}
|
|
14084
|
+
|
|
14085
|
+
if (subscriptionType) {
|
|
14086
|
+
this._sendMessage(BRIDGE_CHANGE_REQUIRED_SUBSCRIPTION_TYPE, { subscriptionType });
|
|
14087
|
+
}
|
|
14088
|
+
|
|
14089
|
+
this.onIFrameLoaded();
|
|
14090
|
+
});
|
|
14091
|
+
}
|
|
14092
|
+
|
|
14093
|
+
parseLinks() {
|
|
14094
|
+
const links = this._getLinks();
|
|
14095
|
+
|
|
14096
|
+
links.forEach(link => {
|
|
14097
|
+
link.setAttribute('data-wazo-parsed', true);
|
|
14098
|
+
link.addEventListener('click', this._onLinkClick.bind(this));
|
|
14099
|
+
this.onLinkEnabled(link);
|
|
14100
|
+
});
|
|
14101
|
+
}
|
|
14102
|
+
|
|
14103
|
+
makeCall(number ) {
|
|
14104
|
+
this.displaySoftphone();
|
|
14105
|
+
|
|
14106
|
+
this._sendMessage(SDK_CLICK_TO_CALL, { number });
|
|
14107
|
+
}
|
|
14108
|
+
|
|
14109
|
+
toggleSoftphoneDisplay() {
|
|
14110
|
+
if (this.displayed) {
|
|
14111
|
+
this.hideSoftphone();
|
|
14112
|
+
} else {
|
|
14113
|
+
this.displaySoftphone();
|
|
14114
|
+
}
|
|
14115
|
+
}
|
|
14116
|
+
|
|
14117
|
+
displaySoftphone() {
|
|
14118
|
+
if (!this.iframe) {
|
|
14119
|
+
this._createIframe();
|
|
14120
|
+
}
|
|
14121
|
+
|
|
14122
|
+
if (this.iframe) {
|
|
14123
|
+
this.iframe.style.display = 'block';
|
|
14124
|
+
}
|
|
14125
|
+
|
|
14126
|
+
this.displayed = true;
|
|
14127
|
+
}
|
|
14128
|
+
|
|
14129
|
+
hideSoftphone() {
|
|
14130
|
+
if (this.iframe) {
|
|
14131
|
+
this.iframe.style.display = 'none';
|
|
14132
|
+
}
|
|
14133
|
+
this.displayed = false;
|
|
14134
|
+
}
|
|
14135
|
+
|
|
14136
|
+
optionsFetched(fieldId , options ) {
|
|
14137
|
+
this._sendMessage(BRIDGE_OPTIONS_FETCHED, { fieldId, options });
|
|
14138
|
+
}
|
|
14139
|
+
|
|
14140
|
+
onOptionsResults(fieldId , options ) {
|
|
14141
|
+
this._sendMessage(BRIDGE_OPTIONS_FOUND, { fieldId, options });
|
|
14142
|
+
}
|
|
14143
|
+
|
|
14144
|
+
setFormSchema(schema , uiSchema ) {
|
|
14145
|
+
this._sendMessage(BRIDGE_UPDATE_FORM_SCHEMA, { schema, uiSchema });
|
|
14146
|
+
}
|
|
14147
|
+
|
|
14148
|
+
_createIframe(cb = () => {}) {
|
|
14149
|
+
this.iframe = document.createElement('iframe');
|
|
14150
|
+
// $FlowFixMe
|
|
14151
|
+
this.iframe.width = this.width;
|
|
14152
|
+
// $FlowFixMe
|
|
14153
|
+
this.iframe.height = this.height;
|
|
14154
|
+
// $FlowFixMe
|
|
14155
|
+
this.iframe.allow = 'camera *; microphone *; autoplay *; display-capture *';
|
|
14156
|
+
this.iframe.style.position = 'absolute';
|
|
14157
|
+
this.iframe.style.left = '0';
|
|
14158
|
+
this.iframe.style.bottom = '0';
|
|
14159
|
+
this.iframe.style.border = '1px solid #aaa';
|
|
14160
|
+
this.iframe.style.backgroundColor = 'white';
|
|
14161
|
+
this.iframe.src = this.url;
|
|
14162
|
+
this.iframe.style.display = 'none';
|
|
14163
|
+
this.iframe.id = 'wazo-softphone';
|
|
14164
|
+
|
|
14165
|
+
this.iframe.onload = cb;
|
|
14166
|
+
|
|
14167
|
+
// $FlowFixMe
|
|
14168
|
+
document.body.appendChild(this.iframe);
|
|
14169
|
+
}
|
|
14170
|
+
|
|
14171
|
+
_getLinks() {
|
|
14172
|
+
return [].slice.call(document.querySelectorAll('a:not([data-wazo-parsed])'), 0)
|
|
14173
|
+
.filter(link => link.href.indexOf('tel:') === 0 || link.href.indexOf('callto:') === 0);
|
|
14174
|
+
}
|
|
14175
|
+
|
|
14176
|
+
_onLinkClick(e ) {
|
|
14177
|
+
e.preventDefault();
|
|
14178
|
+
const number = e.target.href.split(':')[1];
|
|
14179
|
+
|
|
14180
|
+
this.makeCall(number);
|
|
14181
|
+
}
|
|
14182
|
+
|
|
14183
|
+
_onAuthenticated() {
|
|
14184
|
+
this.parseLinks();
|
|
14185
|
+
}
|
|
14186
|
+
|
|
14187
|
+
_onMessage(event ) {
|
|
14188
|
+
if (!event.data) {
|
|
14189
|
+
return;
|
|
14190
|
+
}
|
|
14191
|
+
|
|
14192
|
+
switch (event.data.type) {
|
|
14193
|
+
case SDK_ON_CALL_MADE:
|
|
14194
|
+
this.onCallMade(event.data.callSession);
|
|
14195
|
+
break;
|
|
14196
|
+
case SDK_CALL_ENDED: {
|
|
14197
|
+
const { callSession, content, direction, userExtension } = event.data;
|
|
14198
|
+
this.onCallEnded(callSession, content, direction, userExtension);
|
|
14199
|
+
break;
|
|
14200
|
+
}
|
|
14201
|
+
case SDK_CALL_INCOMING:
|
|
14202
|
+
this.onCallIncoming(event.data.callSession);
|
|
14203
|
+
break;
|
|
14204
|
+
case SDK_AUTHENTICATED:
|
|
14205
|
+
// $FlowFixMe
|
|
14206
|
+
this._onAuthenticated(event.data.session);
|
|
14207
|
+
this.onAuthenticated(event.data.session);
|
|
14208
|
+
break;
|
|
14209
|
+
case SDK_LOGGED_OUT:
|
|
14210
|
+
this.onLoggedOut();
|
|
14211
|
+
break;
|
|
14212
|
+
case BRIDGE_CREATE_OR_UPDATE_CARD: {
|
|
14213
|
+
const { content } = event.data;
|
|
14214
|
+
this.onCardSaved(content);
|
|
14215
|
+
break;
|
|
14216
|
+
}
|
|
14217
|
+
case BRIDGE_SEARCH_OPTIONS: {
|
|
14218
|
+
const { fieldId, query } = event.data;
|
|
14219
|
+
this.onSearchOptions(fieldId, query);
|
|
14220
|
+
break;
|
|
14221
|
+
}
|
|
14222
|
+
case BRIDGE_DISPLAY_LINKED_OPTION:
|
|
14223
|
+
this.onDisplayLinkedOption(event.data.linkedOptionId);
|
|
14224
|
+
break;
|
|
14225
|
+
case BRIDGE_WAZO_CONTACT_SEARCH:
|
|
14226
|
+
this.onWazoContactSearch(event.data.query);
|
|
14227
|
+
break;
|
|
14228
|
+
case BRIDGE_ON_AGENT_LOGGED_IN:
|
|
14229
|
+
this.onAgentLoggedIn();
|
|
14230
|
+
break;
|
|
14231
|
+
case BRIDGE_ON_AGENT_LOGGED_OUT:
|
|
14232
|
+
this.onAgentLoggedOut();
|
|
14233
|
+
break;
|
|
14234
|
+
case BRIDGE_ON_AGENT_PAUSED:
|
|
14235
|
+
this.onAgentPaused();
|
|
14236
|
+
break;
|
|
14237
|
+
case BRIDGE_ON_AGENT_RESUMED:
|
|
14238
|
+
this.onAgentResumed();
|
|
14239
|
+
break;
|
|
14240
|
+
case BRIDGE_ON_LANGUAGE_CHANGED:
|
|
14241
|
+
this.onLanguageChanged(event.data.language);
|
|
14242
|
+
break;
|
|
14243
|
+
case BRIDGE_ON_CALL_HELD:
|
|
14244
|
+
this.onCallHeld();
|
|
14245
|
+
break;
|
|
14246
|
+
case BRIDGE_ON_CALL_RESUMED:
|
|
14247
|
+
this.onCallResumed();
|
|
14248
|
+
break;
|
|
14249
|
+
case BRIDGE_ON_CALL_MUTED:
|
|
14250
|
+
this.onCallMuted();
|
|
14251
|
+
break;
|
|
14252
|
+
case BRIDGE_ON_CALL_UN_MUTED:
|
|
14253
|
+
this.onCallUnMuted();
|
|
14254
|
+
break;
|
|
14255
|
+
case BRIDGE_ON_DTMF:
|
|
14256
|
+
this.onDtmfSent(event.data.tone);
|
|
14257
|
+
break;
|
|
14258
|
+
case BRIDGE_ON_DIRECT_TRANSFER:
|
|
14259
|
+
this.onDirectTransfer(event.data.number);
|
|
14260
|
+
break;
|
|
14261
|
+
case BRIDGE_ON_CREATE_INDIRECT_TRANSFER:
|
|
14262
|
+
this.onCreateIndirectTransfer(event.data.number);
|
|
14263
|
+
break;
|
|
14264
|
+
case BRIDGE_ON_CANCEL_INDIRECT_TRANSFER:
|
|
14265
|
+
this.onCancelIndirectTransfer();
|
|
14266
|
+
break;
|
|
14267
|
+
case BRIDGE_ON_CONFIRM_INDIRECT_TRANSFER:
|
|
14268
|
+
this.onConfirmIndirectTransfer();
|
|
14269
|
+
break;
|
|
14270
|
+
case BRIDGE_ON_INDIRECT_TRANSFER_CALL_MADE:
|
|
14271
|
+
this.onIndirectCallMade(event.data.call);
|
|
14272
|
+
break;
|
|
14273
|
+
case BRIDGE_ON_INDIRECT_TRANSFER_DONE:
|
|
14274
|
+
this.onIndirectTransferDone(event.data.call);
|
|
14275
|
+
break;
|
|
14276
|
+
case BRIDGE_ON_START_RECORDING:
|
|
14277
|
+
this.onStartRecording();
|
|
14278
|
+
break;
|
|
14279
|
+
case BRIDGE_ON_STOP_RECORDING:
|
|
14280
|
+
this.onStopRecording();
|
|
14281
|
+
break;
|
|
14282
|
+
default:
|
|
14283
|
+
this.onUnHandledEvent(event);
|
|
14284
|
+
break;
|
|
14285
|
+
}
|
|
14286
|
+
}
|
|
14287
|
+
|
|
14288
|
+
_sendMessage(type , payload = {}) {
|
|
14289
|
+
if (!this.iframe) {
|
|
14290
|
+
console.warn(`Could not send message of type ${type} to the Wazo Softphone, iframe not created yet`);
|
|
14291
|
+
return;
|
|
14292
|
+
}
|
|
14293
|
+
|
|
14294
|
+
this.iframe.contentWindow.postMessage({ type, ...payload }, '*');
|
|
14295
|
+
}
|
|
14296
|
+
}
|
|
14297
|
+
|
|
14298
|
+
var Softphone$1 = new Softphone();
|
|
14299
|
+
|
|
13965
14300
|
/* global window */
|
|
13966
14301
|
|
|
13967
14302
|
const Wazo = {
|
|
@@ -13982,6 +14317,7 @@ const Wazo = {
|
|
|
13982
14317
|
loggerFor: IssueReporter$1.loggerFor.bind(IssueReporter$1),
|
|
13983
14318
|
Features: Features$1,
|
|
13984
14319
|
Checker,
|
|
14320
|
+
Softphone: Softphone$1,
|
|
13985
14321
|
|
|
13986
14322
|
// Domain
|
|
13987
14323
|
domain: {
|