@exotel-npm-dev/webrtc-client-sdk 3.0.5 → 3.0.7

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/exotelsdk.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * WebRTC CLient SIP version 3.0.5
3
+ * WebRTC CLient SIP version 3.0.7
4
4
  *
5
5
  */
6
6
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -16,11 +16,11 @@
16
16
  return /******/ (() => { // webpackBootstrap
17
17
  /******/ var __webpack_modules__ = ({
18
18
 
19
- /***/ "./node_modules/@exotel-npm-dev/webrtc-core-sdk/index.js":
19
+ /***/ "./node_modules/@exotel-npm-dev/webrtc-core-sdk/index.js"
20
20
  /*!***************************************************************!*\
21
21
  !*** ./node_modules/@exotel-npm-dev/webrtc-core-sdk/index.js ***!
22
22
  \***************************************************************/
23
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
23
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
24
24
 
25
25
  "use strict";
26
26
  __webpack_require__.r(__webpack_exports__);
@@ -32,13 +32,13 @@ __webpack_require__.r(__webpack_exports__);
32
32
 
33
33
 
34
34
 
35
- /***/ }),
35
+ /***/ },
36
36
 
37
- /***/ "./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/audioDeviceManager.js":
37
+ /***/ "./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/audioDeviceManager.js"
38
38
  /*!********************************************************************************!*\
39
39
  !*** ./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/audioDeviceManager.js ***!
40
40
  \********************************************************************************/
41
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
41
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
42
42
 
43
43
  "use strict";
44
44
  __webpack_require__.r(__webpack_exports__);
@@ -219,13 +219,13 @@ const audioDeviceManager = {
219
219
 
220
220
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (audioDeviceManager);
221
221
 
222
- /***/ }),
222
+ /***/ },
223
223
 
224
- /***/ "./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/coreSDKLogger.js":
224
+ /***/ "./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/coreSDKLogger.js"
225
225
  /*!***************************************************************************!*\
226
226
  !*** ./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/coreSDKLogger.js ***!
227
227
  \***************************************************************************/
228
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
228
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
229
229
 
230
230
  "use strict";
231
231
  __webpack_require__.r(__webpack_exports__);
@@ -296,13 +296,13 @@ const coreSDKLogger = {
296
296
 
297
297
 
298
298
 
299
- /***/ }),
299
+ /***/ },
300
300
 
301
- /***/ "./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/sip-0.20.0.js":
301
+ /***/ "./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/sip-0.20.0.js"
302
302
  /*!************************************************************************!*\
303
303
  !*** ./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/sip-0.20.0.js ***!
304
304
  \************************************************************************/
305
- /***/ (function(module) {
305
+ (module) {
306
306
 
307
307
  /*!
308
308
  *
@@ -20868,13 +20868,13 @@ const name = "sip.js";
20868
20868
  ;
20869
20869
  });
20870
20870
 
20871
- /***/ }),
20871
+ /***/ },
20872
20872
 
20873
- /***/ "./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/sipjsphone.js":
20873
+ /***/ "./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/sipjsphone.js"
20874
20874
  /*!************************************************************************!*\
20875
20875
  !*** ./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/sipjsphone.js ***!
20876
20876
  \************************************************************************/
20877
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
20877
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
20878
20878
 
20879
20879
  "use strict";
20880
20880
  __webpack_require__.r(__webpack_exports__);
@@ -20950,7 +20950,7 @@ class SIPJSPhone {
20950
20950
  this.isConnecting = false;
20951
20951
  this.isDisconnected = false;
20952
20952
  this.isMuted = false;
20953
- this.isHold = false;
20953
+ this.isOnHold = false;
20954
20954
  this.isCallActive = false;
20955
20955
  this.isCallEnded = false;
20956
20956
  this.isCallRejected = false;
@@ -20995,8 +20995,6 @@ class SIPJSPhone {
20995
20995
  this.isCallUnrestricted = false;
20996
20996
  this.isCallUnshackled = false;
20997
20997
  this.isCallUntrammeled = false;
20998
- this.bMicEnable = true;
20999
- this.bHoldEnable = false;
21000
20998
  this.register_flag = false;
21001
20999
  this.enableAutoAudioDeviceChangeHandling = false;
21002
21000
  this.addPreferredCodec = this.addPreferredCodec.bind(this);
@@ -21339,25 +21337,15 @@ class SIPJSPhone {
21339
21337
 
21340
21338
 
21341
21339
  phoneMuteButtonPressed: (sessionid) => {
21342
- logger.log(" sipjsphone: phoneMuteButtonPressed: bMicEnable, sessionid", this.bMicEnable, sessionid);
21343
- var s = this.ctxSip.Sessions[sessionid];
21344
-
21345
- if (this.bMicEnable) {
21346
- this.toggleMute(s, true);
21347
- this.bMicEnable = false;
21348
- } else {
21349
- this.toggleMute(s, false);
21350
- this.bMicEnable = true;
21351
- }
21340
+ logger.log(" sipjsphone: phoneMuteButtonPressed: sessionid", sessionid);
21341
+ this.toggleMute(sessionid);
21352
21342
  },
21353
21343
 
21354
21344
  //NL --Implement hold button start
21355
21345
  phoneMute: (sessionid, bMute) => {
21356
21346
  if (sessionid) {
21357
- var s = this.ctxSip.Sessions[sessionid];
21358
21347
  logger.log(" sipjsphone: phoneMute: bMute", bMute)
21359
- this.toggleMute(s, bMute);
21360
- this.bMicEnable = !bMute;
21348
+ this.muteActionBySessionID(sessionid, bMute);
21361
21349
  }
21362
21350
  else{
21363
21351
  logger.log(" sipjsphone: phoneMute: doing nothing as sessionid not found")
@@ -21367,24 +21355,22 @@ class SIPJSPhone {
21367
21355
 
21368
21356
  phoneHold: (sessionid, bHold) => {
21369
21357
  if (sessionid) {
21370
- var s = this.ctxSip.Sessions[sessionid];
21371
- logger.log("sipjsphone: phoneHold: bHold", bHold)
21372
- this.toggleHold(s, bHold);
21373
- this.bHoldEnable = bHold;
21358
+ logger.log("sipjsphone: phoneHold: bHold:", bHold, "sessionid:", sessionid)
21359
+ this.holdActionBySessionID(sessionid, bHold);
21360
+ }
21361
+ else{
21362
+ logger.log(" sipjsphone: phoneHold: doing nothing as sessionid not found")
21363
+
21374
21364
  }
21375
21365
  },
21376
21366
 
21377
21367
  phoneHoldButtonPressed: (sessionid) => {
21378
- if (sessionid) {
21379
- var s = this.ctxSip.Sessions[sessionid];
21380
- if (this.bHoldEnable) {
21381
- this.toggleHold(s, false);
21382
- this.bHoldEnable = false;
21383
- } else {
21384
- this.toggleHold(s, true);
21385
- this.bHoldEnable = true;
21368
+ logger.log("sipjsphone: phoneHoldButtonPressed: sessionid:", sessionid);
21369
+ if(!sessionid) {
21370
+ logger.log("sipjsphone: phoneHoldButtonPressed: invalid sessionid");
21371
+ return;
21386
21372
  }
21387
- }
21373
+ this.toggleHold(sessionid);
21388
21374
  },
21389
21375
  //NL --Implement hold button end
21390
21376
 
@@ -21547,6 +21533,7 @@ class SIPJSPhone {
21547
21533
  },
21548
21534
  displayName: this.txtDisplayName,
21549
21535
  hackWssInTransport: true,
21536
+ contactParams: {transport: "wss"},
21550
21537
  stunServers: ["stun:stun.l.google.com:19302"],
21551
21538
  hackIpInContact: true,
21552
21539
  forceRport: true,
@@ -21559,7 +21546,7 @@ class SIPJSPhone {
21559
21546
  sessionDescriptionHandlerFactoryOptions: {
21560
21547
  constraints: {
21561
21548
  audio:{
21562
- noiseSuppression: this.enableNoiseSuppression
21549
+ noiseSuppression: this.enableNoiseSuppression !== undefined ? this.enableNoiseSuppression : false
21563
21550
  },
21564
21551
  video: false
21565
21552
  }
@@ -21865,67 +21852,82 @@ destroySocketConnection() {
21865
21852
  this.register_flag = b;
21866
21853
  }
21867
21854
 
21868
- toggleMute(s, mute) {
21869
- let pc = s.sessionDescriptionHandler.peerConnection;
21870
- if (pc.getSenders) {
21871
- pc.getSenders().forEach((sender) => {
21872
- if (sender.track) {
21873
- sender.track.enabled = !mute;
21874
- }
21875
- });
21876
- } else {
21877
- pc.getLocalStreams().forEach((stream) => {
21878
- stream.getAudioTracks().forEach((track) => {
21879
- track.enabled = !mute;
21855
+ toggleMute(sessionid) {
21856
+ logger.log("sipjsphone: toggleMute: sessionid:", sessionid);
21857
+ let bMute = !this.isMuted;
21858
+ this.muteActionBySessionID(sessionid, bMute);
21859
+ }
21860
+
21861
+
21862
+ muteActionBySessionID(sessionid, bMute) {
21863
+
21864
+ logger.log("sipjsphone: muteActionBySessionID: sessionid:", sessionid, "bMute:", bMute);
21865
+
21866
+ if(bMute == this.isMuted) {
21867
+ logger.log("sipjsphone: muteActionBySessionID: already muted", bMute);
21868
+ return;
21869
+ }
21870
+ if(!sessionid) {
21871
+ logger.error("sipjsphone: muteActionBySessionID: invalid sessionid");
21872
+ return;
21873
+ }
21874
+ let s = this.ctxSip.Sessions[sessionid];
21875
+ if(!s) {
21876
+ logger.error("sipjsphone: muteActionBySessionID: invalid session");
21877
+ return;
21878
+ }
21879
+ let pc = s.sessionDescriptionHandler.peerConnection;
21880
+ if (pc.getSenders) {
21881
+ pc.getSenders().forEach((sender) => {
21882
+ if (sender.track) {
21883
+ sender.track.enabled = !bMute;
21884
+ }
21880
21885
  });
21881
- stream.getVideoTracks().forEach((track) => {
21882
- track.enabled = !mute;
21886
+ } else {
21887
+ pc.getLocalStreams().forEach((stream) => {
21888
+ stream.getAudioTracks().forEach((track) => {
21889
+ track.enabled = !bMute;
21890
+ });
21891
+ stream.getVideoTracks().forEach((track) => {
21892
+ track.enabled = !bMute;
21893
+ });
21883
21894
  });
21884
- });
21885
- }
21886
- if (mute) {
21887
- this.onMuted(s);
21888
- } else {
21889
- this.onUnmuted(s);
21895
+ }
21896
+ if (bMute) {
21897
+ this.onMuted(s);
21898
+ } else {
21899
+ this.onUnmuted(s);
21900
+ }
21890
21901
  }
21891
- }
21892
21902
 
21893
21903
 
21894
21904
  onMuted(s) {
21895
- logger.log(`[onMuted] Before: s.isMuted=${s && s.isMuted}, global isMuted=${this.isMuted}`);
21896
- this.webrtcSIPPhoneEventDelegate.onCallStatSipJsSessionEvent('muted');
21905
+ logger.log("sipjsphone: onMuted: sessionid:", s.id);
21897
21906
  if (s) s.isMuted = true;
21898
21907
  this.isMuted = true;
21899
- logger.log(`[onMuted] After: s.isMuted=${s && s.isMuted}, global isMuted=${this.isMuted}`);
21908
+ this.webrtcSIPPhoneEventDelegate.onCallStatSipJsSessionEvent('muted');
21900
21909
  this.ctxSip.setCallSessionStatus("Muted");
21901
21910
  }
21902
21911
 
21903
21912
  onUnmuted(s) {
21904
- logger.log(`[onUnmuted] Before: s.isMuted=${s && s.isMuted}, global isMuted=${this.isMuted}`);
21905
- this.webrtcSIPPhoneEventDelegate.onCallStatSipJsSessionEvent('unmuted');
21913
+ logger.log("sipjsphone: onUnmuted: sessionid:", s.id);
21906
21914
  if (s) s.isMuted = false;
21907
21915
  this.isMuted = false;
21908
- logger.log(`[onUnmuted] After: s.isMuted=${s && s.isMuted}, global isMuted=${this.isMuted}`);
21916
+ this.webrtcSIPPhoneEventDelegate.onCallStatSipJsSessionEvent('unmuted');
21909
21917
  this.ctxSip.setCallSessionStatus("Answered");
21910
21918
  }
21911
21919
 
21912
- onHold(s) {
21913
- //webrtcSIPPhoneEventDelegate.onCallStatSipJsSessionEvent('hold');
21914
- logger.warn(`[${s.id}] re-invite request was accepted`);
21915
- s.held = true;
21916
- this.enableSenderTracks(s, !s.held && !s.isMuted);
21917
- this.enableReceiverTracks(s, !s.held);
21918
- //this.ctxSip.setCallSessionStatus("Hold");
21920
+ onHoldUnholdSuccess(s, hold) {
21921
+ logger.info(`sipjsphone: onHoldUnholdSuccess: [${s.id}] : re-invite request was accepted for hold: ${hold}`);
21922
+ this.webrtcSIPPhoneEventDelegate.onCallStatSipJsSessionEvent('holdunhold_success');
21923
+ s.held = hold;
21924
+ this.isOnHold = hold;
21919
21925
  }
21920
21926
 
21921
- onUnhold(s) {
21922
- //webrtcSIPPhoneEventDelegate.onCallStatSipJsSessionEvent('unhold');
21923
- logger.warn(`[${s.id}] re-invite request was rejected`);
21924
- s.held = false;
21925
- this.enableSenderTracks(s, !s.held && !s.isMuted);
21926
- this.enableReceiverTracks(s, !s.held);
21927
- //this.ctxSip.setCallSessionStatus("Unhold");
21928
- }
21927
+ onHoldUnholdFailure(s, hold) {
21928
+ logger.info(`sipjsphone: onHoldUnholdFailure: [${s.id}] : re-invite request was rejected for hold: ${hold}`);
21929
+ this.webrtcSIPPhoneEventDelegate.onCallStatSipJsSessionEvent('holdunhold_failed');
21930
+ }
21929
21931
 
21930
21932
  /** Helper function to enable/disable media tracks. */
21931
21933
  enableReceiverTracks(s, enable) {
@@ -21965,28 +21967,47 @@ destroySocketConnection() {
21965
21967
  }
21966
21968
  }
21967
21969
 
21968
- toggleHold(s, hold) {
21969
- const options = {
21970
- requestDelegate: {
21971
- onAccept: () => {
21972
- this.onHold(s)
21970
+ toggleHold(sessionid) {
21971
+ logger.log("sipjsphone: toggleHold: sessionid:", sessionid);
21972
+ this.holdActionBySessionID(sessionid, !this.isOnHold);
21973
+ }
21974
+
21975
+ holdActionBySessionID(sessionid, hold) {
21976
+ logger.log("sipjsphone: holdActionBySessionID: hold:", hold, "sessionid:", sessionid);
21977
+
21978
+ if(hold == this.isOnHold) {
21979
+ logger.log("sipjsphone: holdActionBySessionID: already on hold", hold);
21980
+ return;
21981
+ }
21982
+ if (!sessionid) {
21983
+ logger.log("sipjsphone: holdActionBySessionID: invalid sessionid");
21984
+ return;
21985
+ }
21986
+ let s = this.ctxSip.Sessions[sessionid];
21987
+ if(!s) {
21988
+ logger.error("sipjsphone: holdActionBySessionID: invalid session");
21989
+ return;
21990
+ }
21991
+
21992
+
21993
+
21994
+ const options = {
21995
+ requestDelegate: {
21996
+ onAccept: () => {
21997
+ this.onHoldUnholdSuccess(s, hold);
21998
+ },
21999
+ onReject: () => {
22000
+ this.onHoldUnholdFailure(s, hold);
22001
+ }
21973
22002
  },
21974
- onReject: () => {
21975
- this.onUnhold(s)
22003
+ sessionDescriptionHandlerOptions: {
22004
+ hold: hold
21976
22005
  }
21977
- },
21978
- sessionDescriptionHandlerOptions: {
21979
- hold: hold
21980
- }
21981
- };
21982
- s.invite(options).then(() => {
21983
- // preemptively enable/disable tracks
21984
- this.enableReceiverTracks(s, !hold);
21985
- this.enableSenderTracks(s, !hold && !s.isMuted);
21986
- }).catch((error) => {
21987
- logger.error(`Error in hold request [${s.id}]`);
21988
- });
21989
- }
22006
+ };
22007
+ s.invite(options).catch((error) => {
22008
+ logger.error(`sipjsphone: holdActionBySessionID: Error in hold request [${sessionid}] error:`, error);
22009
+ });
22010
+ }
21990
22011
 
21991
22012
 
21992
22013
  assignStream(stream, element) {
@@ -22153,14 +22174,20 @@ destroySocketConnection() {
22153
22174
  }
22154
22175
 
22155
22176
  holdCall() {
22177
+ logger.log("sipjsphone: holdCall: entry");
22156
22178
  if (this.ctxSip.callActiveID) {
22157
22179
  this.ctxSip.phoneHoldButtonPressed(this.ctxSip.callActiveID);
22180
+ } else {
22181
+ logger.log("sipjsphone: holdCall: No active session");
22158
22182
  }
22159
22183
  }
22160
22184
 
22161
22185
  sipHold(bHold) {
22186
+ logger.log("sipjsphone: sipHold: bHold: ", bHold);
22162
22187
  if (this.ctxSip.callActiveID) {
22163
22188
  this.ctxSip.phoneHold(this.ctxSip.callActiveID, bHold);
22189
+ } else {
22190
+ logger.log("sipjsphone: sipHold: No active session");
22164
22191
  }
22165
22192
  }
22166
22193
 
@@ -22176,6 +22203,18 @@ destroySocketConnection() {
22176
22203
  return this.isMuted;
22177
22204
  }
22178
22205
 
22206
+ getHoldStatus() {
22207
+ logger.log("sipjsphone: getHoldStatus: isOnHold:", this.isOnHold);
22208
+ if (this.ctxSip && this.ctxSip.callActiveID && this.ctxSip.Sessions && this.ctxSip.Sessions[this.ctxSip.callActiveID]) {
22209
+ const sessionHold = !!this.ctxSip.Sessions[this.ctxSip.callActiveID].held;
22210
+ logger.log(`[getHoldStatus] sessionHold: ${sessionHold}, global isOnHold: ${this.isOnHold}`);
22211
+ return sessionHold;
22212
+ } else {
22213
+ logger.log(`[getHoldStatus] No active session, global onHold: ${this.isOnHold}`);
22214
+ return this.isOnHold;
22215
+ }
22216
+ }
22217
+
22179
22218
  setPreferredCodec(codecName) {
22180
22219
  logger.log("sipjsphone:setPreferredCodec entry");
22181
22220
  const codecPayloadTypes = {
@@ -22434,8 +22473,10 @@ destroySocketConnection() {
22434
22473
  // Reset mute state at the start of every call
22435
22474
  logger.log(`[onInvitationSessionAccepted] Resetting mute state. Before: newSess.isMuted=${newSess && newSess.isMuted}, global isMuted=${this.isMuted}`);
22436
22475
  this.isMuted = false;
22476
+ this.isOnHold = false;
22437
22477
  if (newSess && newSess.isMuted !== undefined) {
22438
22478
  newSess.isMuted = false;
22479
+ newSess.held = false;
22439
22480
  }
22440
22481
  logger.log(`[onInvitationSessionAccepted] After reset: newSess.isMuted=${newSess && newSess.isMuted}, global isMuted=${this.isMuted}`);
22441
22482
  this.ctxSip.Stream = newSess.sessionDescriptionHandler.localMediaStream;
@@ -22594,57 +22635,57 @@ destroySocketConnection() {
22594
22635
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SIPJSPhone);
22595
22636
 
22596
22637
 
22597
- /***/ }),
22638
+ /***/ },
22598
22639
 
22599
- /***/ "./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/static/beep.wav":
22640
+ /***/ "./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/static/beep.wav"
22600
22641
  /*!**************************************************************************!*\
22601
22642
  !*** ./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/static/beep.wav ***!
22602
22643
  \**************************************************************************/
22603
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
22644
+ (module, __unused_webpack_exports, __webpack_require__) {
22604
22645
 
22605
22646
  "use strict";
22606
22647
  module.exports = __webpack_require__.p + "beep.wav";
22607
22648
 
22608
- /***/ }),
22649
+ /***/ },
22609
22650
 
22610
- /***/ "./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/static/dtmf.wav":
22651
+ /***/ "./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/static/dtmf.wav"
22611
22652
  /*!**************************************************************************!*\
22612
22653
  !*** ./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/static/dtmf.wav ***!
22613
22654
  \**************************************************************************/
22614
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
22655
+ (module, __unused_webpack_exports, __webpack_require__) {
22615
22656
 
22616
22657
  "use strict";
22617
22658
  module.exports = __webpack_require__.p + "dtmf.wav";
22618
22659
 
22619
- /***/ }),
22660
+ /***/ },
22620
22661
 
22621
- /***/ "./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/static/ringbacktone.wav":
22662
+ /***/ "./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/static/ringbacktone.wav"
22622
22663
  /*!**********************************************************************************!*\
22623
22664
  !*** ./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/static/ringbacktone.wav ***!
22624
22665
  \**********************************************************************************/
22625
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
22666
+ (module, __unused_webpack_exports, __webpack_require__) {
22626
22667
 
22627
22668
  "use strict";
22628
22669
  module.exports = __webpack_require__.p + "ringbacktone.wav";
22629
22670
 
22630
- /***/ }),
22671
+ /***/ },
22631
22672
 
22632
- /***/ "./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/static/ringtone.wav":
22673
+ /***/ "./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/static/ringtone.wav"
22633
22674
  /*!******************************************************************************!*\
22634
22675
  !*** ./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/static/ringtone.wav ***!
22635
22676
  \******************************************************************************/
22636
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
22677
+ (module, __unused_webpack_exports, __webpack_require__) {
22637
22678
 
22638
22679
  "use strict";
22639
22680
  module.exports = __webpack_require__.p + "ringtone.wav";
22640
22681
 
22641
- /***/ }),
22682
+ /***/ },
22642
22683
 
22643
- /***/ "./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/webrtcSIPPhone.js":
22684
+ /***/ "./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/webrtcSIPPhone.js"
22644
22685
  /*!****************************************************************************!*\
22645
22686
  !*** ./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/webrtcSIPPhone.js ***!
22646
22687
  \****************************************************************************/
22647
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
22688
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
22648
22689
 
22649
22690
  "use strict";
22650
22691
  __webpack_require__.r(__webpack_exports__);
@@ -22697,12 +22738,19 @@ class WebrtcSIPPhone {
22697
22738
 
22698
22739
  this.webrtcSIPPhoneEventDelegate.registerDelegate(delegate);
22699
22740
 
22741
+ // Preserve noise suppression setting from existing phone instance if it exists
22742
+ const existingNoiseSuppression = this.phone?.enableNoiseSuppression;
22743
+
22700
22744
  switch (engine) {
22701
22745
  case "sipjs":
22702
22746
  this.phone = new _sipjsphone__WEBPACK_IMPORTED_MODULE_1__["default"](
22703
22747
  this.webrtcSIPPhoneEventDelegate,
22704
22748
  this.username
22705
22749
  );
22750
+ // Restore noise suppression setting if it was set on the previous instance
22751
+ if (existingNoiseSuppression) {
22752
+ this.phone.setNoiseSuppression(existingNoiseSuppression);
22753
+ }
22706
22754
  break;
22707
22755
  default:
22708
22756
  logger.log("webrtcSIPPhone: Unsupported engine type:", engine);
@@ -22785,6 +22833,11 @@ class WebrtcSIPPhone {
22785
22833
  return this.phone.getMicMuteStatus();
22786
22834
  }
22787
22835
 
22836
+ getHoldStatus() {
22837
+ logger.log("webrtcSIPPhone: getHoldStatus entry");
22838
+ return this.phone.getHoldStatus();
22839
+ }
22840
+
22788
22841
  muteAction (bMute){
22789
22842
  logger.log("webrtcSIPPhone: muteAction: ",bMute);
22790
22843
  this.phone.sipMute(bMute);
@@ -22949,13 +23002,13 @@ class WebrtcSIPPhone {
22949
23002
 
22950
23003
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (WebrtcSIPPhone);
22951
23004
 
22952
- /***/ }),
23005
+ /***/ },
22953
23006
 
22954
- /***/ "./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/webrtcSIPPhoneEventDelegate.js":
23007
+ /***/ "./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/webrtcSIPPhoneEventDelegate.js"
22955
23008
  /*!*****************************************************************************************!*\
22956
23009
  !*** ./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/webrtcSIPPhoneEventDelegate.js ***!
22957
23010
  \*****************************************************************************************/
22958
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
23011
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
22959
23012
 
22960
23013
  "use strict";
22961
23014
  __webpack_require__.r(__webpack_exports__);
@@ -23214,13 +23267,13 @@ class WebrtcSIPPhoneEventDelegate {
23214
23267
 
23215
23268
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (WebrtcSIPPhoneEventDelegate);
23216
23269
 
23217
- /***/ }),
23270
+ /***/ },
23218
23271
 
23219
- /***/ "./node_modules/uuid/dist/esm-browser/native.js":
23272
+ /***/ "./node_modules/uuid/dist/esm-browser/native.js"
23220
23273
  /*!******************************************************!*\
23221
23274
  !*** ./node_modules/uuid/dist/esm-browser/native.js ***!
23222
23275
  \******************************************************/
23223
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
23276
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
23224
23277
 
23225
23278
  "use strict";
23226
23279
  __webpack_require__.r(__webpack_exports__);
@@ -23232,13 +23285,13 @@ const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.
23232
23285
  randomUUID
23233
23286
  });
23234
23287
 
23235
- /***/ }),
23288
+ /***/ },
23236
23289
 
23237
- /***/ "./node_modules/uuid/dist/esm-browser/regex.js":
23290
+ /***/ "./node_modules/uuid/dist/esm-browser/regex.js"
23238
23291
  /*!*****************************************************!*\
23239
23292
  !*** ./node_modules/uuid/dist/esm-browser/regex.js ***!
23240
23293
  \*****************************************************/
23241
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
23294
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
23242
23295
 
23243
23296
  "use strict";
23244
23297
  __webpack_require__.r(__webpack_exports__);
@@ -23247,13 +23300,13 @@ __webpack_require__.r(__webpack_exports__);
23247
23300
  /* harmony export */ });
23248
23301
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i);
23249
23302
 
23250
- /***/ }),
23303
+ /***/ },
23251
23304
 
23252
- /***/ "./node_modules/uuid/dist/esm-browser/rng.js":
23305
+ /***/ "./node_modules/uuid/dist/esm-browser/rng.js"
23253
23306
  /*!***************************************************!*\
23254
23307
  !*** ./node_modules/uuid/dist/esm-browser/rng.js ***!
23255
23308
  \***************************************************/
23256
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
23309
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
23257
23310
 
23258
23311
  "use strict";
23259
23312
  __webpack_require__.r(__webpack_exports__);
@@ -23279,13 +23332,13 @@ function rng() {
23279
23332
  return getRandomValues(rnds8);
23280
23333
  }
23281
23334
 
23282
- /***/ }),
23335
+ /***/ },
23283
23336
 
23284
- /***/ "./node_modules/uuid/dist/esm-browser/stringify.js":
23337
+ /***/ "./node_modules/uuid/dist/esm-browser/stringify.js"
23285
23338
  /*!*********************************************************!*\
23286
23339
  !*** ./node_modules/uuid/dist/esm-browser/stringify.js ***!
23287
23340
  \*********************************************************/
23288
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
23341
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
23289
23342
 
23290
23343
  "use strict";
23291
23344
  __webpack_require__.r(__webpack_exports__);
@@ -23328,13 +23381,13 @@ function stringify(arr, offset = 0) {
23328
23381
 
23329
23382
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (stringify);
23330
23383
 
23331
- /***/ }),
23384
+ /***/ },
23332
23385
 
