@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/lib/simple/Phone.js
CHANGED
|
@@ -1039,13 +1039,9 @@ class IssueReporter {
|
|
|
1039
1039
|
|
|
1040
1040
|
setTimeout(() => {
|
|
1041
1041
|
if (isArray) {
|
|
1042
|
-
payload = payload.map(message =>
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
});
|
|
1046
|
-
} else {
|
|
1047
|
-
// $FlowFixMe
|
|
1048
|
-
payload._retry = retry + 1;
|
|
1042
|
+
payload = payload.map(message => this._writeRetryCount(message, retry + 1));
|
|
1043
|
+
} else if (payload && typeof payload === 'object') {
|
|
1044
|
+
payload = this._writeRetryCount(payload, retry + 1);
|
|
1049
1045
|
}
|
|
1050
1046
|
|
|
1051
1047
|
this._sendDebugToGrafana(payload, retry + 1);
|
|
@@ -1053,6 +1049,15 @@ class IssueReporter {
|
|
|
1053
1049
|
});
|
|
1054
1050
|
}
|
|
1055
1051
|
|
|
1052
|
+
_writeRetryCount(message , count ) {
|
|
1053
|
+
if (message && typeof message === 'object') {
|
|
1054
|
+
// $FlowFixMe
|
|
1055
|
+
message._retry = count;
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
return message;
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1056
1061
|
_isLevelAbove(level1 , level2 ) {
|
|
1057
1062
|
const index1 = LOG_LEVELS.indexOf(level1);
|
|
1058
1063
|
const index2 = LOG_LEVELS.indexOf(level2);
|
|
@@ -7184,8 +7189,10 @@ class WebRTCClient extends Emitter {
|
|
|
7184
7189
|
conference: isConference,
|
|
7185
7190
|
};
|
|
7186
7191
|
|
|
7187
|
-
// Avoid sdh to
|
|
7188
|
-
session.sessionDescriptionHandler
|
|
7192
|
+
// Avoid sdh to create a new stream
|
|
7193
|
+
if (session.sessionDescriptionHandler) {
|
|
7194
|
+
session.sessionDescriptionHandler.localMediaStreamConstraints = options.constraints;
|
|
7195
|
+
}
|
|
7189
7196
|
|
|
7190
7197
|
// Send re-INVITE
|
|
7191
7198
|
return session.invite(options);
|
|
@@ -8028,7 +8035,7 @@ class WebRTCClient extends Emitter {
|
|
|
8028
8035
|
}
|
|
8029
8036
|
|
|
8030
8037
|
async _onHeartbeatTimeout() {
|
|
8031
|
-
logger$9.
|
|
8038
|
+
logger$9.warn('sdk webrtc heartbeat timed out', { userAgent: !!this.userAgent, cb: !!this.heartbeatTimeoutCb });
|
|
8032
8039
|
|
|
8033
8040
|
if (this.heartbeatTimeoutCb) {
|
|
8034
8041
|
this.heartbeatTimeoutCb();
|
|
@@ -11079,7 +11086,7 @@ class WebSocketClient extends Emitter {
|
|
|
11079
11086
|
this.close();
|
|
11080
11087
|
}
|
|
11081
11088
|
const url = `wss://${this.host || ''}/api/websocketd/?token=${this.token || ''}&version=${this.version}`;
|
|
11082
|
-
logger$6.
|
|
11089
|
+
logger$6.info('Wazo WS url computed to reconnect', { url });
|
|
11083
11090
|
|
|
11084
11091
|
return url;
|
|
11085
11092
|
}
|
|
@@ -13562,6 +13569,334 @@ class Checker {
|
|
|
13562
13569
|
}
|
|
13563
13570
|
}
|
|
13564
13571
|
|
|
13572
|
+
//
|
|
13573
|
+
/* eslint-disable no-unused-vars */
|
|
13574
|
+
/* global window, document */
|
|
13575
|
+
const BRIDGE_CONFIG_RETRIEVED = 'bridge/CONFIG_RETRIEVED';
|
|
13576
|
+
const BRIDGE_ENABLE_CARD = 'bridge/ENABLE_CARD';
|
|
13577
|
+
const BRIDGE_CHANGE_REQUIRED_SUBSCRIPTION_TYPE = 'bridge/CHANGE_REQUIRED_SUBSCRIPTION_TYPE';
|
|
13578
|
+
const BRIDGE_CREATE_OR_UPDATE_CARD = 'bridge/BRIDGE_CREATE_OR_UPDATE_CARD';
|
|
13579
|
+
const BRIDGE_OPTIONS_FETCHED = 'bridge/BRIDGE_OPTIONS_FETCHED';
|
|
13580
|
+
const BRIDGE_OPTIONS_FOUND = 'bridge/BRIDGE_OPTIONS_FOUND';
|
|
13581
|
+
const BRIDGE_SEARCH_OPTIONS = 'bridge/BRIDGE_SEARCH_OPTIONS';
|
|
13582
|
+
const BRIDGE_DISPLAY_LINKED_OPTION = 'bridge/DISPLAY_LINKED_OPTION';
|
|
13583
|
+
const BRIDGE_UPDATE_FORM_SCHEMA = 'bridge/BRIDGE_UPDATE_FORM_SCHEMA';
|
|
13584
|
+
const BRIDGE_WAZO_CONTACT_SEARCH = 'bridge/BRIDGE_WAZO_CONTACT_SEARCH';
|
|
13585
|
+
const BRIDGE_ON_AGENT_LOGGED_IN = 'bridge/BRIDGE_ON_AGENT_LOGGED_IN';
|
|
13586
|
+
const BRIDGE_ON_AGENT_LOGGED_OUT = 'bridge/BRIDGE_ON_AGENT_LOGGED_OUT';
|
|
13587
|
+
const BRIDGE_ON_AGENT_PAUSED = 'bridge/BRIDGE_ON_AGENT_PAUSED';
|
|
13588
|
+
const BRIDGE_ON_AGENT_RESUMED = 'bridge/BRIDGE_ON_AGENT_RESUMED';
|
|
13589
|
+
const BRIDGE_ON_LANGUAGE_CHANGED = 'bridge/BRIDGE_ON_LANGUAGE_CHANGED';
|
|
13590
|
+
const BRIDGE_ON_CALL_HELD = 'bridge/BRIDGE_ON_CALL_HELD';
|
|
13591
|
+
const BRIDGE_ON_CALL_RESUMED = 'bridge/BRIDGE_ON_CALL_RESUMED';
|
|
13592
|
+
const BRIDGE_ON_CALL_MUTED = 'bridge/BRIDGE_ON_CALL_MUTED';
|
|
13593
|
+
const BRIDGE_ON_CALL_UN_MUTED = 'bridge/BRIDGE_ON_CALL_UN_MUTED';
|
|
13594
|
+
const BRIDGE_ON_DTMF = 'bridge/BRIDGE_ON_DTMF';
|
|
13595
|
+
const BRIDGE_ON_DIRECT_TRANSFER = 'bridge/BRIDGE_ON_DIRECT_TRANSFER';
|
|
13596
|
+
const BRIDGE_ON_CREATE_INDIRECT_TRANSFER = 'bridge/BRIDGE_ON_CREATE_INDIRECT_TRANSFER';
|
|
13597
|
+
const BRIDGE_ON_CANCEL_INDIRECT_TRANSFER = 'bridge/BRIDGE_ON_CANCEL_INDIRECT_TRANSFER';
|
|
13598
|
+
const BRIDGE_ON_CONFIRM_INDIRECT_TRANSFER = 'bridge/BRIDGE_ON_CONFIRM_INDIRECT_TRANSFER';
|
|
13599
|
+
const BRIDGE_ON_INDIRECT_TRANSFER_CALL_MADE = 'bridge/BRIDGE_ON_INDIRECT_TRANSFER_CALL_MADE';
|
|
13600
|
+
const BRIDGE_ON_INDIRECT_TRANSFER_DONE = 'bridge/BRIDGE_ON_INDIRECT_TRANSFER_DONE';
|
|
13601
|
+
const BRIDGE_ON_START_RECORDING = 'bridge/BRIDGE_ON_START_RECORDING';
|
|
13602
|
+
const BRIDGE_ON_STOP_RECORDING = 'bridge/BRIDGE_ON_STOP_RECORDING';
|
|
13603
|
+
|
|
13604
|
+
const SDK_CLICK_TO_CALL = 'sdk/CLICK_TO_CALL';
|
|
13605
|
+
const SDK_ON_CALL_MADE = 'sdk/SDK_ON_CALL_MADE';
|
|
13606
|
+
const SDK_CALL_ENDED = 'sdk/ON_CALL_ENDED';
|
|
13607
|
+
const SDK_CALL_INCOMING = 'sdk/SDK_CALL_INCOMING';
|
|
13608
|
+
const SDK_AUTHENTICATED = 'sdk/SDK_AUTHENTICATED';
|
|
13609
|
+
const SDK_LOGGED_OUT = 'sdk/SDK_LOGGED_OUT';
|
|
13610
|
+
|
|
13611
|
+
class Softphone {
|
|
13612
|
+
url = 'https://softphone.wazo.io';
|
|
13613
|
+
width = 500;
|
|
13614
|
+
height = 600;
|
|
13615
|
+
displayed = false;
|
|
13616
|
+
iframe = null;
|
|
13617
|
+
|
|
13618
|
+
onLinkEnabled(link ) {}
|
|
13619
|
+
onIFrameLoaded() {}
|
|
13620
|
+
|
|
13621
|
+
onCallMade(call ) {}
|
|
13622
|
+
onCallIncoming(call ) {}
|
|
13623
|
+
onCallEnded(call , card , direction , fromExtension ) {}
|
|
13624
|
+
onCardSaved(card ) {}
|
|
13625
|
+
onAuthenticated(session ) {}
|
|
13626
|
+
onLoggedOut() {}
|
|
13627
|
+
onSearchOptions(fieldId , query ) {}
|
|
13628
|
+
onDisplayLinkedOption(optionId ) {}
|
|
13629
|
+
onWazoContactSearch(query ) {}
|
|
13630
|
+
onAgentLoggedIn() {}
|
|
13631
|
+
onAgentLoggedOut() {}
|
|
13632
|
+
onAgentPaused() {}
|
|
13633
|
+
onAgentResumed() {}
|
|
13634
|
+
onLanguageChanged(language ) {}
|
|
13635
|
+
onCallHeld() {}
|
|
13636
|
+
onCallResumed() {}
|
|
13637
|
+
onCallMuted() {}
|
|
13638
|
+
onCallUnMuted() {}
|
|
13639
|
+
onDtmfSent(tone ) {}
|
|
13640
|
+
onDirectTransfer(number ) {}
|
|
13641
|
+
onCreateIndirectTransfer(number ) {}
|
|
13642
|
+
onCancelIndirectTransfer() {}
|
|
13643
|
+
onConfirmIndirectTransfer() {}
|
|
13644
|
+
onIndirectCallMade(call ) {}
|
|
13645
|
+
onIndirectTransferDone(call ) {}
|
|
13646
|
+
onStartRecording() {}
|
|
13647
|
+
onStopRecording() {}
|
|
13648
|
+
onUnHandledEvent(event ) {}
|
|
13649
|
+
|
|
13650
|
+
init({ url, width, height, server, port, language, wrapUpDuration, shouldDisplayLinkedEntities,
|
|
13651
|
+
allowContactCreation, withCard, subscriptionType, enableAgent } = {}) {
|
|
13652
|
+
if (url) {
|
|
13653
|
+
this.url = url;
|
|
13654
|
+
}
|
|
13655
|
+
if (width) {
|
|
13656
|
+
this.width = width;
|
|
13657
|
+
}
|
|
13658
|
+
if (height) {
|
|
13659
|
+
this.height = height;
|
|
13660
|
+
}
|
|
13661
|
+
|
|
13662
|
+
window.addEventListener('message', this._onMessage.bind(this), false);
|
|
13663
|
+
|
|
13664
|
+
if (!server) {
|
|
13665
|
+
// eslint-disable-next-line no-param-reassign
|
|
13666
|
+
server = 'stack.dev.wazo.io';
|
|
13667
|
+
}
|
|
13668
|
+
|
|
13669
|
+
this._createIframe(() => {
|
|
13670
|
+
this._sendMessage(BRIDGE_CONFIG_RETRIEVED, {
|
|
13671
|
+
config: {
|
|
13672
|
+
server,
|
|
13673
|
+
port,
|
|
13674
|
+
language,
|
|
13675
|
+
wrapUpDuration,
|
|
13676
|
+
shouldDisplayLinkedEntities,
|
|
13677
|
+
allowContactCreation,
|
|
13678
|
+
},
|
|
13679
|
+
});
|
|
13680
|
+
|
|
13681
|
+
if (withCard) {
|
|
13682
|
+
this._sendMessage(BRIDGE_ENABLE_CARD);
|
|
13683
|
+
}
|
|
13684
|
+
|
|
13685
|
+
if (subscriptionType) {
|
|
13686
|
+
this._sendMessage(BRIDGE_CHANGE_REQUIRED_SUBSCRIPTION_TYPE, { subscriptionType });
|
|
13687
|
+
}
|
|
13688
|
+
|
|
13689
|
+
this.onIFrameLoaded();
|
|
13690
|
+
});
|
|
13691
|
+
}
|
|
13692
|
+
|
|
13693
|
+
parseLinks() {
|
|
13694
|
+
const links = this._getLinks();
|
|
13695
|
+
|
|
13696
|
+
links.forEach(link => {
|
|
13697
|
+
link.setAttribute('data-wazo-parsed', true);
|
|
13698
|
+
link.addEventListener('click', this._onLinkClick.bind(this));
|
|
13699
|
+
this.onLinkEnabled(link);
|
|
13700
|
+
});
|
|
13701
|
+
}
|
|
13702
|
+
|
|
13703
|
+
makeCall(number ) {
|
|
13704
|
+
this.displaySoftphone();
|
|
13705
|
+
|
|
13706
|
+
this._sendMessage(SDK_CLICK_TO_CALL, { number });
|
|
13707
|
+
}
|
|
13708
|
+
|
|
13709
|
+
toggleSoftphoneDisplay() {
|
|
13710
|
+
if (this.displayed) {
|
|
13711
|
+
this.hideSoftphone();
|
|
13712
|
+
} else {
|
|
13713
|
+
this.displaySoftphone();
|
|
13714
|
+
}
|
|
13715
|
+
}
|
|
13716
|
+
|
|
13717
|
+
displaySoftphone() {
|
|
13718
|
+
if (!this.iframe) {
|
|
13719
|
+
this._createIframe();
|
|
13720
|
+
}
|
|
13721
|
+
|
|
13722
|
+
if (this.iframe) {
|
|
13723
|
+
this.iframe.style.display = 'block';
|
|
13724
|
+
}
|
|
13725
|
+
|
|
13726
|
+
this.displayed = true;
|
|
13727
|
+
}
|
|
13728
|
+
|
|
13729
|
+
hideSoftphone() {
|
|
13730
|
+
if (this.iframe) {
|
|
13731
|
+
this.iframe.style.display = 'none';
|
|
13732
|
+
}
|
|
13733
|
+
this.displayed = false;
|
|
13734
|
+
}
|
|
13735
|
+
|
|
13736
|
+
optionsFetched(fieldId , options ) {
|
|
13737
|
+
this._sendMessage(BRIDGE_OPTIONS_FETCHED, { fieldId, options });
|
|
13738
|
+
}
|
|
13739
|
+
|
|
13740
|
+
onOptionsResults(fieldId , options ) {
|
|
13741
|
+
this._sendMessage(BRIDGE_OPTIONS_FOUND, { fieldId, options });
|
|
13742
|
+
}
|
|
13743
|
+
|
|
13744
|
+
setFormSchema(schema , uiSchema ) {
|
|
13745
|
+
this._sendMessage(BRIDGE_UPDATE_FORM_SCHEMA, { schema, uiSchema });
|
|
13746
|
+
}
|
|
13747
|
+
|
|
13748
|
+
_createIframe(cb = () => {}) {
|
|
13749
|
+
this.iframe = document.createElement('iframe');
|
|
13750
|
+
// $FlowFixMe
|
|
13751
|
+
this.iframe.width = this.width;
|
|
13752
|
+
// $FlowFixMe
|
|
13753
|
+
this.iframe.height = this.height;
|
|
13754
|
+
// $FlowFixMe
|
|
13755
|
+
this.iframe.allow = 'camera *; microphone *; autoplay *; display-capture *';
|
|
13756
|
+
this.iframe.style.position = 'absolute';
|
|
13757
|
+
this.iframe.style.left = '0';
|
|
13758
|
+
this.iframe.style.bottom = '0';
|
|
13759
|
+
this.iframe.style.border = '1px solid #aaa';
|
|
13760
|
+
this.iframe.style.backgroundColor = 'white';
|
|
13761
|
+
this.iframe.src = this.url;
|
|
13762
|
+
this.iframe.style.display = 'none';
|
|
13763
|
+
this.iframe.id = 'wazo-softphone';
|
|
13764
|
+
|
|
13765
|
+
this.iframe.onload = cb;
|
|
13766
|
+
|
|
13767
|
+
// $FlowFixMe
|
|
13768
|
+
document.body.appendChild(this.iframe);
|
|
13769
|
+
}
|
|
13770
|
+
|
|
13771
|
+
_getLinks() {
|
|
13772
|
+
return [].slice.call(document.querySelectorAll('a:not([data-wazo-parsed])'), 0)
|
|
13773
|
+
.filter(link => link.href.indexOf('tel:') === 0 || link.href.indexOf('callto:') === 0);
|
|
13774
|
+
}
|
|
13775
|
+
|
|
13776
|
+
_onLinkClick(e ) {
|
|
13777
|
+
e.preventDefault();
|
|
13778
|
+
const number = e.target.href.split(':')[1];
|
|
13779
|
+
|
|
13780
|
+
this.makeCall(number);
|
|
13781
|
+
}
|
|
13782
|
+
|
|
13783
|
+
_onAuthenticated() {
|
|
13784
|
+
this.parseLinks();
|
|
13785
|
+
}
|
|
13786
|
+
|
|
13787
|
+
_onMessage(event ) {
|
|
13788
|
+
if (!event.data) {
|
|
13789
|
+
return;
|
|
13790
|
+
}
|
|
13791
|
+
|
|
13792
|
+
switch (event.data.type) {
|
|
13793
|
+
case SDK_ON_CALL_MADE:
|
|
13794
|
+
this.onCallMade(event.data.callSession);
|
|
13795
|
+
break;
|
|
13796
|
+
case SDK_CALL_ENDED: {
|
|
13797
|
+
const { callSession, content, direction, userExtension } = event.data;
|
|
13798
|
+
this.onCallEnded(callSession, content, direction, userExtension);
|
|
13799
|
+
break;
|
|
13800
|
+
}
|
|
13801
|
+
case SDK_CALL_INCOMING:
|
|
13802
|
+
this.onCallIncoming(event.data.callSession);
|
|
13803
|
+
break;
|
|
13804
|
+
case SDK_AUTHENTICATED:
|
|
13805
|
+
// $FlowFixMe
|
|
13806
|
+
this._onAuthenticated(event.data.session);
|
|
13807
|
+
this.onAuthenticated(event.data.session);
|
|
13808
|
+
break;
|
|
13809
|
+
case SDK_LOGGED_OUT:
|
|
13810
|
+
this.onLoggedOut();
|
|
13811
|
+
break;
|
|
13812
|
+
case BRIDGE_CREATE_OR_UPDATE_CARD: {
|
|
13813
|
+
const { content } = event.data;
|
|
13814
|
+
this.onCardSaved(content);
|
|
13815
|
+
break;
|
|
13816
|
+
}
|
|
13817
|
+
case BRIDGE_SEARCH_OPTIONS: {
|
|
13818
|
+
const { fieldId, query } = event.data;
|
|
13819
|
+
this.onSearchOptions(fieldId, query);
|
|
13820
|
+
break;
|
|
13821
|
+
}
|
|
13822
|
+
case BRIDGE_DISPLAY_LINKED_OPTION:
|
|
13823
|
+
this.onDisplayLinkedOption(event.data.linkedOptionId);
|
|
13824
|
+
break;
|
|
13825
|
+
case BRIDGE_WAZO_CONTACT_SEARCH:
|
|
13826
|
+
this.onWazoContactSearch(event.data.query);
|
|
13827
|
+
break;
|
|
13828
|
+
case BRIDGE_ON_AGENT_LOGGED_IN:
|
|
13829
|
+
this.onAgentLoggedIn();
|
|
13830
|
+
break;
|
|
13831
|
+
case BRIDGE_ON_AGENT_LOGGED_OUT:
|
|
13832
|
+
this.onAgentLoggedOut();
|
|
13833
|
+
break;
|
|
13834
|
+
case BRIDGE_ON_AGENT_PAUSED:
|
|
13835
|
+
this.onAgentPaused();
|
|
13836
|
+
break;
|
|
13837
|
+
case BRIDGE_ON_AGENT_RESUMED:
|
|
13838
|
+
this.onAgentResumed();
|
|
13839
|
+
break;
|
|
13840
|
+
case BRIDGE_ON_LANGUAGE_CHANGED:
|
|
13841
|
+
this.onLanguageChanged(event.data.language);
|
|
13842
|
+
break;
|
|
13843
|
+
case BRIDGE_ON_CALL_HELD:
|
|
13844
|
+
this.onCallHeld();
|
|
13845
|
+
break;
|
|
13846
|
+
case BRIDGE_ON_CALL_RESUMED:
|
|
13847
|
+
this.onCallResumed();
|
|
13848
|
+
break;
|
|
13849
|
+
case BRIDGE_ON_CALL_MUTED:
|
|
13850
|
+
this.onCallMuted();
|
|
13851
|
+
break;
|
|
13852
|
+
case BRIDGE_ON_CALL_UN_MUTED:
|
|
13853
|
+
this.onCallUnMuted();
|
|
13854
|
+
break;
|
|
13855
|
+
case BRIDGE_ON_DTMF:
|
|
13856
|
+
this.onDtmfSent(event.data.tone);
|
|
13857
|
+
break;
|
|
13858
|
+
case BRIDGE_ON_DIRECT_TRANSFER:
|
|
13859
|
+
this.onDirectTransfer(event.data.number);
|
|
13860
|
+
break;
|
|
13861
|
+
case BRIDGE_ON_CREATE_INDIRECT_TRANSFER:
|
|
13862
|
+
this.onCreateIndirectTransfer(event.data.number);
|
|
13863
|
+
break;
|
|
13864
|
+
case BRIDGE_ON_CANCEL_INDIRECT_TRANSFER:
|
|
13865
|
+
this.onCancelIndirectTransfer();
|
|
13866
|
+
break;
|
|
13867
|
+
case BRIDGE_ON_CONFIRM_INDIRECT_TRANSFER:
|
|
13868
|
+
this.onConfirmIndirectTransfer();
|
|
13869
|
+
break;
|
|
13870
|
+
case BRIDGE_ON_INDIRECT_TRANSFER_CALL_MADE:
|
|
13871
|
+
this.onIndirectCallMade(event.data.call);
|
|
13872
|
+
break;
|
|
13873
|
+
case BRIDGE_ON_INDIRECT_TRANSFER_DONE:
|
|
13874
|
+
this.onIndirectTransferDone(event.data.call);
|
|
13875
|
+
break;
|
|
13876
|
+
case BRIDGE_ON_START_RECORDING:
|
|
13877
|
+
this.onStartRecording();
|
|
13878
|
+
break;
|
|
13879
|
+
case BRIDGE_ON_STOP_RECORDING:
|
|
13880
|
+
this.onStopRecording();
|
|
13881
|
+
break;
|
|
13882
|
+
default:
|
|
13883
|
+
this.onUnHandledEvent(event);
|
|
13884
|
+
break;
|
|
13885
|
+
}
|
|
13886
|
+
}
|
|
13887
|
+
|
|
13888
|
+
_sendMessage(type , payload = {}) {
|
|
13889
|
+
if (!this.iframe) {
|
|
13890
|
+
console.warn(`Could not send message of type ${type} to the Wazo Softphone, iframe not created yet`);
|
|
13891
|
+
return;
|
|
13892
|
+
}
|
|
13893
|
+
|
|
13894
|
+
this.iframe.contentWindow.postMessage({ type, ...payload }, '*');
|
|
13895
|
+
}
|
|
13896
|
+
}
|
|
13897
|
+
|
|
13898
|
+
var Softphone$1 = new Softphone();
|
|
13899
|
+
|
|
13565
13900
|
/* global window */
|
|
13566
13901
|
|
|
13567
13902
|
const Wazo = {
|
|
@@ -13582,6 +13917,7 @@ const Wazo = {
|
|
|
13582
13917
|
loggerFor: IssueReporter$1.loggerFor.bind(IssueReporter$1),
|
|
13583
13918
|
Features: Features$1,
|
|
13584
13919
|
Checker,
|
|
13920
|
+
Softphone: Softphone$1,
|
|
13585
13921
|
|
|
13586
13922
|
// Domain
|
|
13587
13923
|
domain: {
|