@exotel-npm-dev/webrtc-client-sdk 1.0.17 → 1.0.19

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": "1.0.17",
3
+ "version": "1.0.19",
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.16"
32
+ "@exotel-npm-dev/webrtc-core-sdk": "^1.0.17"
33
33
  }
34
34
  }
@@ -7,7 +7,7 @@ var logger = webrtcSIPPhone.getLogger();
7
7
  * @param {*} sipAccountInfo
8
8
  * @param {*} exWebClient
9
9
  */
10
- export function DoRegister(sipAccountInfo, exWebClient) {
10
+ export function DoRegister(sipAccountInfo, exWebClient, delay = 500) {
11
11
  /**
12
12
  * When user registers the agent phone for the first time, register your callback onto webrtc client
13
13
  */
@@ -16,15 +16,14 @@ export function DoRegister(sipAccountInfo, exWebClient) {
16
16
  * CHANGE IS REQUIRED - in the initialize function provision is to be given to pass Callback functions as arguments
17
17
  */
18
18
  try {
19
- setTimeout(function() {
19
+ setTimeout(function () {
20
20
  exWebClient.initialize(userContext,
21
21
  sipAccountInfo.domain, //hostname
22
22
  sipAccountInfo.userName, //subscriberName
23
23
  sipAccountInfo.displayname,//displayName
24
24
  sipAccountInfo.accountSid,//accountSid
25
25
  '', sipAccountInfo); // subscriberToken
26
- }, 500);
27
-
26
+ }, delay);
28
27
  } catch (e) {
29
28
  logger.log("Register failed ", e)
30
29
  }
@@ -254,7 +254,7 @@ export class ExotelWebClient {
254
254
 
255
255
  DoRegister = () => {
256
256
  logger.log("ExWebClient:DoRegister Entry")
257
- if (!this.isReadyToRegister){
257
+ if (!this.isReadyToRegister) {
258
258
  logger.warn("ExWebClient:DoRegister SDK is not ready to register");
259
259
  return false;
260
260
  }
@@ -360,7 +360,7 @@ export class ExotelWebClient {
360
360
  }
361
361
  if (this.shouldAutoRetry) {
362
362
  logger.log("ExWebClient:registerEventCallback Autoretrying");
363
- DoRegisterRL(this.sipAccountInfo, this);
363
+ DoRegisterRL(this.sipAccountInfo, this, 5000);
364
364
  }
365
365
  } else if (event === "sent_request") {
366
366
  /**
@@ -405,7 +405,7 @@ export class ExotelWebClient {
405
405
  this.shouldAutoRetry = false;
406
406
  this.unregisterInitiated = true;
407
407
  if (!this.registrationInProgress) {
408
- setTimeout(function() {
408
+ setTimeout(function () {
409
409
  webrtcSIPPhone.sipUnRegisterWebRTC();
410
410
  }, 500);
411
411
  }
@@ -566,7 +566,7 @@ export class ExotelWebClient {
566
566
  }
567
567
 
568
568
  setPreferredCodec(codecName) {
569
- logger.log("ExWebClient:setPreferredCodec entry");
569
+ logger.log("ExWebClient:setPreferredCodec entry");
570
570
  webrtcSIPPhone.setPreferredCodec(codecName);
571
571
  }
572
572
 
@@ -574,8 +574,8 @@ export class ExotelWebClient {
574
574
  logger.registerLoggerCallback(callback);
575
575
  }
576
576
 
577
- registerAudioDeviceChangeCallback(audioInputDeviceChangeCallback, audioOutputDeviceChangeCallback) {
578
- webrtcSIPPhone.registerAudioDeviceChangeCallback(audioInputDeviceChangeCallback, audioOutputDeviceChangeCallback);
577
+ registerAudioDeviceChangeCallback(audioInputDeviceChangeCallback, audioOutputDeviceChangeCallback, onDeviceChangeCallback) {
578
+ webrtcSIPPhone.registerAudioDeviceChangeCallback(audioInputDeviceChangeCallback, audioOutputDeviceChangeCallback, onDeviceChangeCallback);
579
579
  }
580
580
  }
581
581