23333
- /***/ "./node_modules/uuid/dist/esm-browser/v4.js":
23386
+ /***/ "./node_modules/uuid/dist/esm-browser/v4.js"
23334
23387
  /*!**************************************************!*\
23335
23388
  !*** ./node_modules/uuid/dist/esm-browser/v4.js ***!
23336
23389
  \**************************************************/
23337
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
23390
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
23338
23391
 
23339
23392
  "use strict";
23340
23393
  __webpack_require__.r(__webpack_exports__);
@@ -23374,13 +23427,13 @@ function v4(options, buf, offset) {
23374
23427
 
23375
23428
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (v4);
23376
23429
 
23377
- /***/ }),
23430
+ /***/ },
23378
23431
 
23379
- /***/ "./node_modules/uuid/dist/esm-browser/validate.js":
23432
+ /***/ "./node_modules/uuid/dist/esm-browser/validate.js"
23380
23433
  /*!********************************************************!*\
23381
23434
  !*** ./node_modules/uuid/dist/esm-browser/validate.js ***!
23382
23435
  \********************************************************/
23383
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
23436
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
23384
23437
 
23385
23438
  "use strict";
23386
23439
  __webpack_require__.r(__webpack_exports__);
@@ -23396,13 +23449,13 @@ function validate(uuid) {
23396
23449
 
23397
23450
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (validate);
23398
23451
 
23399
- /***/ }),
23452
+ /***/ },
23400
23453
 
