Skip to content

Commit b4c589e

Browse files
author
James Criscuolo
committed
Merge branch 'master' into release
2 parents 0c7d355 + b0c19c4 commit b4c589e

File tree

6 files changed

+12
-111
lines changed

6 files changed

+12
-111
lines changed

#package.json#

Lines changed: 0 additions & 105 deletions
This file was deleted.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "sip.js",
33
"title": "SIP.js",
44
"description": "A SIP library for JavaScript",
5-
"version": "0.18.0",
5+
"version": "0.18.1",
66
"license": "MIT",
77
"main": "./lib/index.js",
88
"module": "./lib/index.js",

src/api/registerer.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,10 +373,16 @@ export class Registerer {
373373
if (!contact) {
374374
throw new Error("Contact undefined");
375375
}
376+
377+
/* Adding host and port checks may break people not using contactName, so only check those
378+
* if the parameter is set. The server mucking with host and port is entirely legal,
379+
* so in cases where that occurs usage of contactName is currently broken.
380+
*/
376381
if (
377382
contact.uri.user === this.userAgent.contact.uri.user &&
378-
contact.uri.host === this.userAgent.contact.uri.host &&
379-
contact.uri.port === this.userAgent.contact.uri.port
383+
(this.userAgent.configuration.contactName === "" ||
384+
(contact.uri.host === this.userAgent.contact.uri.host &&
385+
contact.uri.port === this.userAgent.contact.uri.port))
380386
) {
381387
expires = Number(contact.getParam("expires"));
382388
break;

src/api/user-agent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ export class UserAgent {
594594
* Initialize contact.
595595
*/
596596
private initContact(): Contact {
597-
const contactName = this.options.contactName != "" ? this.options.contactName : createRandomToken(8);
597+
const contactName = this.options.contactName !== "" ? this.options.contactName : createRandomToken(8);
598598
const contactParams = this.options.contactParams;
599599
const contact = {
600600
pubGruu: undefined,

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const LIBRARY_VERSION = "0.18.0";
1+
export const LIBRARY_VERSION = "0.18.1";

0 commit comments

Comments
 (0)