@exotel-npm-dev/webrtc-client-sdk 3.0.2 → 3.0.4
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 +6 -0
- package/dist/exotelsdk.js +204 -110
- package/dist/exotelsdk.js.map +1 -1
- package/package.json +2 -2
- package/src/listeners/ExWebClient.js +48 -19
package/Changelog
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
Change Log
|
|
2
2
|
|
|
3
|
+
## v3.0.4 16 September, 2025
|
|
4
|
+
-[VST-1093] Enabled support for noise suppression
|
|
5
|
+
|
|
6
|
+
## v3.0.3 15 September, 2025
|
|
7
|
+
-[VST-1063] granular control over different audio streams, added static registerLogger method for logger callback registration
|
|
8
|
+
|
|
3
9
|
## v3.0.2 27 August, 2025
|
|
4
10
|
-[VST-1063] prevent exotel / sipjs from throwing logs in the console based on a flag, added missing iceconnectionstate in session event callback, make auto audio device change handling configurable and fixing Missing sent_request event in registerCallback
|
|
5
11
|
|
package/dist/exotelsdk.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
*
|
|
3
|
-
* WebRTC CLient SIP version 3.0.
|
|
3
|
+
* WebRTC CLient SIP version 3.0.4
|
|
4
4
|
*
|
|
5
5
|
*/
|
|
6
6
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
@@ -50,6 +50,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
const logger = _coreSDKLogger__WEBPACK_IMPORTED_MODULE_0__["default"];
|
|
53
|
+
const AudioManagerCtx = window.AudioContext || window.webkitAudioContext;
|
|
53
54
|
const audioDeviceManager = {
|
|
54
55
|
resetInputDevice: false,
|
|
55
56
|
resetOutputDevice: false,
|
|
@@ -57,6 +58,7 @@ const audioDeviceManager = {
|
|
|
57
58
|
currentAudioOutputDeviceId: "default",
|
|
58
59
|
mediaDevices: [],
|
|
59
60
|
enableAutoAudioDeviceChangeHandling: false,
|
|
61
|
+
webAudioCtx : new AudioManagerCtx(),
|
|
60
62
|
// Method to set the resetInputDevice flag
|
|
61
63
|
setResetInputDeviceFlag(value) {
|
|
62
64
|
this.resetInputDevice = value;
|
|
@@ -186,6 +188,33 @@ const audioDeviceManager = {
|
|
|
186
188
|
if (callback) callback();
|
|
187
189
|
},
|
|
188
190
|
|
|
191
|
+
configureAudioGainNode(sourceNode) {
|
|
192
|
+
logger.log("audioDeviceManager:configureAudioGainNode entry");
|
|
193
|
+
let gainNode = this.webAudioCtx.createGain();
|
|
194
|
+
|
|
195
|
+
sourceNode.connect(gainNode).connect(this.webAudioCtx.destination);
|
|
196
|
+
return gainNode;
|
|
197
|
+
},
|
|
198
|
+
|
|
199
|
+
createAndConfigureAudioGainNode(audioElement) {
|
|
200
|
+
|
|
201
|
+
logger.log("audioDeviceManager:createAndConfigureAudioGainNode entry for audioElement", audioElement);
|
|
202
|
+
// get audio track from audio element
|
|
203
|
+
let sourceNode = this.webAudioCtx.createMediaElementSource(audioElement);
|
|
204
|
+
// Create a GainNode
|
|
205
|
+
let gainNode = this.configureAudioGainNode(sourceNode);
|
|
206
|
+
|
|
207
|
+
// resume audio context when audio element is played
|
|
208
|
+
audioElement.addEventListener("play", () => {
|
|
209
|
+
if (this.webAudioCtx.state === "suspended") {
|
|
210
|
+
this.webAudioCtx.resume();
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
return gainNode;
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
}
|
|
217
|
+
|
|
189
218
|
};
|
|
190
219
|
|
|
191
220
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (audioDeviceManager);
|
|
@@ -20850,8 +20879,7 @@ const name = "sip.js";
|
|
|
20850
20879
|
"use strict";
|
|
20851
20880
|
__webpack_require__.r(__webpack_exports__);
|
|
20852
20881
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
20853
|
-
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
20854
|
-
/* harmony export */ getLogger: () => (/* binding */ getLogger)
|
|
20882
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
20855
20883
|
/* harmony export */ });
|
|
20856
20884
|
/* harmony import */ var _audioDeviceManager_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./audioDeviceManager.js */ "./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/audioDeviceManager.js");
|
|
20857
20885
|
/* harmony import */ var _coreSDKLogger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./coreSDKLogger.js */ "./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/coreSDKLogger.js");
|
|
@@ -20860,7 +20888,6 @@ var SIP = __webpack_require__(/*! ./sip-0.20.0.js */ "./node_modules/@exotel-npm
|
|
|
20860
20888
|
;
|
|
20861
20889
|
|
|
20862
20890
|
|
|
20863
|
-
|
|
20864
20891
|
let logger = _coreSDKLogger_js__WEBPACK_IMPORTED_MODULE_1__["default"];
|
|
20865
20892
|
|
|
20866
20893
|
var beeptone = document.createElement("audio");
|
|
@@ -20872,31 +20899,25 @@ ringbacktone.src = __webpack_require__(/*! ./static/ringbacktone.wav */ "./node_
|
|
|
20872
20899
|
var dtmftone = document.createElement("audio");
|
|
20873
20900
|
dtmftone.src = __webpack_require__(/*! ./static/dtmf.wav */ "./node_modules/@exotel-npm-dev/webrtc-core-sdk/src/static/dtmf.wav");
|
|
20874
20901
|
|
|
20875
|
-
|
|
20902
|
+
class SIPJSPhone {
|
|
20876
20903
|
|
|
20877
|
-
|
|
20878
|
-
|
|
20904
|
+
static toBeConfigure = true;
|
|
20905
|
+
static audioElementNameVsAudioGainNodeMap = {};
|
|
20879
20906
|
|
|
20880
|
-
|
|
20881
|
-
|
|
20882
|
-
|
|
20883
|
-
|
|
20884
|
-
|
|
20885
|
-
|
|
20886
|
-
}
|
|
20887
|
-
|
|
20888
|
-
if (uaLogger) {
|
|
20889
|
-
return uaLogger;
|
|
20907
|
+
static configure() {
|
|
20908
|
+
logger.log("SIPJSPhone: configure: entry");
|
|
20909
|
+
SIPJSPhone.audioElementNameVsAudioGainNodeMap["ringtone"] = _audioDeviceManager_js__WEBPACK_IMPORTED_MODULE_0__.audioDeviceManager.createAndConfigureAudioGainNode(ringtone);
|
|
20910
|
+
SIPJSPhone.audioElementNameVsAudioGainNodeMap["ringbacktone"] = _audioDeviceManager_js__WEBPACK_IMPORTED_MODULE_0__.audioDeviceManager.createAndConfigureAudioGainNode(ringbacktone);
|
|
20911
|
+
SIPJSPhone.audioElementNameVsAudioGainNodeMap["dtmftone"] = _audioDeviceManager_js__WEBPACK_IMPORTED_MODULE_0__.audioDeviceManager.createAndConfigureAudioGainNode(dtmftone);
|
|
20912
|
+
SIPJSPhone.audioElementNameVsAudioGainNodeMap["beeptone"] = _audioDeviceManager_js__WEBPACK_IMPORTED_MODULE_0__.audioDeviceManager.createAndConfigureAudioGainNode(beeptone);
|
|
20890
20913
|
}
|
|
20891
|
-
|
|
20892
|
-
logger.log("sipjsphone: getLogger: No Logger, Using console log")
|
|
20893
|
-
return logger;
|
|
20894
|
-
}
|
|
20895
|
-
}
|
|
20896
|
-
|
|
20897
|
-
class SIPJSPhone {
|
|
20914
|
+
|
|
20898
20915
|
|
|
20899
20916
|
constructor(delegate, username) {
|
|
20917
|
+
if(SIPJSPhone.toBeConfigure) {
|
|
20918
|
+
SIPJSPhone.toBeConfigure = false;
|
|
20919
|
+
SIPJSPhone.configure();
|
|
20920
|
+
}
|
|
20900
20921
|
this.webrtcSIPPhoneEventDelegate = delegate;
|
|
20901
20922
|
this.username = username;
|
|
20902
20923
|
this.ctxSip = {};
|
|
@@ -20978,6 +20999,7 @@ class SIPJSPhone {
|
|
|
20978
20999
|
this.bHoldEnable = false;
|
|
20979
21000
|
this.register_flag = false;
|
|
20980
21001
|
this.enableAutoAudioDeviceChangeHandling = false;
|
|
21002
|
+
this.addPreferredCodec = this.addPreferredCodec.bind(this);
|
|
20981
21003
|
|
|
20982
21004
|
this.ringtone = ringtone;
|
|
20983
21005
|
this.beeptone = beeptone;
|
|
@@ -20985,15 +21007,48 @@ class SIPJSPhone {
|
|
|
20985
21007
|
this.dtmftone = dtmftone;
|
|
20986
21008
|
this.audioRemote = document.createElement("audio");
|
|
20987
21009
|
this.audioRemote.style.display = 'none';
|
|
20988
|
-
document.body.appendChild(this.audioRemote);
|
|
21010
|
+
document.body.appendChild(this.audioRemote);
|
|
21011
|
+
this.callAudioOutputVolume = 1;
|
|
21012
|
+
|
|
21013
|
+
}
|
|
20989
21014
|
|
|
20990
|
-
this.addPreferredCodec = this.addPreferredCodec.bind(this);
|
|
20991
21015
|
|
|
20992
|
-
|
|
20993
|
-
|
|
20994
|
-
|
|
20995
|
-
|
|
20996
|
-
|
|
21016
|
+
setCallAudioOutputVolume(value) {
|
|
21017
|
+
logger.log(`sipjsphone: setCallAudioOutputVolume: ${value}`);
|
|
21018
|
+
this.callAudioOutputVolume = Math.max(0, Math.min(1, value));
|
|
21019
|
+
this.audioRemote.volume = this.callAudioOutputVolume;
|
|
21020
|
+
return true;
|
|
21021
|
+
}
|
|
21022
|
+
|
|
21023
|
+
getCallAudioOutputVolume() {
|
|
21024
|
+
logger.log(`sipjsphone: getCallAudioOutputVolume`);
|
|
21025
|
+
return this.callAudioOutputVolume;
|
|
21026
|
+
}
|
|
21027
|
+
|
|
21028
|
+
// Volume control methods
|
|
21029
|
+
static setAudioOutputVolume(audioElementName, value) {
|
|
21030
|
+
|
|
21031
|
+
logger.log(`SIPJSPhone: setAudioOutputVolume: ${audioElementName} volume set to ${value}`);
|
|
21032
|
+
if(!SIPJSPhone.audioElementNameVsAudioGainNodeMap.hasOwnProperty(audioElementName)) {
|
|
21033
|
+
logger.error(`SIPJSPhone: setAudioOutputVolume: Invalid audio element name: ${audioElementName}`);
|
|
21034
|
+
throw new Error(`Invalid audio element name: ${audioElementName}`);
|
|
21035
|
+
}
|
|
21036
|
+
|
|
21037
|
+
let gainNode = SIPJSPhone.audioElementNameVsAudioGainNodeMap[audioElementName];
|
|
21038
|
+
gainNode.gain.value = Math.max(0, Math.min(1, value));
|
|
21039
|
+
logger.log(`SIPJSPhone: setAudioOutputVolume: ${audioElementName} volume set to ${value}`);
|
|
21040
|
+
return true;
|
|
21041
|
+
|
|
21042
|
+
}
|
|
21043
|
+
|
|
21044
|
+
static getAudioOutputVolume(audioElementName) {
|
|
21045
|
+
logger.log(`SIPJSPhone: getAudioOutputVolume: ${audioElementName}`);
|
|
21046
|
+
if(!SIPJSPhone.audioElementNameVsAudioGainNodeMap.hasOwnProperty(audioElementName)) {
|
|
21047
|
+
logger.error(`SIPJSPhone: getAudioOutputVolume: Invalid audio element name: ${audioElementName}`);
|
|
21048
|
+
throw new Error(`Invalid audio element name: ${audioElementName}`);
|
|
21049
|
+
}
|
|
21050
|
+
let gainNode = SIPJSPhone.audioElementNameVsAudioGainNodeMap[audioElementName];
|
|
21051
|
+
return gainNode.gain.value;
|
|
20997
21052
|
}
|
|
20998
21053
|
|
|
20999
21054
|
attachGlobalDeviceChangeListener() {
|
|
@@ -21060,11 +21115,11 @@ class SIPJSPhone {
|
|
|
21060
21115
|
if (count > this.ctxSip.ringtoneCount) {
|
|
21061
21116
|
clearInterval(this.ctxSip.ringToneIntervalID);
|
|
21062
21117
|
}
|
|
21063
|
-
|
|
21064
|
-
|
|
21065
|
-
|
|
21066
|
-
|
|
21067
|
-
|
|
21118
|
+
}, 500);
|
|
21119
|
+
} catch (e) {
|
|
21120
|
+
logger.log("DEBUG: startRingTone: Exception:", e);
|
|
21121
|
+
}
|
|
21122
|
+
},
|
|
21068
21123
|
|
|
21069
21124
|
stopRingTone: () => {
|
|
21070
21125
|
try {
|
|
@@ -21078,11 +21133,12 @@ class SIPJSPhone {
|
|
|
21078
21133
|
} catch (e) { logger.log("sipjsphone: stopRingTone: Exception:", e); }
|
|
21079
21134
|
},
|
|
21080
21135
|
|
|
21136
|
+
// Update the startRingbackTone method (around line 223) to use Web Audio:
|
|
21081
21137
|
startRingbackTone: () => {
|
|
21082
21138
|
if (!this.ctxSip.ringbacktone) {
|
|
21083
21139
|
this.ctxSip.ringbacktone = this.ringbacktone;
|
|
21084
|
-
|
|
21085
|
-
|
|
21140
|
+
}
|
|
21141
|
+
try {
|
|
21086
21142
|
this.ctxSip.ringbacktone.play()
|
|
21087
21143
|
.then(() => {
|
|
21088
21144
|
logger.log("sipjsphone: startRingbackTone: Audio is playing...");
|
|
@@ -21091,8 +21147,8 @@ class SIPJSPhone {
|
|
|
21091
21147
|
logger.log("sipjsphone: startRingbackTone: Exception:", e);
|
|
21092
21148
|
// Optionally, prompt user to interact with the page to enable audio
|
|
21093
21149
|
});
|
|
21094
|
-
|
|
21095
|
-
|
|
21150
|
+
} catch (e) { logger.log("sipjsphone: startRingbackTone: Exception:", e); }
|
|
21151
|
+
},
|
|
21096
21152
|
|
|
21097
21153
|
stopRingbackTone: () => {
|
|
21098
21154
|
if (!this.ctxSip.ringbacktone) {
|
|
@@ -21244,35 +21300,32 @@ class SIPJSPhone {
|
|
|
21244
21300
|
|
|
21245
21301
|
},
|
|
21246
21302
|
|
|
21303
|
+
// Update the sipSendDTMF method (around line 389) to use Web Audio:
|
|
21247
21304
|
sipSendDTMF: (digit) => {
|
|
21248
|
-
|
|
21249
|
-
try { this.ctxSip.dtmfTone.play(); } catch (e) { logger.log("sipjsphone: sipSendDTMF: Exception:", e); }
|
|
21250
|
-
|
|
21251
21305
|
var a = this.ctxSip.callActiveID;
|
|
21252
|
-
|
|
21306
|
+
if (a) {
|
|
21253
21307
|
var s = this.ctxSip.Sessions[a];
|
|
21254
21308
|
|
|
21255
|
-
|
|
21256
|
-
|
|
21257
|
-
|
|
21258
|
-
|
|
21259
|
-
|
|
21260
|
-
|
|
21261
|
-
|
|
21262
|
-
|
|
21263
|
-
|
|
21264
|
-
|
|
21265
|
-
|
|
21266
|
-
|
|
21267
|
-
|
|
21268
|
-
|
|
21269
|
-
|
|
21270
|
-
|
|
21271
|
-
|
|
21272
|
-
});
|
|
21309
|
+
if (!/^[0-9A-D#*,]$/.exec(digit)) {
|
|
21310
|
+
return Promise.reject(new Error("Invalid DTMF tone."));
|
|
21311
|
+
}
|
|
21312
|
+
if (!s) {
|
|
21313
|
+
return Promise.reject(new Error("Session does not exist."));
|
|
21314
|
+
}
|
|
21315
|
+
const dtmf = digit;
|
|
21316
|
+
const duration = 240;
|
|
21317
|
+
const body = {
|
|
21318
|
+
contentDisposition: "render",
|
|
21319
|
+
contentType: "application/dtmf-relay",
|
|
21320
|
+
content: "Signal=" + dtmf + "\r\nDuration=" + duration
|
|
21321
|
+
};
|
|
21322
|
+
const requestOptions = { body };
|
|
21323
|
+
return s.info({ requestOptions }).then(() => {
|
|
21324
|
+
return;
|
|
21325
|
+
});
|
|
21273
21326
|
|
|
21274
|
-
|
|
21275
|
-
|
|
21327
|
+
}
|
|
21328
|
+
},
|
|
21276
21329
|
|
|
21277
21330
|
setError: (err, title, msg, closable) => { },
|
|
21278
21331
|
|
|
@@ -21927,37 +21980,41 @@ destroySocketConnection() {
|
|
|
21927
21980
|
});
|
|
21928
21981
|
}
|
|
21929
21982
|
|
|
21930
|
-
assignStream(stream, element) {
|
|
21931
|
-
if (_audioDeviceManager_js__WEBPACK_IMPORTED_MODULE_0__.audioDeviceManager.currentAudioOutputDeviceId != "default")
|
|
21932
|
-
element.setSinkId(_audioDeviceManager_js__WEBPACK_IMPORTED_MODULE_0__.audioDeviceManager.currentAudioOutputDeviceId);
|
|
21933
|
-
// Set element source.
|
|
21934
|
-
element.autoplay = true; // Safari does not allow calling .play() from a
|
|
21935
|
-
// non user action
|
|
21936
|
-
element.srcObject = stream;
|
|
21937
|
-
|
|
21938
|
-
// Load and start playback of media.
|
|
21939
|
-
element.play().catch((error) => {
|
|
21940
|
-
logger.error("Failed to play media");
|
|
21941
|
-
logger.error(error);
|
|
21942
|
-
});
|
|
21943
21983
|
|
|
21944
|
-
|
|
21945
|
-
|
|
21946
|
-
|
|
21947
|
-
|
|
21948
|
-
|
|
21949
|
-
|
|
21950
|
-
|
|
21951
|
-
|
|
21984
|
+
assignStream(stream, element) {
|
|
21985
|
+
logger.log("sipjsphone: assignStream: entry");
|
|
21986
|
+
|
|
21987
|
+
if (_audioDeviceManager_js__WEBPACK_IMPORTED_MODULE_0__.audioDeviceManager.currentAudioOutputDeviceId != "default")
|
|
21988
|
+
element.setSinkId(_audioDeviceManager_js__WEBPACK_IMPORTED_MODULE_0__.audioDeviceManager.currentAudioOutputDeviceId);
|
|
21989
|
+
|
|
21990
|
+
// Set element source.
|
|
21991
|
+
element.autoplay = true;
|
|
21992
|
+
element.srcObject = stream;
|
|
21993
|
+
|
|
21994
|
+
|
|
21995
|
+
// Set HTML audio element volume to 0 to prevent direct audio output
|
|
21996
|
+
element.volume = this.callAudioOutputVolume;
|
|
21997
|
+
|
|
21998
|
+
// Load and start playback of media.
|
|
21999
|
+
element.play().catch((error) => {
|
|
22000
|
+
logger.error("sipjsphone: assignStream: Failed to play media", error);
|
|
22001
|
+
});
|
|
21952
22002
|
|
|
21953
|
-
|
|
21954
|
-
|
|
21955
|
-
|
|
21956
|
-
|
|
21957
|
-
|
|
21958
|
-
|
|
21959
|
-
|
|
21960
|
-
|
|
22003
|
+
// If a track is added, load and restart playback of media.
|
|
22004
|
+
stream.onaddtrack = () => {
|
|
22005
|
+
element.load();
|
|
22006
|
+
element.play().catch((error) => {
|
|
22007
|
+
logger.error("sipjsphone: assignStream: Failed to play remote media on add track", error);
|
|
22008
|
+
});
|
|
22009
|
+
};
|
|
22010
|
+
|
|
22011
|
+
// If a track is removed, load and restart playback of media.
|
|
22012
|
+
stream.onremovetrack = () => {
|
|
22013
|
+
element.load();
|
|
22014
|
+
element.play().catch((error) => {
|
|
22015
|
+
logger.error("sipjsphone: assignStream: Failed to play remote media on remove track", error);
|
|
22016
|
+
});
|
|
22017
|
+
};
|
|
21961
22018
|
}
|
|
21962
22019
|
|
|
21963
22020
|
onUserSessionAcceptFailed(e) {
|
|
@@ -22242,7 +22299,7 @@ destroySocketConnection() {
|
|
|
22242
22299
|
logger.log("sipjsphone: changeAudioOutputDevice : ", deviceId, onSuccess, onError, "forceDeviceChange = ", forceDeviceChange, "enableAutoAudioDeviceChangeHandling = ", this.enableAutoAudioDeviceChangeHandling);
|
|
22243
22300
|
try {
|
|
22244
22301
|
// Ensure device list is up-to-date
|
|
22245
|
-
await _audioDeviceManager_js__WEBPACK_IMPORTED_MODULE_0__.audioDeviceManager.enumerateDevices();
|
|
22302
|
+
await _audioDeviceManager_js__WEBPACK_IMPORTED_MODULE_0__.audioDeviceManager.enumerateDevices(() => {});
|
|
22246
22303
|
if (!this.audioRemote) {
|
|
22247
22304
|
const errorMsg = 'SIPJSPhone:changeAudioOutputDevice audioRemote element is not set.';
|
|
22248
22305
|
logger.error(errorMsg);
|
|
@@ -22841,6 +22898,26 @@ class WebrtcSIPPhone {
|
|
|
22841
22898
|
logger.log("webrtcSIPPhone: registerAudioDeviceChangeCallback entry");
|
|
22842
22899
|
this.phone.registerAudioDeviceChangeCallback(audioInputDeviceChangeCallback, audioOutputDeviceChangeCallback, onDeviceChangeCallback);
|
|
22843
22900
|
}
|
|
22901
|
+
|
|
22902
|
+
static setAudioOutputVolume(audioElementName, value){
|
|
22903
|
+
logger.log("WebrtcSIPPhone: setAudioOutputVolume: ", audioElementName, value);
|
|
22904
|
+
return _sipjsphone__WEBPACK_IMPORTED_MODULE_1__["default"].setAudioOutputVolume(audioElementName, value);
|
|
22905
|
+
}
|
|
22906
|
+
|
|
22907
|
+
static getAudioOutputVolume(audioElementName) {
|
|
22908
|
+
logger.log("webrtcSIPPhone: getAudioOutputVolume: ", audioElementName);
|
|
22909
|
+
return _sipjsphone__WEBPACK_IMPORTED_MODULE_1__["default"].getAudioOutputVolume(audioElementName);
|
|
22910
|
+
}
|
|
22911
|
+
|
|
22912
|
+
setCallAudioOutputVolume(value) {
|
|
22913
|
+
logger.log("webrtcSIPPhone: setCallAudioOutputVolume: ", value);
|
|
22914
|
+
return this.phone.setCallAudioOutputVolume(value);
|
|
22915
|
+
}
|
|
22916
|
+
|
|
22917
|
+
getCallAudioOutputVolume() {
|
|
22918
|
+
logger.log("webrtcSIPPhone: getCallAudioOutputVolume");
|
|
22919
|
+
return this.phone.getCallAudioOutputVolume();
|
|
22920
|
+
}
|
|
22844
22921
|
}
|
|
22845
22922
|
|
|
22846
22923
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (WebrtcSIPPhone);
|
|
@@ -24782,7 +24859,6 @@ class ExSynchronousHandler {
|
|
|
24782
24859
|
logger.log("synchronousHandler: onResponse, phone is connected.\n");
|
|
24783
24860
|
}
|
|
24784
24861
|
}
|
|
24785
|
-
|
|
24786
24862
|
class ExotelWebClient {
|
|
24787
24863
|
/**
|
|
24788
24864
|
* @param {Object} sipAccntInfo
|
|
@@ -24803,6 +24879,7 @@ class ExotelWebClient {
|
|
|
24803
24879
|
registerCallback = null;
|
|
24804
24880
|
sessionCallback = null;
|
|
24805
24881
|
logger = (0,_exotel_npm_dev_webrtc_core_sdk__WEBPACK_IMPORTED_MODULE_8__.getLogger)();
|
|
24882
|
+
static clientSDKLoggerCallback = null;
|
|
24806
24883
|
constructor() {
|
|
24807
24884
|
// Initialize properties
|
|
24808
24885
|
this.ctrlr = null;
|
|
@@ -24816,20 +24893,9 @@ class ExotelWebClient {
|
|
|
24816
24893
|
this.currentSIPUserName = "";
|
|
24817
24894
|
this.isReadyToRegister = true;
|
|
24818
24895
|
this.sipAccountInfo = null;
|
|
24819
|
-
this.clientSDKLoggerCallback = null;
|
|
24820
24896
|
this.callbacks = new _listeners_Callback__WEBPACK_IMPORTED_MODULE_7__.Callback();
|
|
24821
24897
|
this.registerCallback = new _listeners_Callback__WEBPACK_IMPORTED_MODULE_7__.RegisterCallback();
|
|
24822
24898
|
this.sessionCallback = new _listeners_Callback__WEBPACK_IMPORTED_MODULE_7__.SessionCallback();
|
|
24823
|
-
this.logger = (0,_exotel_npm_dev_webrtc_core_sdk__WEBPACK_IMPORTED_MODULE_8__.getLogger)();
|
|
24824
|
-
|
|
24825
|
-
// Register logger callback
|
|
24826
|
-
let exwebClientOb = this;
|
|
24827
|
-
this.logger.registerLoggerCallback((type, message, args) => {
|
|
24828
|
-
_api_LogManager_js__WEBPACK_IMPORTED_MODULE_10__["default"].onLog(type, message, args);
|
|
24829
|
-
if (exwebClientOb.clientSDKLoggerCallback) {
|
|
24830
|
-
exwebClientOb.clientSDKLoggerCallback("log", message, args);
|
|
24831
|
-
}
|
|
24832
|
-
});
|
|
24833
24899
|
}
|
|
24834
24900
|
initWebrtc = async (sipAccountInfo_, RegisterEventCallBack, CallListenerCallback, SessionCallback, enableAutoAudioDeviceChangeHandling = false) => {
|
|
24835
24901
|
const userName = sipAccountInfo_?.userName;
|
|
@@ -25142,8 +25208,9 @@ class ExotelWebClient {
|
|
|
25142
25208
|
}
|
|
25143
25209
|
this.webrtcSIPPhone.setPreferredCodec(codecName);
|
|
25144
25210
|
}
|
|
25145
|
-
registerLoggerCallback(callback) {
|
|
25146
|
-
|
|
25211
|
+
static registerLoggerCallback(callback) {
|
|
25212
|
+
logger.log("ExWebClient: registerLoggerCallback: Entry");
|
|
25213
|
+
ExotelWebClient.clientSDKLoggerCallback = callback;
|
|
25147
25214
|
}
|
|
25148
25215
|
registerAudioDeviceChangeCallback(audioInputDeviceChangeCallback, audioOutputDeviceChangeCallback, onDeviceChangeCallback) {
|
|
25149
25216
|
logger.log("ExWebClient: registerAudioDeviceChangeCallback: Entry");
|
|
@@ -25153,13 +25220,40 @@ class ExotelWebClient {
|
|
|
25153
25220
|
}
|
|
25154
25221
|
this.webrtcSIPPhone.registerAudioDeviceChangeCallback(audioInputDeviceChangeCallback, audioOutputDeviceChangeCallback, onDeviceChangeCallback);
|
|
25155
25222
|
}
|
|
25156
|
-
setEnableConsoleLogging(enable) {
|
|
25223
|
+
static setEnableConsoleLogging(enable) {
|
|
25157
25224
|
if (enable) {
|
|
25158
|
-
logger.log(
|
|
25225
|
+
logger.log("ExWebClient: setEnableConsoleLogging: Entry, enable: " + enable);
|
|
25159
25226
|
}
|
|
25160
25227
|
logger.setEnableConsoleLogging(enable);
|
|
25161
25228
|
}
|
|
25229
|
+
static setAudioOutputVolume(audioElementName, value) {
|
|
25230
|
+
logger.log(`ExWebClient: setAudioOutputVolume: Entry, audioElementName: ${audioElementName}, value: ${value}`);
|
|
25231
|
+
_exotel_npm_dev_webrtc_core_sdk__WEBPACK_IMPORTED_MODULE_8__.WebrtcSIPPhone.setAudioOutputVolume(audioElementName, value);
|
|
25232
|
+
}
|
|
25233
|
+
static getAudioOutputVolume(audioElementName) {
|
|
25234
|
+
logger.log(`ExWebClient: getAudioOutputVolume: Entry, audioElementName: ${audioElementName}`);
|
|
25235
|
+
return _exotel_npm_dev_webrtc_core_sdk__WEBPACK_IMPORTED_MODULE_8__.WebrtcSIPPhone.getAudioOutputVolume(audioElementName);
|
|
25236
|
+
}
|
|
25237
|
+
setCallAudioOutputVolume(value) {
|
|
25238
|
+
logger.log(`ExWebClient: setCallAudioOutputVolume: Entry, value: ${value}`);
|
|
25239
|
+
this.webrtcSIPPhone.setCallAudioOutputVolume(value);
|
|
25240
|
+
}
|
|
25241
|
+
getCallAudioOutputVolume() {
|
|
25242
|
+
logger.log(`ExWebClient: getCallAudioOutputVolume: Entry`);
|
|
25243
|
+
return this.webrtcSIPPhone.getCallAudioOutputVolume();
|
|
25244
|
+
}
|
|
25245
|
+
setNoiseSuppression(enabled = false) {
|
|
25246
|
+
logger.log(`ExWebClient: setNoiseSuppression: ${enabled}`);
|
|
25247
|
+
this.webrtcSIPPhone.setNoiseSuppression(enabled);
|
|
25248
|
+
}
|
|
25162
25249
|
}
|
|
25250
|
+
logger.registerLoggerCallback((type, message, args) => {
|
|
25251
|
+
_api_LogManager_js__WEBPACK_IMPORTED_MODULE_10__["default"].onLog(type, message, args);
|
|
25252
|
+
if (ExotelWebClient.clientSDKLoggerCallback) {
|
|
25253
|
+
ExotelWebClient.clientSDKLoggerCallback("log", message, args);
|
|
25254
|
+
}
|
|
25255
|
+
});
|
|
25256
|
+
|
|
25163
25257
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ExotelWebClient);
|
|
25164
25258
|
|
|
25165
25259
|
/***/ }),
|