23401
- /***/ "./src/api/LogManager.js":
23454
+ /***/ "./src/api/LogManager.js"
23402
23455
  /*!*******************************!*\
23403
23456
  !*** ./src/api/LogManager.js ***!
23404
23457
  \*******************************/
23405
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
23458
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
23406
23459
 
23407
23460
  "use strict";
23408
23461
  __webpack_require__.r(__webpack_exports__);
@@ -23444,13 +23497,13 @@ const LogManager = {
23444
23497
  };
23445
23498
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LogManager);
23446
23499
 
23447
- /***/ }),
23500
+ /***/ },
23448
23501
 
23449
- /***/ "./src/api/callAPI/Call.js":
23502
+ /***/ "./src/api/callAPI/Call.js"
23450
23503
  /*!*********************************!*\
23451
23504
  !*** ./src/api/callAPI/Call.js ***!
23452
23505
  \*********************************/
23453
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
23506
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
23454
23507
 
23455
23508
  "use strict";
23456
23509
  __webpack_require__.r(__webpack_exports__);
@@ -23515,24 +23568,34 @@ function Call(webrtcSIPPhone) {
23515
23568
  /**
23516
23569
  * When user clicks on hold
23517
23570
  */
23518
- logger.log('Hold toggle clicked');
23571
+ logger.log('Call: HoldToggle');
23519
23572
  webrtcSIPPhone.holdCall();
23520
23573
  };
