@wazo/sdk 0.37.41 → 0.38.0
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/dist/wazo-sdk.js +3 -3
- package/esm/__tests__/api-client.test.js +45 -22
- package/esm/__tests__/web-rtc-client.test.js +49 -24
- 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 +16 -8
- 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 +14 -7
- package/esm/api/dird.js +12 -7
- package/esm/api/webhookd.js +12 -7
- package/esm/api-client.js +45 -22
- package/esm/checker/Checker.js +50 -25
- package/esm/checker/checks/aor.js +45 -22
- package/esm/checker/checks/api.js +45 -22
- package/esm/checker/checks/index.js +50 -25
- package/esm/checker/checks/wazo-websocket.js +13 -8
- package/esm/checker/checks/webrtc-transport.js +49 -24
- package/esm/checker/checks/webrtc.js +49 -24
- package/esm/domain/AdHocAPIConference.js +54 -23
- package/esm/domain/Features.js +54 -23
- package/esm/domain/Phone/CTIPhone.js +54 -23
- package/esm/domain/Phone/WebRTCPhone.js +14 -7
- package/esm/index.js +233 -25
- package/esm/lib/WazoSessionDescriptionHandler.js +12 -7
- package/esm/service/CallApi.js +54 -23
- package/esm/service/IssueReporter.js +12 -7
- package/esm/service/__tests__/IssueReporter.test.js +18 -7
- package/esm/service/getApiClient.js +63 -24
- package/esm/simple/Auth.js +233 -25
- package/esm/simple/Configuration.js +233 -25
- package/esm/simple/Directory.js +54 -23
- package/esm/simple/Phone.js +233 -25
- package/esm/simple/Softphone.js +148 -0
- package/esm/simple/Websocket.js +13 -8
- package/esm/simple/index.js +233 -25
- package/esm/simple/room/LocalParticipant.js +233 -25
- package/esm/simple/room/Participant.js +233 -25
- package/esm/simple/room/RemoteParticipant.js +233 -25
- package/esm/simple/room/Room.js +233 -25
- package/esm/simple/room/SipRoom.js +233 -25
- package/esm/simple/room/Stream.js +233 -25
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +233 -25
- package/esm/simple/utils.js +233 -25
- package/esm/utils/__tests__/api-requester.test.js +12 -7
- package/esm/utils/api-requester.js +12 -7
- package/esm/web-rtc-client.js +49 -24
- package/esm/websocket-client.js +13 -8
- package/lib/__tests__/api-client.test.js +45 -22
- package/lib/__tests__/web-rtc-client.test.js +49 -24
- 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 +16 -8
- 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 +14 -7
- package/lib/api/dird.js +12 -7
- package/lib/api/webhookd.js +12 -7
- package/lib/api-client.js +45 -22
- package/lib/checker/Checker.js +50 -25
- package/lib/checker/checks/aor.js +45 -22
- package/lib/checker/checks/api.js +45 -22
- package/lib/checker/checks/index.js +50 -25
- package/lib/checker/checks/wazo-websocket.js +13 -8
- package/lib/checker/checks/webrtc-transport.js +49 -24
- package/lib/checker/checks/webrtc.js +49 -24
- package/lib/domain/AdHocAPIConference.js +54 -23
- package/lib/domain/Features.js +54 -23
- package/lib/domain/Phone/CTIPhone.js +54 -23
- package/lib/domain/Phone/WebRTCPhone.js +14 -7
- package/lib/index.js +233 -25
- package/lib/lib/WazoSessionDescriptionHandler.js +12 -7
- package/lib/service/CallApi.js +54 -23
- package/lib/service/IssueReporter.js +12 -7
- package/lib/service/__tests__/IssueReporter.test.js +18 -7
- package/lib/service/getApiClient.js +64 -23
- package/lib/simple/Auth.js +233 -25
- package/lib/simple/Configuration.js +233 -25
- package/lib/simple/Directory.js +54 -23
- package/lib/simple/Phone.js +233 -25
- package/lib/simple/Softphone.js +150 -0
- package/lib/simple/Websocket.js +13 -8
- package/lib/simple/index.js +233 -25
- package/lib/simple/room/LocalParticipant.js +233 -25
- package/lib/simple/room/Participant.js +233 -25
- package/lib/simple/room/RemoteParticipant.js +233 -25
- package/lib/simple/room/Room.js +233 -25
- package/lib/simple/room/SipRoom.js +233 -25
- package/lib/simple/room/Stream.js +233 -25
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +233 -25
- package/lib/simple/utils.js +233 -25
- package/lib/utils/__tests__/api-requester.test.js +12 -7
- package/lib/utils/api-requester.js +12 -7
- package/lib/web-rtc-client.js +49 -24
- package/lib/websocket-client.js +13 -8
- package/package.json +1 -1
- package/src/api/auth.js +4 -1
- package/src/api-client.js +26 -13
- package/src/service/IssueReporter.js +12 -7
- package/src/service/__tests__/IssueReporter.test.js +6 -0
- package/src/service/getApiClient.js +19 -1
- package/src/simple/Auth.js +21 -0
- package/src/simple/Softphone.js +148 -0
- package/src/simple/index.js +2 -0
- package/src/web-rtc-client.js +4 -2
- package/src/websocket-client.js +1 -1
package/lib/simple/index.js
CHANGED
|
@@ -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);
|
|
@@ -2275,9 +2280,12 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2275
2280
|
expiration: expiration || DETAULT_EXPIRATION,
|
|
2276
2281
|
refresh_token: refreshToken,
|
|
2277
2282
|
client_id: client.clientId,
|
|
2278
|
-
tenant_id: tenantId,
|
|
2279
2283
|
};
|
|
2280
2284
|
|
|
2285
|
+
if (tenantId) {
|
|
2286
|
+
body.tenant_id = tenantId;
|
|
2287
|
+
}
|
|
2288
|
+
|
|
2281
2289
|
const headers = {
|
|
2282
2290
|
'Content-Type': 'application/json',
|
|
2283
2291
|
...(isMobile ? { 'Wazo-Session-Type': 'mobile' } : {}),
|
|
@@ -5425,6 +5433,7 @@ class ApiClient {
|
|
|
5425
5433
|
|
|
5426
5434
|
|
|
5427
5435
|
|
|
5436
|
+
|
|
5428
5437
|
|
|
5429
5438
|
|
|
5430
5439
|
|
|
@@ -5477,23 +5486,31 @@ class ApiClient {
|
|
|
5477
5486
|
return null;
|
|
5478
5487
|
}
|
|
5479
5488
|
|
|
5480
|
-
|
|
5481
|
-
this.refreshToken
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
|
|
5489
|
+
try {
|
|
5490
|
+
const session = await this.auth.refreshToken(
|
|
5491
|
+
this.refreshToken,
|
|
5492
|
+
this.refreshBackend,
|
|
5493
|
+
this.refreshExpiration,
|
|
5494
|
+
this.isMobile,
|
|
5495
|
+
this.refreshTenantId,
|
|
5496
|
+
);
|
|
5487
5497
|
|
|
5488
|
-
|
|
5498
|
+
logger$a.info('token refreshed', { token: session.token });
|
|
5489
5499
|
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5500
|
+
if (this.onRefreshToken) {
|
|
5501
|
+
this.onRefreshToken(session.token, session);
|
|
5502
|
+
}
|
|
5493
5503
|
|
|
5494
|
-
|
|
5504
|
+
this.setToken(session.token);
|
|
5505
|
+
|
|
5506
|
+
return session.token;
|
|
5507
|
+
} catch (error) {
|
|
5508
|
+
logger$a.error('token refresh, error', error);
|
|
5495
5509
|
|
|
5496
|
-
|
|
5510
|
+
if (this.onRefreshTokenError) {
|
|
5511
|
+
this.onRefreshTokenError(error);
|
|
5512
|
+
}
|
|
5513
|
+
}
|
|
5497
5514
|
}
|
|
5498
5515
|
|
|
5499
5516
|
setToken(token ) {
|
|
@@ -5516,6 +5533,10 @@ class ApiClient {
|
|
|
5516
5533
|
this.onRefreshToken = onRefreshToken;
|
|
5517
5534
|
}
|
|
5518
5535
|
|
|
5536
|
+
setOnRefreshTokenError(callback ) {
|
|
5537
|
+
this.onRefreshTokenError = callback;
|
|
5538
|
+
}
|
|
5539
|
+
|
|
5519
5540
|
setRefreshExpiration(refreshExpiration ) {
|
|
5520
5541
|
this.refreshExpiration = refreshExpiration;
|
|
5521
5542
|
}
|
|
@@ -5551,7 +5572,9 @@ global.wazoClients = global.wazoClients || {};
|
|
|
5551
5572
|
global.wazoClientId = global.wazoClientId || {};
|
|
5552
5573
|
global.wazoClientToken = global.wazoClientToken || {};
|
|
5553
5574
|
global.wazoRefreshToken = global.wazoRefreshToken || {};
|
|
5575
|
+
global.wazoRefreshTenantId = global.wazoRefreshTenantId || {};
|
|
5554
5576
|
global.wazoOnRefreshToken = global.wazoOnRefreshToken || {};
|
|
5577
|
+
global.wazoOnRefreshTokenError = global.wazoOnRefreshTokenError || {};
|
|
5555
5578
|
global.wazoRefreshExpiration = global.wazoRefreshExpiration || {};
|
|
5556
5579
|
global.wazoRefreshBackend = global.wazoRefreshBackend || {};
|
|
5557
5580
|
global.wazoIsMobile = global.wazoIsMobile || {};
|
|
@@ -5573,10 +5596,18 @@ const setRefreshToken = (newRefreshToken , forServer = null) =>
|
|
|
5573
5596
|
global.wazoRefreshToken[forServer] = newRefreshToken;
|
|
5574
5597
|
};
|
|
5575
5598
|
|
|
5599
|
+
const setRefreshTenantId = (refreshTenantId , forServer = null) => {
|
|
5600
|
+
global.wazoRefreshTenantId[forServer] = refreshTenantId;
|
|
5601
|
+
};
|
|
5602
|
+
|
|
5576
5603
|
const setOnRefreshToken = (onRefreshToken , forServer = null) => {
|
|
5577
5604
|
global.wazoOnRefreshToken[forServer] = onRefreshToken;
|
|
5578
5605
|
};
|
|
5579
5606
|
|
|
5607
|
+
const setOnRefreshTokenError = (callback , forServer = null) => {
|
|
5608
|
+
global.wazoOnRefreshTokenError[forServer] = callback;
|
|
5609
|
+
};
|
|
5610
|
+
|
|
5580
5611
|
const setRefreshExpiration = (refreshExpiration , forServer = null) => {
|
|
5581
5612
|
global.wazoRefreshExpiration[forServer] = refreshExpiration;
|
|
5582
5613
|
};
|
|
@@ -5595,12 +5626,20 @@ const fillClient = (apiClient ) => {
|
|
|
5595
5626
|
|
|
5596
5627
|
apiClient.setRefreshToken(global.wazoRefreshToken[server] || global.wazoRefreshToken[null] || apiClient.refreshToken);
|
|
5597
5628
|
|
|
5629
|
+
apiClient.setRefreshTenantId(
|
|
5630
|
+
global.wazoRefreshTenantId[server] || global.wazoRefreshTenantId[null] || apiClient.refreshTenantId,
|
|
5631
|
+
);
|
|
5632
|
+
|
|
5598
5633
|
apiClient.setFetchOptions(global.wazoFetchOptions[server] || global.wazoFetchOptions[null] || apiClient.fetchOptions);
|
|
5599
5634
|
|
|
5600
5635
|
apiClient.setOnRefreshToken(
|
|
5601
5636
|
global.wazoOnRefreshToken[server] || global.wazoOnRefreshToken[null] || apiClient.onRefreshToken,
|
|
5602
5637
|
);
|
|
5603
5638
|
|
|
5639
|
+
apiClient.setOnRefreshTokenError(
|
|
5640
|
+
global.wazoOnRefreshTokenError[server] || global.wazoOnRefreshTokenError[null] || apiClient.onRefreshTokenError,
|
|
5641
|
+
);
|
|
5642
|
+
|
|
5604
5643
|
apiClient.setRefreshExpiration(
|
|
5605
5644
|
global.wazoRefreshExpiration[server] || global.wazoRefreshExpiration[null] || apiClient.refreshExpiration,
|
|
5606
5645
|
);
|
|
@@ -5614,7 +5653,7 @@ const fillClient = (apiClient ) => {
|
|
|
5614
5653
|
return apiClient;
|
|
5615
5654
|
};
|
|
5616
5655
|
|
|
5617
|
-
var getApiClient = (forServer
|
|
5656
|
+
var getApiClient = (forServer = null) => {
|
|
5618
5657
|
const server = forServer || global.wazoCurrentServer || '';
|
|
5619
5658
|
if (server in global.wazoClients) {
|
|
5620
5659
|
return fillClient(global.wazoClients[server]);
|
|
@@ -5641,6 +5680,7 @@ class Auth {
|
|
|
5641
5680
|
|
|
5642
5681
|
|
|
5643
5682
|
|
|
5683
|
+
|
|
5644
5684
|
|
|
5645
5685
|
|
|
5646
5686
|
|
|
@@ -5678,6 +5718,14 @@ class Auth {
|
|
|
5678
5718
|
this.onRefreshTokenCallback(token, session);
|
|
5679
5719
|
}
|
|
5680
5720
|
});
|
|
5721
|
+
|
|
5722
|
+
setOnRefreshTokenError(error => {
|
|
5723
|
+
logger$9.error('on refresh token error', error);
|
|
5724
|
+
|
|
5725
|
+
if (this.onRefreshTokenCallbackError) {
|
|
5726
|
+
this.onRefreshTokenCallbackError(error);
|
|
5727
|
+
}
|
|
5728
|
+
});
|
|
5681
5729
|
}
|
|
5682
5730
|
|
|
5683
5731
|
setFetchOptions(options ) {
|
|
@@ -5766,6 +5814,10 @@ class Auth {
|
|
|
5766
5814
|
this.onRefreshTokenCallback = callback;
|
|
5767
5815
|
}
|
|
5768
5816
|
|
|
5817
|
+
setOnRefreshTokenError(callback ) {
|
|
5818
|
+
this.onRefreshTokenCallbackError = callback;
|
|
5819
|
+
}
|
|
5820
|
+
|
|
5769
5821
|
checkAuthorizations(session , authorizationName ) {
|
|
5770
5822
|
if (!authorizationName) {
|
|
5771
5823
|
return;
|
|
@@ -5798,6 +5850,12 @@ class Auth {
|
|
|
5798
5850
|
setRefreshToken(refreshToken);
|
|
5799
5851
|
}
|
|
5800
5852
|
|
|
5853
|
+
setRefreshTenantId(refreshTenantId ) {
|
|
5854
|
+
setRefreshTenantId(refreshTenantId);
|
|
5855
|
+
|
|
5856
|
+
getApiClient().setRefreshTenantId(refreshTenantId);
|
|
5857
|
+
}
|
|
5858
|
+
|
|
5801
5859
|
forceRefreshToken() {
|
|
5802
5860
|
getApiClient().forceRefreshToken();
|
|
5803
5861
|
}
|
|
@@ -7432,8 +7490,10 @@ class WebRTCClient extends Emitter {
|
|
|
7432
7490
|
conference: isConference,
|
|
7433
7491
|
};
|
|
7434
7492
|
|
|
7435
|
-
// Avoid sdh to
|
|
7436
|
-
session.sessionDescriptionHandler
|
|
7493
|
+
// Avoid sdh to create a new stream
|
|
7494
|
+
if (session.sessionDescriptionHandler) {
|
|
7495
|
+
session.sessionDescriptionHandler.localMediaStreamConstraints = options.constraints;
|
|
7496
|
+
}
|
|
7437
7497
|
|
|
7438
7498
|
// Send re-INVITE
|
|
7439
7499
|
return session.invite(options);
|
|
@@ -11444,7 +11504,7 @@ class WebSocketClient extends Emitter {
|
|
|
11444
11504
|
this.close();
|
|
11445
11505
|
}
|
|
11446
11506
|
const url = `wss://${this.host || ''}/api/websocketd/?token=${this.token || ''}&version=${this.version}`;
|
|
11447
|
-
logger$5.
|
|
11507
|
+
logger$5.info('Wazo WS url computed to reconnect', { url });
|
|
11448
11508
|
|
|
11449
11509
|
return url;
|
|
11450
11510
|
}
|
|
@@ -13919,6 +13979,153 @@ class Checker {
|
|
|
13919
13979
|
}
|
|
13920
13980
|
}
|
|
13921
13981
|
|
|
13982
|
+
//
|
|
13983
|
+
/* eslint-disable no-unused-vars */
|
|
13984
|
+
/* global window, document */
|
|
13985
|
+
const SDK_CLICK_TO_CALL = 'sdk/CLICK_TO_CALL';
|
|
13986
|
+
const SDK_ON_CALL_MADE = 'sdk/SDK_ON_CALL_MADE';
|
|
13987
|
+
const SDK_CALL_ENDED = 'sdk/ON_CALL_ENDED';
|
|
13988
|
+
const SDK_CALL_INCOMING = 'sdk/SDK_CALL_INCOMING';
|
|
13989
|
+
const SDK_AUTHENTICATED = 'sdk/SDK_AUTHENTICATED';
|
|
13990
|
+
|
|
13991
|
+
class Softphone {
|
|
13992
|
+
url = 'https://softphone.wazo.io';
|
|
13993
|
+
width = 500;
|
|
13994
|
+
height = 600;
|
|
13995
|
+
displayed = false;
|
|
13996
|
+
iframe = null;
|
|
13997
|
+
|
|
13998
|
+
onLinkEnabled(link ) {}
|
|
13999
|
+
|
|
14000
|
+
onCallMade(call ) {}
|
|
14001
|
+
onCallIncoming(call ) {}
|
|
14002
|
+
onCallEnded(call , card , direction , fromExtension ) {}
|
|
14003
|
+
onAuthenticated(session ) {}
|
|
14004
|
+
|
|
14005
|
+
init(url , width , height ) {
|
|
14006
|
+
if (url) {
|
|
14007
|
+
this.url = url;
|
|
14008
|
+
}
|
|
14009
|
+
if (width) {
|
|
14010
|
+
this.width = width;
|
|
14011
|
+
}
|
|
14012
|
+
if (height) {
|
|
14013
|
+
this.height = height;
|
|
14014
|
+
}
|
|
14015
|
+
|
|
14016
|
+
window.addEventListener('message', this._onMessage.bind(this), false);
|
|
14017
|
+
|
|
14018
|
+
this._createIframe();
|
|
14019
|
+
}
|
|
14020
|
+
|
|
14021
|
+
parseLinks() {
|
|
14022
|
+
const links = this._getLinks();
|
|
14023
|
+
|
|
14024
|
+
links.forEach(link => {
|
|
14025
|
+
link.setAttribute('data-wazo-parsed', true);
|
|
14026
|
+
link.addEventListener('click', this._onLinkClick.bind(this));
|
|
14027
|
+
this.onLinkEnabled(link);
|
|
14028
|
+
});
|
|
14029
|
+
}
|
|
14030
|
+
|
|
14031
|
+
makeCall(number ) {
|
|
14032
|
+
this.displaySoftphone();
|
|
14033
|
+
|
|
14034
|
+
if (this.iframe) {
|
|
14035
|
+
this.iframe.contentWindow.postMessage({ type: SDK_CLICK_TO_CALL, number }, '*');
|
|
14036
|
+
}
|
|
14037
|
+
}
|
|
14038
|
+
|
|
14039
|
+
toggleSoftphoneDisplay() {
|
|
14040
|
+
if (this.displayed) {
|
|
14041
|
+
this.hideSoftphone();
|
|
14042
|
+
} else {
|
|
14043
|
+
this.displaySoftphone();
|
|
14044
|
+
}
|
|
14045
|
+
|
|
14046
|
+
this.displayed = !this.displayed;
|
|
14047
|
+
}
|
|
14048
|
+
|
|
14049
|
+
displaySoftphone() {
|
|
14050
|
+
if (!this.iframe) {
|
|
14051
|
+
this._createIframe();
|
|
14052
|
+
}
|
|
14053
|
+
|
|
14054
|
+
if (this.iframe) {
|
|
14055
|
+
this.iframe.style.display = 'block';
|
|
14056
|
+
}
|
|
14057
|
+
}
|
|
14058
|
+
|
|
14059
|
+
hideSoftphone() {
|
|
14060
|
+
if (this.iframe) {
|
|
14061
|
+
this.iframe.style.display = 'none';
|
|
14062
|
+
}
|
|
14063
|
+
}
|
|
14064
|
+
|
|
14065
|
+
_createIframe() {
|
|
14066
|
+
this.iframe = document.createElement('iframe');
|
|
14067
|
+
// $FlowFixMe
|
|
14068
|
+
this.iframe.width = this.width;
|
|
14069
|
+
// $FlowFixMe
|
|
14070
|
+
this.iframe.height = this.height;
|
|
14071
|
+
// $FlowFixMe
|
|
14072
|
+
this.iframe.allow = 'camera *; microphone *; autoplay *; display-capture *';
|
|
14073
|
+
this.iframe.style.position = 'absolute';
|
|
14074
|
+
this.iframe.style.left = '0';
|
|
14075
|
+
this.iframe.style.bottom = '0';
|
|
14076
|
+
this.iframe.style.border = '1px solid #aaa';
|
|
14077
|
+
this.iframe.src = this.url;
|
|
14078
|
+
this.iframe.style.display = 'none';
|
|
14079
|
+
this.iframe.id = 'wazo-softphone';
|
|
14080
|
+
|
|
14081
|
+
// $FlowFixMe
|
|
14082
|
+
document.body.appendChild(this.iframe);
|
|
14083
|
+
}
|
|
14084
|
+
|
|
14085
|
+
_getLinks() {
|
|
14086
|
+
return [].slice.call(document.querySelectorAll('a:not([data-wazo-parsed])'), 0)
|
|
14087
|
+
.filter(link => link.href.indexOf('tel:') === 0 || link.href.indexOf('callto:') === 0);
|
|
14088
|
+
}
|
|
14089
|
+
|
|
14090
|
+
_onLinkClick(e ) {
|
|
14091
|
+
e.preventDefault();
|
|
14092
|
+
const number = e.target.href.split(':')[1];
|
|
14093
|
+
|
|
14094
|
+
this.makeCall(number);
|
|
14095
|
+
}
|
|
14096
|
+
|
|
14097
|
+
_onAuthenticated() {
|
|
14098
|
+
this.parseLinks();
|
|
14099
|
+
}
|
|
14100
|
+
|
|
14101
|
+
_onMessage(event ) {
|
|
14102
|
+
if (!event.data) {
|
|
14103
|
+
return;
|
|
14104
|
+
}
|
|
14105
|
+
|
|
14106
|
+
switch (event.data.type) {
|
|
14107
|
+
case SDK_ON_CALL_MADE:
|
|
14108
|
+
this.onCallMade(event.data.callSession);
|
|
14109
|
+
break;
|
|
14110
|
+
case SDK_CALL_ENDED: {
|
|
14111
|
+
const { callSession, content, direction, userExtension } = event.data;
|
|
14112
|
+
this.onCallEnded(callSession, content, direction, userExtension);
|
|
14113
|
+
break;
|
|
14114
|
+
}
|
|
14115
|
+
case SDK_CALL_INCOMING:
|
|
14116
|
+
this.onCallIncoming(event.data.callSession);
|
|
14117
|
+
break;
|
|
14118
|
+
case SDK_AUTHENTICATED:
|
|
14119
|
+
// $FlowFixMe
|
|
14120
|
+
this._onAuthenticated(event.data.session);
|
|
14121
|
+
this.onAuthenticated(event.data.session);
|
|
14122
|
+
break;
|
|
14123
|
+
}
|
|
14124
|
+
}
|
|
14125
|
+
}
|
|
14126
|
+
|
|
14127
|
+
var Softphone$1 = new Softphone();
|
|
14128
|
+
|
|
13922
14129
|
/* global window */
|
|
13923
14130
|
|
|
13924
14131
|
const Wazo = {
|
|
@@ -13939,6 +14146,7 @@ const Wazo = {
|
|
|
13939
14146
|
loggerFor: IssueReporter$1.loggerFor.bind(IssueReporter$1),
|
|
13940
14147
|
Features: Features$1,
|
|
13941
14148
|
Checker,
|
|
14149
|
+
Softphone: Softphone$1,
|
|
13942
14150
|
|
|
13943
14151
|
// Domain
|
|
13944
14152
|
domain: {
|