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