23521
23574
  this.Hold = function () {
23522
23575
  /**
23523
23576
  * When user clicks on hold
23524
23577
  */
23525
- logger.log('hold clicked');
23526
- let dummyFlag = true;
23527
- webrtcSIPPhone.holdCall();
23578
+ logger.log('Call: Hold');
23579
+ var isOnHold = webrtcSIPPhone.getHoldStatus();
23580
+ logger.log('Call: Hold: isOnHold: ', isOnHold);
23581
+ if (!isOnHold) {
23582
+ webrtcSIPPhone.holdAction(true);
23583
+ } else {
23584
+ logger.log('Call: Hold: Already on hold');
23585
+ }
23528
23586
  };
23529
23587
  this.UnHold = function () {
23530
23588
  /**
23531
23589
  * When user clicks on hold
23532
23590
  */
23533
- logger.log('unhold clicked');
23534
- let dummyFlag = true;
23535
- webrtcSIPPhone.holdCall();
23591
+ logger.log('Call: UnHold');
23592
+ var isOnHold = webrtcSIPPhone.getHoldStatus();
23593
+ logger.log('Call: UnHold: isOnHold: ', isOnHold);
23594
+ if (isOnHold) {
23595
+ webrtcSIPPhone.holdAction(false);
23596
+ } else {
23597
+ logger.log('Call: UnHold: Already on hold');
23598
+ }
23536
23599
  };
