@exotel-npm-dev/webrtc-client-sdk 2.0.1 → 2.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exotel-npm-dev/webrtc-client-sdk",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "client sdk for webrtc based on webrtc core sdk",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -29,6 +29,6 @@
29
29
  "webpack-cli": "^4.10.0"
30
30
  },
31
31
  "dependencies": {
32
- "@exotel-npm-dev/webrtc-core-sdk": "^1.0.20"
32
+ "@exotel-npm-dev/webrtc-core-sdk": "^1.0.21"
33
33
  }
34
34
  }
@@ -242,7 +242,7 @@ export class ExotelWebClient {
242
242
 
243
243
 
244
244
  initWebrtc = (sipAccountInfo_,
245
- RegisterEventCallBack, CallListenerCallback, SessionCallback) => {
245
+ RegisterEventCallBack, CallListenerCallback, SessionCallback, enableAutoAudioDeviceChangeHandling=false) => {
246
246
 
247
247
  if (!this.eventListener) {
248
248
  this.eventListener = new ExotelVoiceClientListener();
@@ -260,6 +260,7 @@ export class ExotelWebClient {
260
260
  this.call = new Call();
261
261
  }
262
262
 
263
+ sipAccountInfo_.enableAutoAudioDeviceChangeHandling = enableAutoAudioDeviceChangeHandling;
263
264
  logger.log("ExWebClient: initWebrtc: Exotel Client Initialised with " + JSON.stringify(sipAccountInfo_))
264
265
  this.sipAccountInfo = sipAccountInfo_;
265
266
  if (!this.sipAccountInfo["userName"] || !this.sipAccountInfo["sipdomain"] || !this.sipAccountInfo["port"]) {
@@ -521,7 +522,7 @@ export class ExotelWebClient {
521
522
  //webRTCPhones[userName] = webRTC;
522
523
 
523
524
  /* New-Way */
524
- webrtcSIPPhone.registerPhone("sipjs", delegationHandler);
525
+ webrtcSIPPhone.registerPhone("sipjs", delegationHandler, sipAccountInfo.enableAutoAudioDeviceChangeHandling);
525
526
  webrtcSIPPhone.registerWebRTCClient(this.sipAccntInfo, synchronousHandler);
526
527
 
527
528
  /**
@@ -578,14 +579,14 @@ export class ExotelWebClient {
578
579
  });
579
580
  };
580
581
 
581
- changeAudioInputDevice(deviceId, onSuccess, onError) {
582
+ changeAudioInputDevice(deviceId, onSuccess, onError, forceDeviceChange = false) {
582
583
  logger.log(`ExWebClient: changeAudioInputDevice: Entry`);
583
- webrtcSIPPhone.changeAudioInputDevice(deviceId, onSuccess, onError);
584
+ webrtcSIPPhone.changeAudioInputDevice(deviceId, onSuccess, onError, forceDeviceChange);
584
585
  }
585
586
 
586
- changeAudioOutputDevice(deviceId, onSuccess, onError) {
587
+ changeAudioOutputDevice(deviceId, onSuccess, onError, forceDeviceChange = false) {
587
588
  logger.log(`ExWebClient: changeAudioOutputDevice: Entry`);
588
- webrtcSIPPhone.changeAudioOutputDevice(deviceId, onSuccess, onError);
589
+ webrtcSIPPhone.changeAudioOutputDevice(deviceId, onSuccess, onError, forceDeviceChange);
589
590
  }
590
591
 
591
592
  downloadLogs() {