@wazo/sdk 0.37.26 → 0.37.27
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 +95 -57
- package/dist/wazo-sdk.js +3 -3
- package/esm/__tests__/api-client.test.js +1 -1
- package/esm/__tests__/web-rtc-client.test.js +9 -4
- package/esm/api/agentd.js +1 -1
- package/esm/api/amid.js +1 -1
- package/esm/api/application.js +1 -1
- package/esm/api/auth.js +1 -1
- package/esm/api/call-logd.js +1 -1
- package/esm/api/calld.js +1 -1
- package/esm/api/chatd.js +1 -1
- package/esm/api/confd.js +1 -1
- package/esm/api/ctid-ng.js +1 -1
- package/esm/api/dird.js +1 -1
- package/esm/api/webhookd.js +1 -1
- package/esm/api-client.js +1 -1
- package/esm/checker/Checker.js +9 -4
- package/esm/checker/checks/aor.js +1 -1
- package/esm/checker/checks/api.js +1 -1
- package/esm/checker/checks/index.js +9 -4
- package/esm/checker/checks/wazo-websocket.js +1 -1
- package/esm/checker/checks/webrtc-transport.js +9 -4
- package/esm/checker/checks/webrtc.js +9 -4
- package/esm/domain/AdHocAPIConference.js +1 -1
- package/esm/domain/Features.js +1 -1
- package/esm/domain/Phone/CTIPhone.js +1 -1
- package/esm/domain/Phone/WebRTCPhone.js +7 -3
- package/esm/index.js +15 -6
- package/esm/lib/WazoSessionDescriptionHandler.js +9 -4
- package/esm/service/CallApi.js +1 -1
- package/esm/service/IssueReporter.js +1 -1
- package/esm/service/__tests__/IssueReporter.test.js +1 -1
- package/esm/service/getApiClient.js +1 -1
- package/esm/simple/Auth.js +15 -6
- package/esm/simple/Configuration.js +15 -6
- package/esm/simple/Directory.js +1 -1
- package/esm/simple/Phone.js +15 -6
- package/esm/simple/Websocket.js +1 -1
- package/esm/simple/index.js +15 -6
- package/esm/simple/room/LocalParticipant.js +15 -6
- package/esm/simple/room/Participant.js +15 -6
- package/esm/simple/room/RemoteParticipant.js +15 -6
- package/esm/simple/room/Room.js +15 -6
- package/esm/simple/room/SipRoom.js +15 -6
- package/esm/simple/room/Stream.js +15 -6
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +15 -6
- package/esm/simple/utils.js +15 -6
- package/esm/utils/__tests__/api-requester.test.js +1 -1
- package/esm/utils/api-requester.js +1 -1
- package/esm/web-rtc-client.js +9 -4
- package/esm/websocket-client.js +1 -1
- package/lib/__tests__/api-client.test.js +1 -1
- package/lib/__tests__/web-rtc-client.test.js +9 -4
- package/lib/api/agentd.js +1 -1
- package/lib/api/amid.js +1 -1
- package/lib/api/application.js +1 -1
- package/lib/api/auth.js +1 -1
- package/lib/api/call-logd.js +1 -1
- package/lib/api/calld.js +1 -1
- package/lib/api/chatd.js +1 -1
- package/lib/api/confd.js +1 -1
- package/lib/api/ctid-ng.js +1 -1
- package/lib/api/dird.js +1 -1
- package/lib/api/webhookd.js +1 -1
- package/lib/api-client.js +1 -1
- package/lib/checker/Checker.js +9 -4
- package/lib/checker/checks/aor.js +1 -1
- package/lib/checker/checks/api.js +1 -1
- package/lib/checker/checks/index.js +9 -4
- package/lib/checker/checks/wazo-websocket.js +1 -1
- package/lib/checker/checks/webrtc-transport.js +9 -4
- package/lib/checker/checks/webrtc.js +9 -4
- package/lib/domain/AdHocAPIConference.js +1 -1
- package/lib/domain/Features.js +1 -1
- package/lib/domain/Phone/CTIPhone.js +1 -1
- package/lib/domain/Phone/WebRTCPhone.js +7 -3
- package/lib/index.js +15 -6
- package/lib/lib/WazoSessionDescriptionHandler.js +9 -4
- package/lib/service/CallApi.js +1 -1
- package/lib/service/IssueReporter.js +1 -1
- package/lib/service/__tests__/IssueReporter.test.js +1 -1
- package/lib/service/getApiClient.js +1 -1
- package/lib/simple/Auth.js +15 -6
- package/lib/simple/Configuration.js +15 -6
- package/lib/simple/Directory.js +1 -1
- package/lib/simple/Phone.js +15 -6
- package/lib/simple/Websocket.js +1 -1
- package/lib/simple/index.js +15 -6
- package/lib/simple/room/LocalParticipant.js +15 -6
- package/lib/simple/room/Participant.js +15 -6
- package/lib/simple/room/RemoteParticipant.js +15 -6
- package/lib/simple/room/Room.js +15 -6
- package/lib/simple/room/SipRoom.js +15 -6
- package/lib/simple/room/Stream.js +15 -6
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +15 -6
- package/lib/simple/utils.js +15 -6
- package/lib/utils/__tests__/api-requester.test.js +1 -1
- package/lib/utils/api-requester.js +1 -1
- package/lib/web-rtc-client.js +9 -4
- package/lib/websocket-client.js +1 -1
- package/package.json +1 -1
- package/src/domain/Phone/WebRTCPhone.js +6 -2
- package/src/lib/WazoSessionDescriptionHandler.js +8 -3
- package/src/utils/api-requester.js +1 -1
|
@@ -684,6 +684,7 @@ export default class WebRTCPhone extends Emitter implements Phone {
|
|
|
684
684
|
_onCallTerminated(sipSession: Session) {
|
|
685
685
|
logger.info('WebRTC phone - on call terminated', { sipId: sipSession.id });
|
|
686
686
|
|
|
687
|
+
const sipSessionId = this.getSipSessionId(sipSession);
|
|
687
688
|
const callSession = this._createCallSession(sipSession);
|
|
688
689
|
const isCurrentSession = this.isCurrentCallSipSession(callSession);
|
|
689
690
|
const isCurrentIncomingCall = callSession.is(this.getIncomingCallSession());
|
|
@@ -701,7 +702,6 @@ export default class WebRTCPhone extends Emitter implements Phone {
|
|
|
701
702
|
}, 5);
|
|
702
703
|
}
|
|
703
704
|
|
|
704
|
-
const sipSessionId = this.getSipSessionId(sipSession);
|
|
705
705
|
if (sipSessionId) {
|
|
706
706
|
this.removeIncomingSessions(sipSessionId);
|
|
707
707
|
}
|
|
@@ -1346,8 +1346,12 @@ export default class WebRTCPhone extends Emitter implements Phone {
|
|
|
1346
1346
|
}
|
|
1347
1347
|
|
|
1348
1348
|
const sessionId = this.incomingSessions[0];
|
|
1349
|
+
const sipSession = this.client.getSipSession(sessionId);
|
|
1350
|
+
if (!sipSession) {
|
|
1351
|
+
return null;
|
|
1352
|
+
}
|
|
1349
1353
|
|
|
1350
|
-
return this._createCallSession(
|
|
1354
|
+
return this._createCallSession(sipSession);
|
|
1351
1355
|
}
|
|
1352
1356
|
|
|
1353
1357
|
sendMessage(sipSession: Session = null, body: string, contentType: string = 'text/plain') {
|
|
@@ -62,11 +62,16 @@ class WazoSessionDescriptionHandler extends SessionDescriptionHandler {
|
|
|
62
62
|
|
|
63
63
|
// $FlowFixMe
|
|
64
64
|
setRemoteSessionDescription(sessionDescription: RTCSessionDescriptionInit): Promise<void> {
|
|
65
|
-
|
|
65
|
+
try {
|
|
66
|
+
const result = super.setRemoteSessionDescription(sessionDescription);
|
|
66
67
|
|
|
67
|
-
|
|
68
|
+
this.eventEmitter.emit('setDescription', sessionDescription);
|
|
68
69
|
|
|
69
|
-
|
|
70
|
+
return result;
|
|
71
|
+
} catch (error) {
|
|
72
|
+
this.logger.error('SessionDescriptionHandler.setRemoteSessionDescription error', error);
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
70
75
|
}
|
|
71
76
|
|
|
72
77
|
// Overridden to avoid to fix ice-candidates missing in the SDP in react-native and chrome canary.
|
|
@@ -25,7 +25,7 @@ const logger = IssueReporter ? IssueReporter.loggerFor('api') : console;
|
|
|
25
25
|
|
|
26
26
|
// Use a function here to be able to mock it in tests
|
|
27
27
|
export const realFetch = () => {
|
|
28
|
-
if (typeof document !== 'undefined') {
|
|
28
|
+
if (typeof document !== 'undefined' && window.fetch) {
|
|
29
29
|
// Browser
|
|
30
30
|
return window.fetch;
|
|
31
31
|
}
|