@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
|
@@ -706,13 +706,9 @@ class IssueReporter {
|
|
|
706
706
|
|
|
707
707
|
setTimeout(() => {
|
|
708
708
|
if (isArray) {
|
|
709
|
-
payload = payload.map(message =>
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
});
|
|
713
|
-
} else {
|
|
714
|
-
// $FlowFixMe
|
|
715
|
-
payload._retry = retry + 1;
|
|
709
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
710
|
+
} else if (payload && typeof payload === 'object') {
|
|
711
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
716
712
|
}
|
|
717
713
|
|
|
718
714
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -720,6 +716,15 @@ class IssueReporter {
|
|
|
720
716
|
});
|
|
721
717
|
}
|
|
722
718
|
|
|
719
|
+
_writeRetryCount(message , count ) {
|
|
720
|
+
if (message && typeof message === 'object') {
|
|
721
|
+
// $FlowFixMe
|
|
722
|
+
message._retry = count;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
return message;
|
|
726
|
+
}
|
|
727
|
+
|
|
723
728
|
_isLevelAbove(level1 , level2 ) {
|
|
724
729
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
725
730
|
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
|
}
|
|
@@ -12831,6 +12838,334 @@ class Checker {
|
|
|
12831
12838
|
}
|
|
12832
12839
|
}
|
|
12833
12840
|
|
|
12841
|
+
//
|
|
12842
|
+
/* eslint-disable no-unused-vars */
|
|
12843
|
+
/* global window, document */
|
|
12844
|
+
const BRIDGE_CONFIG_RETRIEVED = 'bridge/CONFIG_RETRIEVED';
|
|
12845
|
+
const BRIDGE_ENABLE_CARD = 'bridge/ENABLE_CARD';
|
|
12846
|
+
const BRIDGE_CHANGE_REQUIRED_SUBSCRIPTION_TYPE = 'bridge/CHANGE_REQUIRED_SUBSCRIPTION_TYPE';
|
|
12847
|
+
const BRIDGE_CREATE_OR_UPDATE_CARD = 'bridge/BRIDGE_CREATE_OR_UPDATE_CARD';
|
|
12848
|
+
const BRIDGE_OPTIONS_FETCHED = 'bridge/BRIDGE_OPTIONS_FETCHED';
|
|
12849
|
+
const BRIDGE_OPTIONS_FOUND = 'bridge/BRIDGE_OPTIONS_FOUND';
|
|
12850
|
+
const BRIDGE_SEARCH_OPTIONS = 'bridge/BRIDGE_SEARCH_OPTIONS';
|
|
12851
|
+
const BRIDGE_DISPLAY_LINKED_OPTION = 'bridge/DISPLAY_LINKED_OPTION';
|
|
12852
|
+
const BRIDGE_UPDATE_FORM_SCHEMA = 'bridge/BRIDGE_UPDATE_FORM_SCHEMA';
|
|
12853
|
+
const BRIDGE_WAZO_CONTACT_SEARCH = 'bridge/BRIDGE_WAZO_CONTACT_SEARCH';
|
|
12854
|
+
const BRIDGE_ON_AGENT_LOGGED_IN = 'bridge/BRIDGE_ON_AGENT_LOGGED_IN';
|
|
12855
|
+
const BRIDGE_ON_AGENT_LOGGED_OUT = 'bridge/BRIDGE_ON_AGENT_LOGGED_OUT';
|
|
12856
|
+
const BRIDGE_ON_AGENT_PAUSED = 'bridge/BRIDGE_ON_AGENT_PAUSED';
|
|
12857
|
+
const BRIDGE_ON_AGENT_RESUMED = 'bridge/BRIDGE_ON_AGENT_RESUMED';
|
|
12858
|
+
const BRIDGE_ON_LANGUAGE_CHANGED = 'bridge/BRIDGE_ON_LANGUAGE_CHANGED';
|
|
12859
|
+
const BRIDGE_ON_CALL_HELD = 'bridge/BRIDGE_ON_CALL_HELD';
|
|
12860
|
+
const BRIDGE_ON_CALL_RESUMED = 'bridge/BRIDGE_ON_CALL_RESUMED';
|
|
12861
|
+
const BRIDGE_ON_CALL_MUTED = 'bridge/BRIDGE_ON_CALL_MUTED';
|
|
12862
|
+
const BRIDGE_ON_CALL_UN_MUTED = 'bridge/BRIDGE_ON_CALL_UN_MUTED';
|
|
12863
|
+
const BRIDGE_ON_DTMF = 'bridge/BRIDGE_ON_DTMF';
|
|
12864
|
+
const BRIDGE_ON_DIRECT_TRANSFER = 'bridge/BRIDGE_ON_DIRECT_TRANSFER';
|
|
12865
|
+
const BRIDGE_ON_CREATE_INDIRECT_TRANSFER = 'bridge/BRIDGE_ON_CREATE_INDIRECT_TRANSFER';
|
|
12866
|
+
const BRIDGE_ON_CANCEL_INDIRECT_TRANSFER = 'bridge/BRIDGE_ON_CANCEL_INDIRECT_TRANSFER';
|
|
12867
|
+
const BRIDGE_ON_CONFIRM_INDIRECT_TRANSFER = 'bridge/BRIDGE_ON_CONFIRM_INDIRECT_TRANSFER';
|
|
12868
|
+
const BRIDGE_ON_INDIRECT_TRANSFER_CALL_MADE = 'bridge/BRIDGE_ON_INDIRECT_TRANSFER_CALL_MADE';
|
|
12869
|
+
const BRIDGE_ON_INDIRECT_TRANSFER_DONE = 'bridge/BRIDGE_ON_INDIRECT_TRANSFER_DONE';
|
|
12870
|
+
const BRIDGE_ON_START_RECORDING = 'bridge/BRIDGE_ON_START_RECORDING';
|
|
12871
|
+
const BRIDGE_ON_STOP_RECORDING = 'bridge/BRIDGE_ON_STOP_RECORDING';
|
|
12872
|
+
|
|
12873
|
+
const SDK_CLICK_TO_CALL = 'sdk/CLICK_TO_CALL';
|
|
12874
|
+
const SDK_ON_CALL_MADE = 'sdk/SDK_ON_CALL_MADE';
|
|
12875
|
+
const SDK_CALL_ENDED = 'sdk/ON_CALL_ENDED';
|
|
12876
|
+
const SDK_CALL_INCOMING = 'sdk/SDK_CALL_INCOMING';
|
|
12877
|
+
const SDK_AUTHENTICATED = 'sdk/SDK_AUTHENTICATED';
|
|
12878
|
+
const SDK_LOGGED_OUT = 'sdk/SDK_LOGGED_OUT';
|
|
12879
|
+
|
|
12880
|
+
class Softphone {
|
|
12881
|
+
url = 'https://softphone.wazo.io';
|
|
12882
|
+
width = 500;
|
|
12883
|
+
height = 600;
|
|
12884
|
+
displayed = false;
|
|
12885
|
+
iframe = null;
|
|
12886
|
+
|
|
12887
|
+
onLinkEnabled(link ) {}
|
|
12888
|
+
onIFrameLoaded() {}
|
|
12889
|
+
|
|
12890
|
+
onCallMade(call ) {}
|
|
12891
|
+
onCallIncoming(call ) {}
|
|
12892
|
+
onCallEnded(call , card , direction , fromExtension ) {}
|
|
12893
|
+
onCardSaved(card ) {}
|
|
12894
|
+
onAuthenticated(session ) {}
|
|
12895
|
+
onLoggedOut() {}
|
|
12896
|
+
onSearchOptions(fieldId , query ) {}
|
|
12897
|
+
onDisplayLinkedOption(optionId ) {}
|
|
12898
|
+
onWazoContactSearch(query ) {}
|
|
12899
|
+
onAgentLoggedIn() {}
|
|
12900
|
+
onAgentLoggedOut() {}
|
|
12901
|
+
onAgentPaused() {}
|
|
12902
|
+
onAgentResumed() {}
|
|
12903
|
+
onLanguageChanged(language ) {}
|
|
12904
|
+
onCallHeld() {}
|
|
12905
|
+
onCallResumed() {}
|
|
12906
|
+
onCallMuted() {}
|
|
12907
|
+
onCallUnMuted() {}
|
|
12908
|
+
onDtmfSent(tone ) {}
|
|
12909
|
+
onDirectTransfer(number ) {}
|
|
12910
|
+
onCreateIndirectTransfer(number ) {}
|
|
12911
|
+
onCancelIndirectTransfer() {}
|
|
12912
|
+
onConfirmIndirectTransfer() {}
|
|
12913
|
+
onIndirectCallMade(call ) {}
|
|
12914
|
+
onIndirectTransferDone(call ) {}
|
|
12915
|
+
onStartRecording() {}
|
|
12916
|
+
onStopRecording() {}
|
|
12917
|
+
onUnHandledEvent(event ) {}
|
|
12918
|
+
|
|
12919
|
+
init({ url, width, height, server, port, language, wrapUpDuration, shouldDisplayLinkedEntities,
|
|
12920
|
+
allowContactCreation, withCard, subscriptionType, enableAgent } = {}) {
|
|
12921
|
+
if (url) {
|
|
12922
|
+
this.url = url;
|
|
12923
|
+
}
|
|
12924
|
+
if (width) {
|
|
12925
|
+
this.width = width;
|
|
12926
|
+
}
|
|
12927
|
+
if (height) {
|
|
12928
|
+
this.height = height;
|
|
12929
|
+
}
|
|
12930
|
+
|
|
12931
|
+
window.addEventListener('message', this._onMessage.bind(this), false);
|
|
12932
|
+
|
|
12933
|
+
if (!server) {
|
|
12934
|
+
// eslint-disable-next-line no-param-reassign
|
|
12935
|
+
server = 'stack.dev.wazo.io';
|
|
12936
|
+
}
|
|
12937
|
+
|
|
12938
|
+
this._createIframe(() => {
|
|
12939
|
+
this._sendMessage(BRIDGE_CONFIG_RETRIEVED, {
|
|
12940
|
+
config: {
|
|
12941
|
+
server,
|
|
12942
|
+
port,
|
|
12943
|
+
language,
|
|
12944
|
+
wrapUpDuration,
|
|
12945
|
+
shouldDisplayLinkedEntities,
|
|
12946
|
+
allowContactCreation,
|
|
12947
|
+
},
|
|
12948
|
+
});
|
|
12949
|
+
|
|
12950
|
+
if (withCard) {
|
|
12951
|
+
this._sendMessage(BRIDGE_ENABLE_CARD);
|
|
12952
|
+
}
|
|
12953
|
+
|
|
12954
|
+
if (subscriptionType) {
|
|
12955
|
+
this._sendMessage(BRIDGE_CHANGE_REQUIRED_SUBSCRIPTION_TYPE, { subscriptionType });
|
|
12956
|
+
}
|
|
12957
|
+
|
|
12958
|
+
this.onIFrameLoaded();
|
|
12959
|
+
});
|
|
12960
|
+
}
|
|
12961
|
+
|
|
12962
|
+
parseLinks() {
|
|
12963
|
+
const links = this._getLinks();
|
|
12964
|
+
|
|
12965
|
+
links.forEach(link => {
|
|
12966
|
+
link.setAttribute('data-wazo-parsed', true);
|
|
12967
|
+
link.addEventListener('click', this._onLinkClick.bind(this));
|
|
12968
|
+
this.onLinkEnabled(link);
|
|
12969
|
+
});
|
|
12970
|
+
}
|
|
12971
|
+
|
|
12972
|
+
makeCall(number ) {
|
|
12973
|
+
this.displaySoftphone();
|
|
12974
|
+
|
|
12975
|
+
this._sendMessage(SDK_CLICK_TO_CALL, { number });
|
|
12976
|
+
}
|
|
12977
|
+
|
|
12978
|
+
toggleSoftphoneDisplay() {
|
|
12979
|
+
if (this.displayed) {
|
|
12980
|
+
this.hideSoftphone();
|
|
12981
|
+
} else {
|
|
12982
|
+
this.displaySoftphone();
|
|
12983
|
+
}
|
|
12984
|
+
}
|
|
12985
|
+
|
|
12986
|
+
displaySoftphone() {
|
|
12987
|
+
if (!this.iframe) {
|
|
12988
|
+
this._createIframe();
|
|
12989
|
+
}
|
|
12990
|
+
|
|
12991
|
+
if (this.iframe) {
|
|
12992
|
+
this.iframe.style.display = 'block';
|
|
12993
|
+
}
|
|
12994
|
+
|
|
12995
|
+
this.displayed = true;
|
|
12996
|
+
}
|
|
12997
|
+
|
|
12998
|
+
hideSoftphone() {
|
|
12999
|
+
if (this.iframe) {
|
|
13000
|
+
this.iframe.style.display = 'none';
|
|
13001
|
+
}
|
|
13002
|
+
this.displayed = false;
|
|
13003
|
+
}
|
|
13004
|
+
|
|
13005
|
+
optionsFetched(fieldId , options ) {
|
|
13006
|
+
this._sendMessage(BRIDGE_OPTIONS_FETCHED, { fieldId, options });
|
|
13007
|
+
}
|
|
13008
|
+
|
|
13009
|
+
onOptionsResults(fieldId , options ) {
|
|
13010
|
+
this._sendMessage(BRIDGE_OPTIONS_FOUND, { fieldId, options });
|
|
13011
|
+
}
|
|
13012
|
+
|
|
13013
|
+
setFormSchema(schema , uiSchema ) {
|
|
13014
|
+
this._sendMessage(BRIDGE_UPDATE_FORM_SCHEMA, { schema, uiSchema });
|
|
13015
|
+
}
|
|
13016
|
+
|
|
13017
|
+
_createIframe(cb = () => {}) {
|
|
13018
|
+
this.iframe = document.createElement('iframe');
|
|
13019
|
+
// $FlowFixMe
|
|
13020
|
+
this.iframe.width = this.width;
|
|
13021
|
+
// $FlowFixMe
|
|
13022
|
+
this.iframe.height = this.height;
|
|
13023
|
+
// $FlowFixMe
|
|
13024
|
+
this.iframe.allow = 'camera *; microphone *; autoplay *; display-capture *';
|
|
13025
|
+
this.iframe.style.position = 'absolute';
|
|
13026
|
+
this.iframe.style.left = '0';
|
|
13027
|
+
this.iframe.style.bottom = '0';
|
|
13028
|
+
this.iframe.style.border = '1px solid #aaa';
|
|
13029
|
+
this.iframe.style.backgroundColor = 'white';
|
|
13030
|
+
this.iframe.src = this.url;
|
|
13031
|
+
this.iframe.style.display = 'none';
|
|
13032
|
+
this.iframe.id = 'wazo-softphone';
|
|
13033
|
+
|
|
13034
|
+
this.iframe.onload = cb;
|
|
13035
|
+
|
|
13036
|
+
// $FlowFixMe
|
|
13037
|
+
document.body.appendChild(this.iframe);
|
|
13038
|
+
}
|
|
13039
|
+
|
|
13040
|
+
_getLinks() {
|
|
13041
|
+
return [].slice.call(document.querySelectorAll('a:not([data-wazo-parsed])'), 0)
|
|
13042
|
+
.filter(link => link.href.indexOf('tel:') === 0 || link.href.indexOf('callto:') === 0);
|
|
13043
|
+
}
|
|
13044
|
+
|
|
13045
|
+
_onLinkClick(e ) {
|
|
13046
|
+
e.preventDefault();
|
|
13047
|
+
const number = e.target.href.split(':')[1];
|
|
13048
|
+
|
|
13049
|
+
this.makeCall(number);
|
|
13050
|
+
}
|
|
13051
|
+
|
|
13052
|
+
_onAuthenticated() {
|
|
13053
|
+
this.parseLinks();
|
|
13054
|
+
}
|
|
13055
|
+
|
|
13056
|
+
_onMessage(event ) {
|
|
13057
|
+
if (!event.data) {
|
|
13058
|
+
return;
|
|
13059
|
+
}
|
|
13060
|
+
|
|
13061
|
+
switch (event.data.type) {
|
|
13062
|
+
case SDK_ON_CALL_MADE:
|
|
13063
|
+
this.onCallMade(event.data.callSession);
|
|
13064
|
+
break;
|
|
13065
|
+
case SDK_CALL_ENDED: {
|
|
13066
|
+
const { callSession, content, direction, userExtension } = event.data;
|
|
13067
|
+
this.onCallEnded(callSession, content, direction, userExtension);
|
|
13068
|
+
break;
|
|
13069
|
+
}
|
|
13070
|
+
case SDK_CALL_INCOMING:
|
|
13071
|
+
this.onCallIncoming(event.data.callSession);
|
|
13072
|
+
break;
|
|
13073
|
+
case SDK_AUTHENTICATED:
|
|
13074
|
+
// $FlowFixMe
|
|
13075
|
+
this._onAuthenticated(event.data.session);
|
|
13076
|
+
this.onAuthenticated(event.data.session);
|
|
13077
|
+
break;
|
|
13078
|
+
case SDK_LOGGED_OUT:
|
|
13079
|
+
this.onLoggedOut();
|
|
13080
|
+
break;
|
|
13081
|
+
case BRIDGE_CREATE_OR_UPDATE_CARD: {
|
|
13082
|
+
const { content } = event.data;
|
|
13083
|
+
this.onCardSaved(content);
|
|
13084
|
+
break;
|
|
13085
|
+
}
|
|
13086
|
+
case BRIDGE_SEARCH_OPTIONS: {
|
|
13087
|
+
const { fieldId, query } = event.data;
|
|
13088
|
+
this.onSearchOptions(fieldId, query);
|
|
13089
|
+
break;
|
|
13090
|
+
}
|
|
13091
|
+
case BRIDGE_DISPLAY_LINKED_OPTION:
|
|
13092
|
+
this.onDisplayLinkedOption(event.data.linkedOptionId);
|
|
13093
|
+
break;
|
|
13094
|
+
case BRIDGE_WAZO_CONTACT_SEARCH:
|
|
13095
|
+
this.onWazoContactSearch(event.data.query);
|
|
13096
|
+
break;
|
|
13097
|
+
case BRIDGE_ON_AGENT_LOGGED_IN:
|
|
13098
|
+
this.onAgentLoggedIn();
|
|
13099
|
+
break;
|
|
13100
|
+
case BRIDGE_ON_AGENT_LOGGED_OUT:
|
|
13101
|
+
this.onAgentLoggedOut();
|
|
13102
|
+
break;
|
|
13103
|
+
case BRIDGE_ON_AGENT_PAUSED:
|
|
13104
|
+
this.onAgentPaused();
|
|
13105
|
+
break;
|
|
13106
|
+
case BRIDGE_ON_AGENT_RESUMED:
|
|
13107
|
+
this.onAgentResumed();
|
|
13108
|
+
break;
|
|
13109
|
+
case BRIDGE_ON_LANGUAGE_CHANGED:
|
|
13110
|
+
this.onLanguageChanged(event.data.language);
|
|
13111
|
+
break;
|
|
13112
|
+
case BRIDGE_ON_CALL_HELD:
|
|
13113
|
+
this.onCallHeld();
|
|
13114
|
+
break;
|
|
13115
|
+
case BRIDGE_ON_CALL_RESUMED:
|
|
13116
|
+
this.onCallResumed();
|
|
13117
|
+
break;
|
|
13118
|
+
case BRIDGE_ON_CALL_MUTED:
|
|
13119
|
+
this.onCallMuted();
|
|
13120
|
+
break;
|
|
13121
|
+
case BRIDGE_ON_CALL_UN_MUTED:
|
|
13122
|
+
this.onCallUnMuted();
|
|
13123
|
+
break;
|
|
13124
|
+
case BRIDGE_ON_DTMF:
|
|
13125
|
+
this.onDtmfSent(event.data.tone);
|
|
13126
|
+
break;
|
|
13127
|
+
case BRIDGE_ON_DIRECT_TRANSFER:
|
|
13128
|
+
this.onDirectTransfer(event.data.number);
|
|
13129
|
+
break;
|
|
13130
|
+
case BRIDGE_ON_CREATE_INDIRECT_TRANSFER:
|
|
13131
|
+
this.onCreateIndirectTransfer(event.data.number);
|
|
13132
|
+
break;
|
|
13133
|
+
case BRIDGE_ON_CANCEL_INDIRECT_TRANSFER:
|
|
13134
|
+
this.onCancelIndirectTransfer();
|
|
13135
|
+
break;
|
|
13136
|
+
case BRIDGE_ON_CONFIRM_INDIRECT_TRANSFER:
|
|
13137
|
+
this.onConfirmIndirectTransfer();
|
|
13138
|
+
break;
|
|
13139
|
+
case BRIDGE_ON_INDIRECT_TRANSFER_CALL_MADE:
|
|
13140
|
+
this.onIndirectCallMade(event.data.call);
|
|
13141
|
+
break;
|
|
13142
|
+
case BRIDGE_ON_INDIRECT_TRANSFER_DONE:
|
|
13143
|
+
this.onIndirectTransferDone(event.data.call);
|
|
13144
|
+
break;
|
|
13145
|
+
case BRIDGE_ON_START_RECORDING:
|
|
13146
|
+
this.onStartRecording();
|
|
13147
|
+
break;
|
|
13148
|
+
case BRIDGE_ON_STOP_RECORDING:
|
|
13149
|
+
this.onStopRecording();
|
|
13150
|
+
break;
|
|
13151
|
+
default:
|
|
13152
|
+
this.onUnHandledEvent(event);
|
|
13153
|
+
break;
|
|
13154
|
+
}
|
|
13155
|
+
}
|
|
13156
|
+
|
|
13157
|
+
_sendMessage(type , payload = {}) {
|
|
13158
|
+
if (!this.iframe) {
|
|
13159
|
+
console.warn(`Could not send message of type ${type} to the Wazo Softphone, iframe not created yet`);
|
|
13160
|
+
return;
|
|
13161
|
+
}
|
|
13162
|
+
|
|
13163
|
+
this.iframe.contentWindow.postMessage({ type, ...payload }, '*');
|
|
13164
|
+
}
|
|
13165
|
+
}
|
|
13166
|
+
|
|
13167
|
+
var Softphone$1 = new Softphone();
|
|
13168
|
+
|
|
12834
13169
|
/* global window */
|
|
12835
13170
|
|
|
12836
13171
|
const Wazo = {
|
|
@@ -12851,6 +13186,7 @@ const Wazo = {
|
|
|
12851
13186
|
loggerFor: IssueReporter$1.loggerFor.bind(IssueReporter$1),
|
|
12852
13187
|
Features: Features$1,
|
|
12853
13188
|
Checker,
|
|
13189
|
+
Softphone: Softphone$1,
|
|
12854
13190
|
|
|
12855
13191
|
// Domain
|
|
12856
13192
|
domain: {
|