diff --git a/lib/Config.js b/lib/Config.js index 67ae638a8..dafb3a5d9 100644 --- a/lib/Config.js +++ b/lib/Config.js @@ -275,7 +275,7 @@ const checks = { { const value = Number(register_expires); - if (value > 0) + if (value >= 0) { return value; } diff --git a/lib/Registrator.js b/lib/Registrator.js index 2c889741e..564969142 100644 --- a/lib/Registrator.js +++ b/lib/Registrator.js @@ -49,7 +49,7 @@ module.exports = class Registrator // Contents of the sip.instance Contact header parameter. this._sipInstance = `""`; - + this._contact += `;reg-id=${this._reg_id}`; this._contact += `;+sip.instance=${this._sipInstance}`; } @@ -104,10 +104,11 @@ module.exports = class Registrator } const extraHeaders = this._extraHeaders.slice(); + let contactValue = `${this._contact}${this._extraContactParams}`; - extraHeaders.push(`Contact: \ -${this._contact};expires=${this._expires}${this._extraContactParams}`); - extraHeaders.push(`Expires: ${this._expires}`); + if (this._expires) contactValue = `${this._contact};expires=${this._expires}${this._extraContactParams}`; + extraHeaders.push(`Contact: ${contactValue}`); + if (this._expires) extraHeaders.push(`Expires: ${this._expires}`); const request = new SIPMessage.OutgoingRequest( JsSIP_C.REGISTER, this._registrar, this._ua, {