23537
23600
  this.callDetails = function () {
23538
23601
  /**
@@ -23549,13 +23612,13 @@ function Call(webrtcSIPPhone) {
23549
23612
  };
23550
23613
  }
23551
23614
 
23552
- /***/ }),
23615
+ /***/ },
23553
23616
 
23554
- /***/ "./src/api/callAPI/CallDetails.js":
23617
+ /***/ "./src/api/callAPI/CallDetails.js"
23555
23618
  /*!****************************************!*\
23556
23619
  !*** ./src/api/callAPI/CallDetails.js ***!
23557
23620
  \****************************************/
23558
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
23621
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
23559
23622
 
23560
23623
  "use strict";
23561
23624
  __webpack_require__.r(__webpack_exports__);
@@ -23639,13 +23702,13 @@ var CallDetails = {
23639
23702
  }
23640
23703
  };
23641
23704
 
23642
- /***/ }),
23705
+ /***/ },
23643
23706
 
23644
- /***/ "./src/api/omAPI/Diagnostics.js":
23707
+ /***/ "./src/api/omAPI/Diagnostics.js"
23645
23708
  /*!**************************************!*\
23646
23709
  !*** ./src/api/omAPI/Diagnostics.js ***!
23647
23710
  \**************************************/
23648
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
23711
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
23649
23712
 
23650
23713
  "use strict";
23651
23714
  __webpack_require__.r(__webpack_exports__);
@@ -24196,13 +24259,13 @@ var ameyoWebRTCTroubleshooter = {
24196
24259
 
24197
24260
  //ameyoWebRTCTroubleshooter.getBrowserData();
24198
24261
 
24199
- /***/ }),
24262
+ /***/ },
24200
24263
 
24201
- /***/ "./src/api/omAPI/DiagnosticsListener.js":
24264
+ /***/ "./src/api/omAPI/DiagnosticsListener.js"
24202
24265
  /*!**********************************************!*\
24203
24266
  !*** ./src/api/omAPI/DiagnosticsListener.js ***!
24204
24267
  \**********************************************/
24205
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
24268
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
24206
24269
 
24207
24270
  "use strict";
24208
24271
  __webpack_require__.r(__webpack_exports__);
@@ -24318,13 +24381,13 @@ class DiagnosticsListener {
24318
24381
  }
24319
24382
  }
24320
24383
 
24321
- /***/ }),
24384
+ /***/ },
24322
24385
 
24323
- /***/ "./src/api/registerAPI/RegisterListener.js":
24386
+ /***/ "./src/api/registerAPI/RegisterListener.js"
24324
24387
  /*!*************************************************!*\
24325
24388
  !*** ./src/api/registerAPI/RegisterListener.js ***!
24326
24389
  \*************************************************/
24327
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
24390
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
24328
24391
 
24329
24392
  "use strict";
24330
24393
  __webpack_require__.r(__webpack_exports__);
@@ -24379,13 +24442,13 @@ function UnRegister(sipAccountInfo, exWebClient) {
24379
24442
  }
24380
24443
  }
24381
24444
 
24382
- /***/ }),
24445
+ /***/ },
24383
24446
 
24384
- /***/ "./src/listeners/CallCtrlerDummy.js":
24447
+ /***/ "./src/listeners/CallCtrlerDummy.js"
24385
24448
  /*!******************************************!*\
24386
24449
  !*** ./src/listeners/CallCtrlerDummy.js ***!
24387
24450
  \******************************************/
24388
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
24451
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
24389
24452
 
24390
24453
  "use strict";
24391
24454
  __webpack_require__.r(__webpack_exports__);
@@ -24401,13 +24464,13 @@ function CallController() {
24401
24464
  };
24402
24465
  }
24403
24466
 
24404
- /***/ }),
24467
+ /***/ },
24405
24468
 
24406
- /***/ "./src/listeners/CallListener.js":
24469
+ /***/ "./src/listeners/CallListener.js"
24407
24470
  /*!***************************************!*\
24408
24471
  !*** ./src/listeners/CallListener.js ***!
24409
24472
  \***************************************/
