Skip to content

feat(android): configurable incoming/outgoing call timeout via CallkeepAndroidOptions#244

Merged
SERDUN merged 4 commits intodevelopfrom
feat/configurable-call-timeout
Apr 9, 2026
Merged

feat(android): configurable incoming/outgoing call timeout via CallkeepAndroidOptions#244
SERDUN merged 4 commits intodevelopfrom
feat/configurable-call-timeout

Conversation

@SERDUN
Copy link
Copy Markdown
Member

@SERDUN SERDUN commented Apr 9, 2026

Summary

  • Adds incomingCallTimeoutMs and outgoingCallTimeoutMs to CallkeepAndroidOptions so callers can configure how long the app waits before auto-disconnecting an unanswered call
  • Default is 60 000 ms (both Dart constructor and native fallback), up from the previous hardcoded 35 000 ms
  • Values are persisted via StorageDelegate.Timeout and read by ConnectionTimeout factory methods at connection creation time — no change needed to call sites beyond passing context
  • Generated Pigeon files (callkeep.pigeon.dart, Generated.kt) regenerated via flutter pub run pigeon

Motivation

PortaSIP terminates unanswered calls after 120 s. The previous 35 s hardcoded timeout caused CallKeep to disconnect calls on the Android side well before PortaSIP acted, resulting in unexpected early hang-ups (see WT-1273).

Usage

android: CallkeepAndroidOptions(
  ringtoneSound: Assets.ringtones.incomingCall1,
  ringbackSound: Assets.ringtones.outgoingCall1,
  incomingCallTimeoutMs: 120000,  // align with PortaSIP
  outgoingCallTimeoutMs: 120000,
),

Test plan

  • Incoming call — do not answer — verify call stays active for at least 60 s before auto-disconnect
  • Outgoing call — remote does not answer — verify caller stays in DIALING for at least 60 s
  • Pass explicit incomingCallTimeoutMs: 120000 — verify timeout fires after 120 s
  • Omit the fields — verify default 60 s behaviour

Fixes WT-1273

SERDUN added 3 commits April 9, 2026 15:14
…tions

Add incomingCallTimeoutMs and outgoingCallTimeoutMs to CallkeepAndroidOptions
so callers can align the no-answer disconnect behaviour with their SIP server.
Values are persisted via StorageDelegate.Timeout and read by ConnectionTimeout
factory methods at connection creation time. Default remains 35 000 ms when
not specified.

Fixes WT-1273

This comment was marked as resolved.

…ate tests

- incomingCallTimeoutMs/outgoingCallTimeoutMs changed from int? to int
  in CallkeepAndroidOptions (default 60000 always sent over Pigeon,
  docs updated to reflect that null is no longer a valid state)
- Add StorageDelegateTimeoutTest: default 60s, set/get round-trip,
  incoming and outgoing stored independently
@SERDUN SERDUN requested a review from digiboridev April 9, 2026 12:30
@SERDUN SERDUN marked this pull request as ready for review April 9, 2026 12:30
@SERDUN SERDUN merged commit dafcc51 into develop Apr 9, 2026
3 checks passed
@SERDUN SERDUN deleted the feat/configurable-call-timeout branch April 9, 2026 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants