11/*
2- * JsSIP v3.10.0
2+ * JsSIP v3.10.1
33 * the Javascript SIP library
4- * Copyright: 2012-2022
4+ * Copyright: 2012-2023
55 * Homepage: https://jssip.net
66 * License: MIT
77 */
@@ -19049,6 +19049,10 @@ module.exports = /*#__PURE__*/function (_EventEmitter) {
1904919049 _this13._iceReady = false;
1905019050
1905119051 var ready = function ready() {
19052+ if (finished) {
19053+ return;
19054+ }
19055+
1905219056 connection.removeEventListener('icecandidate', iceCandidateListener);
1905319057 connection.removeEventListener('icegatheringstatechange', iceGatheringStateListener);
1905419058 finished = true;
@@ -19075,12 +19079,12 @@ module.exports = /*#__PURE__*/function (_EventEmitter) {
1907519079 candidate: candidate,
1907619080 ready: ready
1907719081 });
19078- } else if (!finished) {
19082+ } else {
1907919083 ready();
1908019084 }
1908119085 });
1908219086 connection.addEventListener('icegatheringstatechange', iceGatheringStateListener = function iceGatheringStateListener() {
19083- if (connection.iceGatheringState === 'complete' && !finished ) {
19087+ if (connection.iceGatheringState === 'complete') {
1908419088 ready();
1908519089 }
1908619090 });
@@ -23854,7 +23858,21 @@ module.exports = /*#__PURE__*/function () {
2385423858 }, {
2385523859 key: "_onData",
2385623860 value: function _onData(data) {
23857- // CRLF Keep Alive response from server. Ignore it.
23861+ // CRLF Keep Alive request from server, reply.
23862+ if (data === '\r\n\r\n') {
23863+ logger.debug('received message with double-CRLF Keep Alive request');
23864+
23865+ try {
23866+ // Reply with single CRLF.
23867+ this.socket.send('\r\n');
23868+ } catch (error) {
23869+ logger.warn("error sending Keep Alive response: ".concat(error));
23870+ }
23871+
23872+ return;
23873+ } // CRLF Keep Alive response from server, ignore it.
23874+
23875+
2385823876 if (data === '\r\n') {
2385923877 logger.debug('received message with CRLF Keep Alive response');
2386023878 return;
@@ -24332,6 +24350,12 @@ module.exports = /*#__PURE__*/function (_EventEmitter) {
2433224350 break;
2433324351 }
2433424352
24353+ case 'extra_headers':
24354+ {
24355+ this._configuration.extra_headers = value;
24356+ break;
24357+ }
24358+
2433524359 default:
2433624360 logger.warn('set() | cannot set "%s" parameter in runtime', parameter);
2433724361 return false;
@@ -24780,7 +24804,7 @@ module.exports = /*#__PURE__*/function (_EventEmitter) {
2478024804 }
2478124805 }; // Seal the configuration.
2478224806
24783- var writable_parameters = ['authorization_user', 'password', 'realm', 'ha1', 'authorization_jwt', 'display_name', 'register'];
24807+ var writable_parameters = ['authorization_user', 'password', 'realm', 'ha1', 'authorization_jwt', 'display_name', 'register', 'extra_headers' ];
2478424808
2478524809 for (var parameter in this._configuration) {
2478624810 if (Object.prototype.hasOwnProperty.call(this._configuration, parameter)) {
@@ -28340,7 +28364,7 @@ module.exports={
2834028364 "name": "jssip",
2834128365 "title": "JsSIP",
2834228366 "description": "the Javascript SIP library",
28343- "version": "3.10.0 ",
28367+ "version": "3.10.1 ",
2834428368 "homepage": "https://jssip.net",
2834528369 "contributors": [
2834628370 "José Luis Millán <
[email protected] > (https://github.com/jmillan)",
0 commit comments