From c0d3cb4f39ee7fe6ad790243eea10401086247b0 Mon Sep 17 00:00:00 2001 From: Viktor Istomin Date: Mon, 24 Mar 2025 18:02:55 +0400 Subject: [PATCH] Add ability to disable `autoStop` feature for SimpleUser --- src/platform/web/simple-user/simple-user-options.ts | 6 ++++++ src/platform/web/simple-user/simple-user.ts | 1 + 2 files changed, 7 insertions(+) diff --git a/src/platform/web/simple-user/simple-user-options.ts b/src/platform/web/simple-user/simple-user-options.ts index fa052a2d4..5c81bca4b 100644 --- a/src/platform/web/simple-user/simple-user-options.ts +++ b/src/platform/web/simple-user/simple-user-options.ts @@ -68,6 +68,12 @@ export interface SimpleUserOptions { */ aor?: string; + /** + * If `true`, the user agent calls the `stop()` method on the window event `beforeunload`. + * @defaultValue `true` + */ + autoStop?: boolean; + /** * Delegate for SimpleUser. */ diff --git a/src/platform/web/simple-user/simple-user.ts b/src/platform/web/simple-user/simple-user.ts index 14003def3..b966f3eb6 100644 --- a/src/platform/web/simple-user/simple-user.ts +++ b/src/platform/web/simple-user/simple-user.ts @@ -44,6 +44,7 @@ export class SimpleUser { // Session manager options const sessionManagerOptions: SessionManagerOptions = { aor: this.options.aor, + autoStop: this.options.autoStop, delegate: { onCallAnswered: () => this.delegate?.onCallAnswered?.(), onCallCreated: (session: Session) => {