24410
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
24473
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
24411
24474
 
24412
24475
  "use strict";
24413
24476
  __webpack_require__.r(__webpack_exports__);
@@ -24444,13 +24507,13 @@ class CallListener {
24444
24507
  }
24445
24508
  }
24446
24509
 
24447
- /***/ }),
24510
+ /***/ },
24448
24511
 
24449
- /***/ "./src/listeners/Callback.js":
24512
+ /***/ "./src/listeners/Callback.js"
24450
24513
  /*!***********************************!*\
24451
24514
  !*** ./src/listeners/Callback.js ***!
24452
24515
  \***********************************/
24453
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
24516
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
24454
24517
 
24455
24518
  "use strict";
24456
24519
  __webpack_require__.r(__webpack_exports__);
@@ -24669,13 +24732,13 @@ var timerSession = {
24669
24732
  }
24670
24733
  };
24671
24734
 
24672
- /***/ }),
24735
+ /***/ },
24673
24736
 
24674
- /***/ "./src/listeners/ExWebClient.js":
24737
+ /***/ "./src/listeners/ExWebClient.js"
24675
24738
  /*!**************************************!*\
24676
24739
  !*** ./src/listeners/ExWebClient.js ***!
24677
24740
  \**************************************/
24678
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
24741
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
24679
24742
 
24680
24743
  "use strict";
24681
24744
  __webpack_require__.r(__webpack_exports__);
@@ -24769,6 +24832,8 @@ class ExDelegationHandler {
24769
24832
  }
24770
24833
  onCallStatSipJsSessionEvent(ev) {
24771
24834
  logger.log("delegationHandler: onCallStatSipJsSessionEvent", ev);
24835
+ this.sessionCallback.initializeSession(ev, this.exClient.callFromNumber);
24836
+ this.sessionCallback.triggerSessionCallback();
24772
24837
  }
24773
24838
  sendWebRTCEventsToFSM(eventType, sipMethod) {
24774
24839
  logger.log("delegationHandler: sendWebRTCEventsToFSM\n");
@@ -25171,7 +25236,8 @@ class ExotelWebClient {
25171
25236
  var synchronousHandler = new ExSynchronousHandler();
25172
25237
  var delegationHandler = new ExDelegationHandler(this);
25173
25238
  var userName = this.userName;
25174
- this.webrtcSIPPhone.registerPhone("sipjs", delegationHandler, this.sipAccountInfo.enableAutoAudioDeviceChangeHandling);
25239
+
25240
+ //this.webrtcSIPPhone.registerPhone("sipjs", delegationHandler, this.sipAccountInfo.enableAutoAudioDeviceChangeHandling);
25175
25241
  this.webrtcSIPPhone.registerWebRTCClient(this.sipAccntInfo, synchronousHandler);
25176
25242
  phonePool[this.userName] = this.webrtcSIPPhone;
25177
25243
  intervalIDMap.set(userName, intervalId);
@@ -25283,13 +25349,13 @@ logger.registerLoggerCallback((type, message, args) => {
25283
25349
 
25284
25350
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ExotelWebClient);
25285
25351
 
25286
- /***/ }),
25352
+ /***/ },
25287
25353
 
25288
- /***/ "./src/listeners/ExotelVoiceClientListener.js":
25354
+ /***/ "./src/listeners/ExotelVoiceClientListener.js"
25289
25355
  /*!****************************************************!*\
25290
25356
  !*** ./src/listeners/ExotelVoiceClientListener.js ***!
25291
25357
  \****************************************************/
25292
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
25358
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
25293
25359
 
25294
25360
  "use strict";
25295
25361
  __webpack_require__.r(__webpack_exports__);
@@ -25347,13 +25413,13 @@ class ExotelVoiceClientListener {
25347
25413
  }
25348
25414
  }
25349
25415
 
25350
- /***/ }),
25416
+ /***/ },
25351
25417
 
25352
- /***/ "./src/listeners/SessionListeners.js":
25418
+ /***/ "./src/listeners/SessionListeners.js"
25353
25419
  /*!*******************************************!*\
25354
25420
  !*** ./src/listeners/SessionListeners.js ***!
25355
25421
  \*******************************************/
25356
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
25422
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
25357
25423
 
25358
25424
  "use strict";
25359
25425
  __webpack_require__.r(__webpack_exports__);
@@ -25492,7 +25558,7 @@ class SessionListener {
25492
25558
  }
25493
25559
  }
25494
25560
 
25495
- /***/ })
25561
+ /***/ }
25496
25562
 
25497
25563
  /******/ });
25498
25564
  /************************************************************************/
@@ -25506,6 +25572,12 @@ class SessionListener {
25506
25572
  /******/ if (cachedModule !== undefined) {
25507
25573
  /******/ return cachedModule.exports;
25508
25574
  /******/ }
25575
+ /******/ // Check if module exists (development only)
25576
+ /******/ if (__webpack_modules__[moduleId] === undefined) {
25577
+ /******/ var e = new Error("Cannot find module '" + moduleId + "'");
25578
+ /******/ e.code = 'MODULE_NOT_FOUND';
25579
+ /******/ throw e;
25580
+ /******/ }
25509
25581
  /******/ // Create a new module (and put it into the cache)
25510
25582
  /******/ var module = __webpack_module_cache__[moduleId] = {
25511
25583
  /******/ // no module.id needed