Skip to content

fix(call): handle incoming call hangup when signaling is unavailable (WT-1080)#1106

Merged
SERDUN merged 2 commits into
developfrom
fix/wt-1080-incoming-call-hangup
Apr 13, 2026
Merged

fix(call): handle incoming call hangup when signaling is unavailable (WT-1080)#1106
SERDUN merged 2 commits into
developfrom
fix/wt-1080-incoming-call-hangup

Conversation

@SERDUN

@SERDUN SERDUN commented Apr 12, 2026

Copy link
Copy Markdown
Member

Summary

Fixes two silent-drop paths in CallBloc where an incoming call registration failure is not reported back to the server, leaving the remote party with an indefinitely ringing call.

  • Path 1 (_onCallPushEventIncoming): iOS VoIP push — CXProvider rejects call registration (DND, blocklist, unentitled). Signaling is likely disconnected at this point — hangup must be queued and sent on first reconnect.
  • Path 2 (__onCallSignalingEventIncoming): reportNewIncomingCall returns an unhandled error (callRejectedBySystem on Android, unknown/internal on iOS). Signaling is connected — hangup can be sent immediately.

Investigation notes

  • didPushIncomingCall(error≠null) is de-facto iOS-only: Android also fires this callback but always with error=null (see ForegroundService.handleCSReportDidPushIncomingCall)
  • callRejectedBySystem only surfaces in Path 2 via reportNewIncomingCall() return; it never arrives through didPushIncomingCall
  • In both paths performEndCall will not be triggered — the call was never registered with CallKit/Telecom

Files

  • lib/features/call/bloc/call_bloc.dart (~line 744, ~line 922)

YouTrack

WT-1080

SERDUN added 2 commits April 12, 2026 13:32
Path 1 (_onCallPushEventIncoming): iOS CXProvider may reject incoming call
registration before the user sees it (DND, blocklist, unentitled). Since
signaling is disconnected at push-receive time we cannot decline immediately.
The server replays the incoming event on next handshake reconnect, which
re-enters Path 2 where the SIP line is now known. Replaced the silent drop
with a descriptive log and explanation of the recovery path.

Path 2 (__onCallSignalingEventIncoming): when reportNewIncomingCall returns
an unexpected error (callRejectedBySystem on Android, unknown/internal on iOS)
send a DeclineRequest immediately. The call was never shown to the user so
performEndCall will not fire. _signalingModule.execute returns null when
disconnected — the ?. operator handles that safely.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes cases where an incoming call cannot be registered with the OS call UI (CallKit/Telecom) and would otherwise be silently dropped locally without notifying the server, leaving the remote party ringing indefinitely.

Changes:

  • Document and log the iOS VoIP-push path where the OS rejects call registration before the call is shown to the user.
  • On signaling-path reportNewIncomingCall failures, immediately notify the server by sending a DeclineRequest via _signalingModule.execute(...).

@SERDUN SERDUN marked this pull request as ready for review April 13, 2026 13:57
@SERDUN SERDUN merged commit 8c03a07 into develop Apr 13, 2026
5 checks passed
@SERDUN SERDUN deleted the fix/wt-1080-incoming-call-hangup branch April 13, 2026 13:57
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.

2 participants