Erster Commit

This commit is contained in:
2026-08-22 08:40:29 +02:00
commit 875477d425
1961 changed files with 930336 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
{"version":3,"sources":["../src/dialTimeout.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2026 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\n\n// Shared request-timeout handling for calls that may block until a call is\n// answered (SIP CreateSIPParticipant/TransferSIPParticipant, WhatsApp\n// AcceptWhatsAppCall). These take longer than a normal API call, and the request\n// must outlast the wait or it would abort before the call is answered.\n\n/**\n * Ring window (seconds) assumed when a request doesn't set a ringing timeout;\n * matches the server default. A dialing request must outlast it.\n */\nexport const DEFAULT_RINGING_TIMEOUT_SECONDS = 30;\n\n/**\n * When a call waits on ringing, the request must outlast the ringing window or\n * it would abort before the call can be answered. We keep at least this margin\n * (seconds) of request timeout above the ringing timeout.\n */\nexport const RINGING_TIMEOUT_MARGIN_SECONDS = 2;\n\n/**\n * Resolves the request timeout (seconds) for a phone-dialing call: the ring\n * window plus a margin, so the request doesn't abort before the call can be\n * answered. The ring window is the request's `ringingTimeout` when set, else\n * {@link DEFAULT_RINGING_TIMEOUT_SECONDS}. A longer user-supplied `timeout` is\n * honored; a shorter one is raised to the floor.\n */\nexport function dialRequestTimeout(\n timeout: number | undefined,\n ringingTimeout: number | undefined,\n): number {\n const ring = ringingTimeout ?? DEFAULT_RINGING_TIMEOUT_SECONDS;\n const floor = ring + RINGING_TIMEOUT_MARGIN_SECONDS;\n return Math.max(timeout ?? floor, floor);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaO,MAAM,kCAAkC;AAOxC,MAAM,iCAAiC;AASvC,SAAS,mBACd,SACA,gBACQ;AACR,QAAM,OAAO,kBAAkB;AAC/B,QAAM,QAAQ,OAAO;AACrB,SAAO,KAAK,IAAI,WAAW,OAAO,KAAK;AACzC;","names":[]}