From c8213591e2afb9285fec807d1d523f11685283bc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 May 2021 22:54:40 +0000 Subject: [PATCH 01/13] Bump lodash from 4.17.20 to 4.17.21 Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.20...4.17.21) Signed-off-by: dependabot[bot] --- package-lock.json | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index a78873634..8678ff66d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1164,12 +1164,6 @@ "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", "dev": true }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, "semver": { "version": "7.3.4", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", @@ -2043,9 +2037,9 @@ } }, "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, "lodash.get": { From 4ef4403ed1e587279909c24923dfff73be70384e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 8 May 2021 23:03:29 +0000 Subject: [PATCH 02/13] Bump url-parse from 1.4.7 to 1.5.1 Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.4.7 to 1.5.1. - [Release notes](https://github.com/unshiftio/url-parse/releases) - [Commits](https://github.com/unshiftio/url-parse/compare/1.4.7...1.5.1) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index a78873634..d7f4cbabd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3032,9 +3032,9 @@ } }, "url-parse": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz", - "integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.1.tgz", + "integrity": "sha512-HOfCOUJt7iSYzEx/UqgtwKRMC6EU91NFhsCHMv9oM03VJcVo2Qrp8T8kI9D7amFf1cu+/3CEhgb3rF9zL7k85Q==", "dev": true, "requires": { "querystringify": "^2.1.1", From 94adc03ea7e65bef9ec76f520d6703f0c3935ec7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 28 May 2021 21:32:47 +0000 Subject: [PATCH 03/13] Bump ws from 7.4.4 to 7.4.6 Bumps [ws](https://github.com/websockets/ws) from 7.4.4 to 7.4.6. - [Release notes](https://github.com/websockets/ws/releases) - [Commits](https://github.com/websockets/ws/compare/7.4.4...7.4.6) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5532e4265..24a5c3ed2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3260,9 +3260,9 @@ "dev": true }, "ws": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.4.tgz", - "integrity": "sha512-Qm8k8ojNQIMx7S+Zp8u/uHOx7Qazv3Yv4q68MiWWWOJhiwG5W3x7iqmRtJo8xxrciZUY4vRxUTJCKuRnF28ZZw==", + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", + "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", "dev": true }, "y18n": { From f757998f5a6c2e6871d05fac46d876b239abb4b4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Jun 2021 17:31:54 +0000 Subject: [PATCH 04/13] Bump glob-parent from 5.1.1 to 5.1.2 Bumps [glob-parent](https://github.com/gulpjs/glob-parent) from 5.1.1 to 5.1.2. - [Release notes](https://github.com/gulpjs/glob-parent/releases) - [Changelog](https://github.com/gulpjs/glob-parent/blob/main/CHANGELOG.md) - [Commits](https://github.com/gulpjs/glob-parent/compare/v5.1.1...v5.1.2) --- updated-dependencies: - dependency-name: glob-parent dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5532e4265..031387ae3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1484,9 +1484,9 @@ } }, "glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "requires": { "is-glob": "^4.0.1" From 67bea3e910fb70571fdfda3fb628bc527a4a2b25 Mon Sep 17 00:00:00 2001 From: nnaoi <31946560+nnaoi@users.noreply.github.com> Date: Thu, 8 Jul 2021 17:44:17 +0900 Subject: [PATCH 05/13] fix typo in docs/session-description-handler.md --- docs/session-description-handler.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/session-description-handler.md b/docs/session-description-handler.md index c444c48a8..1370476b1 100644 --- a/docs/session-description-handler.md +++ b/docs/session-description-handler.md @@ -147,7 +147,7 @@ import { Web } from "sip.js"; // The Session.sessionDescriptionHandlerOptionsReInvite property // may be used to pass options to the SessionDescriptionHandler. -const sessionDescriptionHandlerOptions: Web.SesionDescriptionHandlerOptions = { +const sessionDescriptionHandlerOptions: Web.SessionDescriptionHandlerOptions = { hold: true; // set to false to "unhold" session } session.sessionDescriptionHandlerOptionsReInvite = sessionDescriptionHandlerOptions; From 4910cc851e346c89dfdbf7ca5c2370ba85f1e3c8 Mon Sep 17 00:00:00 2001 From: Luis Claro Date: Wed, 14 Jul 2021 17:24:32 +0100 Subject: [PATCH 06/13] Support for ephemeral credentials --- src/api/user-agent-options.ts | 2 +- src/core/messages/digest-authentication.ts | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/api/user-agent-options.ts b/src/api/user-agent-options.ts index 7aafb1eeb..6bfb296f8 100644 --- a/src/api/user-agent-options.ts +++ b/src/api/user-agent-options.ts @@ -48,7 +48,7 @@ export interface UserAgentOptions { * Authorization password. * @defaultValue `""` */ - authorizationPassword?: string; + authorizationPassword?: string | Function; /** * Authorization username. diff --git a/src/core/messages/digest-authentication.ts b/src/core/messages/digest-authentication.ts index 314bc4327..580e0bd37 100644 --- a/src/core/messages/digest-authentication.ts +++ b/src/core/messages/digest-authentication.ts @@ -19,7 +19,7 @@ export class DigestAuthentication { private logger: Logger; private ha1: string | undefined; private username: string | undefined; - private password: string | undefined; + private password: string | Function | undefined; private cnonce: string | undefined; private nc: number; private ncHex: string; @@ -42,7 +42,7 @@ export class DigestAuthentication { loggerFactory: LoggerFactory, ha1: string | undefined, username: string | undefined, - password: string | undefined + password: string | Function | undefined ) { this.logger = loggerFactory.getLogger("sipjs.digestauthentication"); this.username = username; @@ -167,7 +167,11 @@ export class DigestAuthentication { // HA1 = MD5(A1) = MD5(username:realm:password) ha1 = this.ha1; if (ha1 === "" || ha1 === undefined) { - ha1 = MD5(this.username + ":" + this.realm + ":" + this.password); + if (typeof this.password === "function") { + ha1 = MD5(this.username + ":" + this.realm + ":" + this.password()); + } else { + ha1 = MD5(this.username + ":" + this.realm + ":" + this.password); + } } if (this.qop === "auth") { From f296edc822777fd057710f081ef3ed8fbe5b7d1a Mon Sep 17 00:00:00 2001 From: slavikbialik Date: Tue, 24 Aug 2021 20:46:23 +0300 Subject: [PATCH 07/13] add onCancel delegation for Session --- src/api/cancel.ts | 15 +++++++++++++++ src/api/index.ts | 1 + src/api/invitation.ts | 7 +++++++ src/api/session-delegate.ts | 7 +++++++ src/core/session/session-delegate.ts | 8 ++++++++ 5 files changed, 38 insertions(+) create mode 100644 src/api/cancel.ts diff --git a/src/api/cancel.ts b/src/api/cancel.ts new file mode 100644 index 000000000..667872a70 --- /dev/null +++ b/src/api/cancel.ts @@ -0,0 +1,15 @@ +import { IncomingRequestMessage } from "../core"; + +/** + * A request to end a {@link Session} (incoming CANCEL). + * @public + */ +export class Cancel { + /** @internal */ + public constructor(private incomingCancelRequest: IncomingRequestMessage) {} + + /** Incoming ACK request message. */ + public get request(): IncomingRequestMessage { + return this.incomingCancelRequest; + } +} diff --git a/src/api/index.ts b/src/api/index.ts index 7a318eec5..9f0415b05 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -5,6 +5,7 @@ export * from "./exceptions"; export * from "./ack"; export * from "./bye"; +export * from "./cancel"; export * from "./emitter"; export * from "./info"; export * from "./invitation-accept-options"; diff --git a/src/api/invitation.ts b/src/api/invitation.ts index 85b43bce1..878ed44a7 100644 --- a/src/api/invitation.ts +++ b/src/api/invitation.ts @@ -24,6 +24,7 @@ import { Session } from "./session"; import { SessionState } from "./session-state"; import { UserAgent } from "./user-agent"; import { SIPExtension } from "./user-agent-options"; +import { Cancel } from "./cancel"; type ResolveFunction = () => void; type RejectFunction = (reason: Error) => void; @@ -266,6 +267,7 @@ export class Invitation extends Session { onAck: (ackRequest): Promise => this.onAckRequest(ackRequest), onAckTimeout: (): void => this.onAckTimeout(), onBye: (byeRequest): void => this.onByeRequest(byeRequest), + onCancel: (cancelRequest): void => this._onCancel(cancelRequest.message), onInfo: (infoRequest): void => this.onInfoRequest(infoRequest), onInvite: (inviteRequest): void => this.onInviteRequest(inviteRequest), onMessage: (messageRequest): void => this.onMessageRequest(messageRequest), @@ -420,6 +422,11 @@ export class Invitation extends Session { public _onCancel(message: IncomingRequestMessage): void { this.logger.log("Invitation._onCancel"); + if (this.delegate && this.delegate.onCancel) { + const cancel = new Cancel(message); + this.delegate.onCancel(cancel); + } + // validate state if (this.state !== SessionState.Initial && this.state !== SessionState.Establishing) { this.logger.error(`CANCEL received while in state ${this.state}, dropping request`); diff --git a/src/api/session-delegate.ts b/src/api/session-delegate.ts index 0a3f492ce..0f0152912 100644 --- a/src/api/session-delegate.ts +++ b/src/api/session-delegate.ts @@ -6,6 +6,7 @@ import { Message } from "./message"; import { Notification } from "./notification"; import { Referral } from "./referral"; import { SessionDescriptionHandler } from "./session-description-handler"; +import { Cancel } from "./cancel"; /** * Delegate for {@link Session}. @@ -24,6 +25,12 @@ export interface SessionDelegate { */ onBye?(bye: Bye): void; + /** + * Called upon receiving an incoming CANCEL request. + * @param cancel - The bye. + */ + onCancel?(cancel: Cancel): void; + /** * Called upon receiving an incoming in dialog INFO request. * @param info - The info. diff --git a/src/core/session/session-delegate.ts b/src/core/session/session-delegate.ts index da39b389d..55eaabeeb 100644 --- a/src/core/session/session-delegate.ts +++ b/src/core/session/session-delegate.ts @@ -1,6 +1,7 @@ import { IncomingAckRequest, IncomingByeRequest, + IncomingCancelRequest, IncomingInfoRequest, IncomingInviteRequest, IncomingMessageRequest, @@ -45,6 +46,13 @@ export interface SessionDelegate { */ onBye?(request: IncomingByeRequest): void; + /** + * Receive CANCEL request. + * https://datatracker.ietf.org/doc/html/rfc3261#section-9.2 + * @param request - Incoming CANCEL request. + */ + onCancel?(request: IncomingCancelRequest): void; + /** * Receive INFO request. * @param request - Incoming INFO request. From 0957804681404ba34b726d5968136249db7c8c56 Mon Sep 17 00:00:00 2001 From: slavikbialik Date: Wed, 25 Aug 2021 12:10:25 +0300 Subject: [PATCH 08/13] changing onCancel according to eric's caveats --- src/api/invitation.ts | 10 ++++++---- src/core/session/session-delegate.ts | 8 -------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/api/invitation.ts b/src/api/invitation.ts index 878ed44a7..d7faeb61f 100644 --- a/src/api/invitation.ts +++ b/src/api/invitation.ts @@ -267,7 +267,6 @@ export class Invitation extends Session { onAck: (ackRequest): Promise => this.onAckRequest(ackRequest), onAckTimeout: (): void => this.onAckTimeout(), onBye: (byeRequest): void => this.onByeRequest(byeRequest), - onCancel: (cancelRequest): void => this._onCancel(cancelRequest.message), onInfo: (infoRequest): void => this.onInfoRequest(infoRequest), onInvite: (inviteRequest): void => this.onInviteRequest(inviteRequest), onMessage: (messageRequest): void => this.onMessageRequest(messageRequest), @@ -422,9 +421,12 @@ export class Invitation extends Session { public _onCancel(message: IncomingRequestMessage): void { this.logger.log("Invitation._onCancel"); - if (this.delegate && this.delegate.onCancel) { - const cancel = new Cancel(message); - this.delegate.onCancel(cancel); + // validate state for CANCEL delegation + if (this.state === SessionState.Initial || this.state === SessionState.Establishing) { + if (this.delegate && this.delegate.onCancel) { + const cancel = new Cancel(message); + this.delegate.onCancel(cancel); + } } // validate state diff --git a/src/core/session/session-delegate.ts b/src/core/session/session-delegate.ts index 55eaabeeb..da39b389d 100644 --- a/src/core/session/session-delegate.ts +++ b/src/core/session/session-delegate.ts @@ -1,7 +1,6 @@ import { IncomingAckRequest, IncomingByeRequest, - IncomingCancelRequest, IncomingInfoRequest, IncomingInviteRequest, IncomingMessageRequest, @@ -46,13 +45,6 @@ export interface SessionDelegate { */ onBye?(request: IncomingByeRequest): void; - /** - * Receive CANCEL request. - * https://datatracker.ietf.org/doc/html/rfc3261#section-9.2 - * @param request - Incoming CANCEL request. - */ - onCancel?(request: IncomingCancelRequest): void; - /** * Receive INFO request. * @param request - Incoming INFO request. From 22c2f2498011f9693295618e5650d47cf53efaa8 Mon Sep 17 00:00:00 2001 From: Alexey_Y Date: Mon, 8 Aug 2022 18:42:28 +0300 Subject: [PATCH 09/13] fix unsubscribe by disabling N timer on unsubscribe --- src/core/dialogs/subscription-dialog.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core/dialogs/subscription-dialog.ts b/src/core/dialogs/subscription-dialog.ts index 6c7d95d2d..ddaa2a095 100644 --- a/src/core/dialogs/subscription-dialog.ts +++ b/src/core/dialogs/subscription-dialog.ts @@ -318,10 +318,12 @@ export class SubscriptionDialog extends Dialog implements Subscription { clearTimeout(this.N); this.N = undefined; } - // When refreshing a subscription, a subscriber starts Timer N, set to - // 64*T1, when it sends the SUBSCRIBE request. - // https://tools.ietf.org/html/rfc6665#section-4.1.2.2 - this.N = setTimeout(() => this.timerN(), Timers.TIMER_N); + if (!options.extraHeaders?.includes("Expires: 0")) { + // When refreshing a subscription, a subscriber starts Timer N, set to + // 64*T1, when it sends the SUBSCRIBE request. + // https://tools.ietf.org/html/rfc6665#section-4.1.2.2 + this.N = setTimeout(() => this.timerN(), Timers.TIMER_N); + } return uac; } From b3a242c8668402d2b951f8b388c695b2c58709da Mon Sep 17 00:00:00 2001 From: "REPORTY\\netaneld" Date: Thu, 29 Sep 2022 20:13:21 +0300 Subject: [PATCH 10/13] create new function to dispose registrer without unregister --- src/api/registerer.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/api/registerer.ts b/src/api/registerer.ts index cbfbed0de..a2cd97cdc 100644 --- a/src/api/registerer.ts +++ b/src/api/registerer.ts @@ -300,6 +300,22 @@ export class Registerer { }); } + public disposeWithoutUnregister(): Promise { + if (this.disposed) { + return Promise.resolve(); + } + this.disposed = true; + this.logger.log(`Registerer ${this.id} in state ${this.state} is being deleted`); + + // Remove from the user agent's registerer collection + delete this.userAgent._registerers[this.id]; + + return new Promise((resolve) => { + this.terminated(); + resolve(); + }); + } + /** * Sends the REGISTER request. * @remarks From 0086f089d3bca2cf89c38ce4ff449bf8259fc1bd Mon Sep 17 00:00:00 2001 From: Slavik Date: Tue, 14 Feb 2023 13:46:48 +0200 Subject: [PATCH 11/13] Add extraHeaders to unsubscribe --- src/api/subscriber.ts | 4 ++-- src/api/subscription-unsubscribe-options.ts | 4 +++- src/core/dialogs/subscription-dialog.ts | 3 +-- src/core/subscription/subscription.ts | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/api/subscriber.ts b/src/api/subscriber.ts index 6481f3a7c..55a4a6b0f 100644 --- a/src/api/subscriber.ts +++ b/src/api/subscriber.ts @@ -246,13 +246,13 @@ export class Subscriber extends Subscription { break; case SubscriptionDialogState.Pending: if (this._dialog) { - this._dialog.unsubscribe(); + this._dialog.unsubscribe(options); // responses intentionally ignored } break; case SubscriptionDialogState.Active: if (this._dialog) { - this._dialog.unsubscribe(); + this._dialog.unsubscribe(options); // responses intentionally ignored } break; diff --git a/src/api/subscription-unsubscribe-options.ts b/src/api/subscription-unsubscribe-options.ts index 85f3b1264..44ce19a14 100644 --- a/src/api/subscription-unsubscribe-options.ts +++ b/src/api/subscription-unsubscribe-options.ts @@ -3,4 +3,6 @@ * Options for {@link Subscription.unsubscribe}. * @public */ -export interface SubscriptionUnsubscribeOptions {} +export interface SubscriptionUnsubscribeOptions { + extraHeaders?: Array; +} diff --git a/src/core/dialogs/subscription-dialog.ts b/src/core/dialogs/subscription-dialog.ts index ddaa2a095..10364c92b 100644 --- a/src/core/dialogs/subscription-dialog.ts +++ b/src/core/dialogs/subscription-dialog.ts @@ -343,9 +343,8 @@ export class SubscriptionDialog extends Dialog implements Subscription { * 4.1.2.3. Unsubscribing * https://tools.ietf.org/html/rfc6665#section-4.1.2.3 */ - public unsubscribe(): OutgoingSubscribeRequest { + public unsubscribe(options: RequestOptions = {}): OutgoingSubscribeRequest { const allowHeader = "Allow: " + AllowedMethods.toString(); - const options: RequestOptions = {}; options.extraHeaders = (options.extraHeaders || []).slice(); options.extraHeaders.push(allowHeader); options.extraHeaders.push("Event: " + this.subscriptionEvent); diff --git a/src/core/subscription/subscription.ts b/src/core/subscription/subscription.ts index 6da064f92..f7be068e0 100644 --- a/src/core/subscription/subscription.ts +++ b/src/core/subscription/subscription.ts @@ -43,7 +43,7 @@ export interface Subscription { * 4.1.2.3. Unsubscribing * https://tools.ietf.org/html/rfc6665#section-4.1.2.3 */ - unsubscribe(): OutgoingSubscribeRequest; + unsubscribe(options?: RequestOptions): OutgoingSubscribeRequest; } /** From c9a6e289209f7b2c5711483fa1c32e6ecd24f534 Mon Sep 17 00:00:00 2001 From: netdad1712 Date: Sun, 12 Mar 2023 12:48:16 +0200 Subject: [PATCH 12/13] align with source sipJS source --- src/api/user-agent-options.ts | 2 +- src/core/messages/digest-authentication.ts | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/api/user-agent-options.ts b/src/api/user-agent-options.ts index 955d1b6f4..5eb037d72 100644 --- a/src/api/user-agent-options.ts +++ b/src/api/user-agent-options.ts @@ -49,7 +49,7 @@ export interface UserAgentOptions { * Authorization password. * @defaultValue `""` */ - authorizationPassword?: string | Function; + authorizationPassword?: string; /** * Authorization username. diff --git a/src/core/messages/digest-authentication.ts b/src/core/messages/digest-authentication.ts index dfc93ed64..d5ea2663e 100644 --- a/src/core/messages/digest-authentication.ts +++ b/src/core/messages/digest-authentication.ts @@ -20,7 +20,7 @@ export class DigestAuthentication { private logger: Logger; private ha1: string | undefined; private username: string | undefined; - private password: string | Function | undefined; + private password: string | undefined; private cnonce: string | undefined; private nc: number; private ncHex: string; @@ -43,7 +43,7 @@ export class DigestAuthentication { loggerFactory: LoggerFactory, ha1: string | undefined, username: string | undefined, - password: string | Function | undefined + password: string | undefined ) { this.logger = loggerFactory.getLogger("sipjs.digestauthentication"); this.username = username; @@ -168,11 +168,7 @@ export class DigestAuthentication { // HA1 = MD5(A1) = MD5(username:realm:password) ha1 = this.ha1; if (ha1 === "" || ha1 === undefined) { - if (typeof this.password === "function") { - ha1 = MD5(this.username + ":" + this.realm + ":" + this.password()); - } else { - ha1 = MD5(this.username + ":" + this.realm + ":" + this.password); - } + ha1 = MD5(this.username + ":" + this.realm + ":" + this.password); } if (this.qop === "auth") { From 0d087da7bed05637ae437696f9e8a7993de7a1ee Mon Sep 17 00:00:00 2001 From: slavikbialik Date: Thu, 8 Jun 2023 15:58:12 +0300 Subject: [PATCH 13/13] no message --- src/api/registerer.ts | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/api/registerer.ts b/src/api/registerer.ts index a06404394..c3790ec27 100644 --- a/src/api/registerer.ts +++ b/src/api/registerer.ts @@ -287,22 +287,6 @@ export class Registerer { }); } - public disposeWithoutUnregister(): Promise { - if (this.disposed) { - return Promise.resolve(); - } - this.disposed = true; - this.logger.log(`Registerer ${this.id} in state ${this.state} is being deleted`); - - // Remove from the user agent's registerer collection - delete this.userAgent._registerers[this.id]; - - return new Promise((resolve) => { - this.terminated(); - resolve(); - }); - } - /** * Sends the REGISTER request. * @remarks