@exotel-npm-dev/webrtc-client-sdk 2.0.3 → 2.0.5
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/Changelog +3 -0
- package/Makefile +1 -1
- package/dist/exotelsdk.js +73 -50
- package/dist/exotelsdk.js.map +1 -1
- package/package.json +2 -2
- package/src/listeners/ExWebClient.js +21 -4
package/Changelog
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
Change Log
|
|
2
2
|
|
|
3
|
+
## v2.0.5 31 July, 2025
|
|
4
|
+
-[VST-1038] prevent exotel / sipjs from throwing logs in the console based on a flag, added missing iceconnectionstate in session event callback
|
|
5
|
+
|
|
3
6
|
## v2.0.2 21 July, 2025
|
|
4
7
|
-[VST-1038] make auto audio device change handling configurable and fixing Missing sent_request event in registerCallback
|
|
5
8
|
|
package/Makefile
CHANGED
package/dist/exotelsdk.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
*
|
|
3
|
-
* WebRTC CLient SIP version 2.0.
|
|
3
|
+
* WebRTC CLient SIP version 2.0.5
|
|
4
4
|
*
|
|
5
5
|
*/
|
|
6
6
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
@@ -188,7 +188,6 @@ const audioDeviceManager = {
|
|
|
188
188
|
|
|
189
189
|
};
|
|
190
190
|
|
|
191
|
-
audioDeviceManager.enumerateDevices();
|
|
192
191
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (audioDeviceManager);
|
|
193
192
|
|
|
194
193
|
/***/ }),
|
|
@@ -207,43 +206,56 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
207
206
|
|
|
208
207
|
const coreSDKLogger = {
|
|
209
208
|
|
|
209
|
+
loggingEnabled: true,
|
|
210
210
|
loggerCallback: null,
|
|
211
211
|
|
|
212
|
+
setEnableConsoleLogging(enable) {
|
|
213
|
+
coreSDKLogger.loggingEnabled = enable;
|
|
214
|
+
},
|
|
215
|
+
|
|
212
216
|
registerLoggerCallback(callback) {
|
|
213
217
|
coreSDKLogger.loggerCallback = callback;
|
|
214
218
|
},
|
|
215
219
|
log: (arg1, ...args) => {
|
|
216
|
-
if (
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
+
if (coreSDKLogger.loggingEnabled) {
|
|
221
|
+
if (args.length == 0)
|
|
222
|
+
console.log(arg1);
|
|
223
|
+
else
|
|
224
|
+
console.log(arg1, args);
|
|
225
|
+
}
|
|
220
226
|
if (coreSDKLogger.loggerCallback)
|
|
221
227
|
coreSDKLogger.loggerCallback("log", arg1, args);
|
|
222
228
|
},
|
|
223
229
|
|
|
224
230
|
info: (arg1, ...args) => {
|
|
225
|
-
if (
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
231
|
+
if (coreSDKLogger.loggingEnabled) {
|
|
232
|
+
if (args.length == 0)
|
|
233
|
+
console.info(arg1);
|
|
234
|
+
else
|
|
235
|
+
console.info(arg1, args);
|
|
236
|
+
}
|
|
229
237
|
if (coreSDKLogger.loggerCallback)
|
|
230
238
|
coreSDKLogger.loggerCallback("info", arg1, args);
|
|
231
239
|
},
|
|
232
240
|
|
|
233
241
|
warn: (arg1, ...args) => {
|
|
234
|
-
if (
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
242
|
+
if (coreSDKLogger.loggingEnabled) {
|
|
243
|
+
if (args.length == 0)
|
|
244
|
+
console.warn(arg1);
|
|
245
|
+
else
|
|
246
|
+
console.warn(arg1, args);
|
|
247
|
+
}
|
|
238
248
|
if (coreSDKLogger.loggerCallback)
|
|
239
249
|
coreSDKLogger.loggerCallback("warn", arg1, args);
|
|
240
250
|
},
|
|
241
251
|
|
|
242
252
|
error: (arg1, ...args) => {
|
|
243
|
-
if (
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
253
|
+
if (coreSDKLogger.loggingEnabled) {
|
|
254
|
+
if (args.length == 0)
|
|
255
|
+
console.error(arg1);
|
|
256
|
+
else
|
|
257
|
+
console.error(arg1, args);
|
|
258
|
+
}
|
|
247
259
|
if (coreSDKLogger.loggerCallback)
|
|
248
260
|
coreSDKLogger.loggerCallback("error", arg1, args);
|
|
249
261
|
}
|
|
@@ -20886,7 +20898,6 @@ var registerer = null;
|
|
|
20886
20898
|
|
|
20887
20899
|
|
|
20888
20900
|
let logger = _coreSDKLogger_js__WEBPACK_IMPORTED_MODULE_1__["default"];
|
|
20889
|
-
logger.log(SIP);
|
|
20890
20901
|
/* NL Additions - Start */
|
|
20891
20902
|
|
|
20892
20903
|
function getLogger() {
|
|
@@ -21357,7 +21368,7 @@ function sipRegister() {
|
|
|
21357
21368
|
reconnectionAttempts: 0
|
|
21358
21369
|
|
|
21359
21370
|
},
|
|
21360
|
-
logBuiltinEnabled:
|
|
21371
|
+
logBuiltinEnabled: false,
|
|
21361
21372
|
logConnector: sipPhoneLogger,
|
|
21362
21373
|
logLevel: "log",
|
|
21363
21374
|
sessionDescriptionHandlerFactoryOptions: {
|
|
@@ -22165,16 +22176,7 @@ const SIPJSPhone = {
|
|
|
22165
22176
|
changeAudioInputDevice(deviceId, onSuccess, onError, forceDeviceChange) {
|
|
22166
22177
|
logger.log(`SIPJSPhone: changeAudioInputDevice called with deviceId=${deviceId}, forceDeviceChange=${forceDeviceChange}, enableAutoAudioDeviceChangeHandling=${enableAutoAudioDeviceChangeHandling}`);
|
|
22167
22178
|
_audioDeviceManager_js__WEBPACK_IMPORTED_MODULE_0__.audioDeviceManager.changeAudioInputDevice(deviceId, function (stream) {
|
|
22168
|
-
|
|
22169
|
-
if (trackChanged) {
|
|
22170
|
-
_audioDeviceManager_js__WEBPACK_IMPORTED_MODULE_0__.audioDeviceManager.currentAudioInputDeviceId = deviceId;
|
|
22171
|
-
logger.log(`sipjsphone: changeAudioInputDevice: Input device changed to: ${deviceId}`);
|
|
22172
|
-
|
|
22173
|
-
onSuccess();
|
|
22174
|
-
} else {
|
|
22175
|
-
logger.error("sipjsphone: changeAudioInputDevice: failed");
|
|
22176
|
-
onError("replaceSenderTrack failed for webrtc");
|
|
22177
|
-
}
|
|
22179
|
+
SIPJSPhone.replaceSenderTrack(stream, deviceId, onSuccess, onError);
|
|
22178
22180
|
}, onError, forceDeviceChange);
|
|
22179
22181
|
},
|
|
22180
22182
|
changeAudioOutputDeviceForAdditionalAudioElement(deviceId) {
|
|
@@ -22214,36 +22216,41 @@ const SIPJSPhone = {
|
|
|
22214
22216
|
logger.error("sipjsphone:stopStreamTracks failed to stop tracks");
|
|
22215
22217
|
}
|
|
22216
22218
|
},
|
|
22217
|
-
replaceSenderTrack(stream, deviceId) {
|
|
22219
|
+
replaceSenderTrack(stream, deviceId, onSuccessCallback, onErrorCallback) {
|
|
22218
22220
|
logger.log(`sipjsphone:replaceSenderTrack: entry, deviceId=${deviceId}`);
|
|
22221
|
+
let trackChanged = false;
|
|
22222
|
+
let errorMessage = "";
|
|
22219
22223
|
try {
|
|
22220
22224
|
if (ctxSip.callActiveID) {
|
|
22221
22225
|
ctxSip.Stream = stream;
|
|
22222
22226
|
const s = ctxSip.Sessions[ctxSip.callActiveID];
|
|
22223
22227
|
const pc = s.sessionDescriptionHandler.peerConnection;
|
|
22224
22228
|
if (pc.getSenders) {
|
|
22225
|
-
try {
|
|
22226
22229
|
const [audioTrack] = stream.getAudioTracks();
|
|
22227
22230
|
const sender = pc.getSenders().find((s) => s.track.kind === audioTrack.kind);
|
|
22228
22231
|
sender.track.stop();
|
|
22229
22232
|
sender.replaceTrack(audioTrack);
|
|
22230
|
-
|
|
22231
|
-
logger.error(`sipjsphone:replaceSenderTrack: unable to replace track for stream for device id ${deviceId} `, e);
|
|
22232
|
-
SIPJSPhone.stopStreamTracks(stream);
|
|
22233
|
-
}
|
|
22233
|
+
trackChanged = true;
|
|
22234
22234
|
} else {
|
|
22235
22235
|
logger.error("sipjsphone:replaceSenderTrack: no sender found");
|
|
22236
|
-
|
|
22236
|
+
errorMessage = "no sender found";
|
|
22237
22237
|
}
|
|
22238
22238
|
} else {
|
|
22239
22239
|
logger.log("sipjsphone:replaceSenderTrack: no call active, stopping stream tracks");
|
|
22240
|
-
|
|
22240
|
+
errorMessage = "no call active";
|
|
22241
22241
|
}
|
|
22242
|
-
return true;
|
|
22243
22242
|
} catch (e) {
|
|
22244
|
-
SIPJSPhone.stopStreamTracks(stream);
|
|
22245
22243
|
logger.error("sipjsphone:replaceSenderTrack: failed to replace track", e);
|
|
22246
|
-
|
|
22244
|
+
errorMessage = "failed to replace track";
|
|
22245
|
+
}
|
|
22246
|
+
|
|
22247
|
+
if(trackChanged) {
|
|
22248
|
+
_audioDeviceManager_js__WEBPACK_IMPORTED_MODULE_0__.audioDeviceManager.currentAudioInputDeviceId = deviceId;
|
|
22249
|
+
logger.info("sipjsphone:replaceSenderTrack: track replaced");
|
|
22250
|
+
onSuccessCallback();
|
|
22251
|
+
} else {
|
|
22252
|
+
SIPJSPhone.stopStreamTracks(stream);
|
|
22253
|
+
onErrorCallback(errorMessage);
|
|
22247
22254
|
}
|
|
22248
22255
|
|
|
22249
22256
|
},
|
|
@@ -22274,13 +22281,15 @@ const SIPJSPhone = {
|
|
|
22274
22281
|
_audioDeviceManager_js__WEBPACK_IMPORTED_MODULE_0__.audioDeviceManager.onAudioDeviceChange(
|
|
22275
22282
|
audioRemote,
|
|
22276
22283
|
(stream, deviceId) => {
|
|
22277
|
-
|
|
22278
|
-
if (trackChanged) {
|
|
22279
|
-
_audioDeviceManager_js__WEBPACK_IMPORTED_MODULE_0__.audioDeviceManager.currentAudioInputDeviceId = deviceId;
|
|
22284
|
+
SIPJSPhone.replaceSenderTrack(stream, deviceId, function (){
|
|
22280
22285
|
if (SIPJSPhone.audioInputDeviceChangeCallback) {
|
|
22281
22286
|
SIPJSPhone.audioInputDeviceChangeCallback(deviceId);
|
|
22282
|
-
}
|
|
22283
|
-
}
|
|
22287
|
+
}
|
|
22288
|
+
}, function(errorMessage) {
|
|
22289
|
+
logger.error("sipjsphone:ondevicechange: failed to replace track", errorMessage);
|
|
22290
|
+
});
|
|
22291
|
+
|
|
22292
|
+
|
|
22284
22293
|
},
|
|
22285
22294
|
(deviceId) => {
|
|
22286
22295
|
SIPJSPhone.changeAudioOutputDeviceForAdditionalAudioElement(deviceId);
|
|
@@ -22698,9 +22707,9 @@ const webrtcSIPPhoneEventDelegate = {
|
|
|
22698
22707
|
},
|
|
22699
22708
|
|
|
22700
22709
|
|
|
22701
|
-
onStatPeerConnectionIceConnectionStateChange: () => {
|
|
22710
|
+
onStatPeerConnectionIceConnectionStateChange: (iceConnectionState) => {
|
|
22702
22711
|
if(delegate) {
|
|
22703
|
-
delegate.onStatPeerConnectionIceConnectionStateChange();
|
|
22712
|
+
delegate.onStatPeerConnectionIceConnectionStateChange(iceConnectionState);
|
|
22704
22713
|
}
|
|
22705
22714
|
},
|
|
22706
22715
|
|
|
@@ -24367,6 +24376,8 @@ function ExDelegationHandler(exClient_) {
|
|
|
24367
24376
|
};
|
|
24368
24377
|
this.onStatPeerConnectionIceGatheringStateChange = function (iceGatheringState) {
|
|
24369
24378
|
logger.log("delegationHandler: onStatPeerConnectionIceGatheringStateChange\n");
|
|
24379
|
+
_listeners_Callback__WEBPACK_IMPORTED_MODULE_7__.sessionCallback.initializeSession(`ice_gathering_state_${iceGatheringState}`, exClient.callFromNumber);
|
|
24380
|
+
_listeners_Callback__WEBPACK_IMPORTED_MODULE_7__.sessionCallback.triggerSessionCallback();
|
|
24370
24381
|
};
|
|
24371
24382
|
this.onCallStatIceCandidate = function (ev, icestate) {
|
|
24372
24383
|
logger.log("delegationHandler: onCallStatIceCandidate\n");
|
|
@@ -24377,8 +24388,10 @@ function ExDelegationHandler(exClient_) {
|
|
|
24377
24388
|
this.onCallStatSignalingStateChange = function (cstate) {
|
|
24378
24389
|
logger.log("delegationHandler: onCallStatSignalingStateChange\n");
|
|
24379
24390
|
};
|
|
24380
|
-
this.onStatPeerConnectionIceConnectionStateChange = function () {
|
|
24391
|
+
this.onStatPeerConnectionIceConnectionStateChange = function (iceConnectionState) {
|
|
24381
24392
|
logger.log("delegationHandler: onStatPeerConnectionIceConnectionStateChange\n");
|
|
24393
|
+
_listeners_Callback__WEBPACK_IMPORTED_MODULE_7__.sessionCallback.initializeSession(`ice_connection_state_${iceConnectionState}`, exClient.callFromNumber);
|
|
24394
|
+
_listeners_Callback__WEBPACK_IMPORTED_MODULE_7__.sessionCallback.triggerSessionCallback();
|
|
24382
24395
|
};
|
|
24383
24396
|
this.onStatPeerConnectionConnectionStateChange = function () {
|
|
24384
24397
|
logger.log("delegationHandler: onStatPeerConnectionConnectionStateChange\n");
|
|
@@ -24388,6 +24401,8 @@ function ExDelegationHandler(exClient_) {
|
|
|
24388
24401
|
};
|
|
24389
24402
|
this.onGetUserMediaErrorCallstatCallback = function () {
|
|
24390
24403
|
logger.log("delegationHandler: onGetUserMediaErrorCallstatCallback\n");
|
|
24404
|
+
_listeners_Callback__WEBPACK_IMPORTED_MODULE_7__.sessionCallback.initializeSession(`media_permission_denied`, exClient.callFromNumber);
|
|
24405
|
+
_listeners_Callback__WEBPACK_IMPORTED_MODULE_7__.sessionCallback.triggerSessionCallback();
|
|
24391
24406
|
};
|
|
24392
24407
|
this.onCallStatAddStream = function () {
|
|
24393
24408
|
logger.log("delegationHandler: onCallStatAddStream\n");
|
|
@@ -24481,9 +24496,11 @@ class ExotelWebClient {
|
|
|
24481
24496
|
/*
|
|
24482
24497
|
Register the logger callback and emit the onLog event
|
|
24483
24498
|
*/
|
|
24499
|
+
|
|
24500
|
+
let exwebClientOb = this;
|
|
24484
24501
|
logger.registerLoggerCallback(function (type, message, args) {
|
|
24485
24502
|
_api_LogManager_js__WEBPACK_IMPORTED_MODULE_10__["default"].onLog(type, message, args);
|
|
24486
|
-
if (
|
|
24503
|
+
if (exwebClientOb.clientSDKLoggerCallback) exwebClientOb.clientSDKLoggerCallback("log", message, args);
|
|
24487
24504
|
});
|
|
24488
24505
|
}
|
|
24489
24506
|
initWebrtc = (sipAccountInfo_, RegisterEventCallBack, CallListenerCallback, SessionCallback, enableAutoAudioDeviceChangeHandling = false) => {
|
|
@@ -24808,6 +24825,12 @@ class ExotelWebClient {
|
|
|
24808
24825
|
registerAudioDeviceChangeCallback(audioInputDeviceChangeCallback, audioOutputDeviceChangeCallback, onDeviceChangeCallback) {
|
|
24809
24826
|
_exotel_npm_dev_webrtc_core_sdk__WEBPACK_IMPORTED_MODULE_8__.webrtcSIPPhone.registerAudioDeviceChangeCallback(audioInputDeviceChangeCallback, audioOutputDeviceChangeCallback, onDeviceChangeCallback);
|
|
24810
24827
|
}
|
|
24828
|
+
setEnableConsoleLogging(enable) {
|
|
24829
|
+
if (enable) {
|
|
24830
|
+
logger.log(`ExWebClient: setEnableConsoleLogging: ${enable}`);
|
|
24831
|
+
}
|
|
24832
|
+
logger.setEnableConsoleLogging(enable);
|
|
24833
|
+
}
|
|
24811
24834
|
}
|
|
24812
24835
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ExotelWebClient);
|
|
24813
24836
|
|