sip: retry IMS registration instead of silently going dark - #33
Open
SavedByLight wants to merge 1 commit into
Open
sip: retry IMS registration instead of silently going dark#33SavedByLight wants to merge 1 commit into
SavedByLight wants to merge 1 commit into
Conversation
Previously any REGISTER failure (bad challenge, non-200 response, or a thrown exception in registerCallback via require(statusCode == 200)) left the client permanently deregistered with no automatic recovery path other than the periodic keep-alive alarm, which only fired every 50 minutes. Combined with onAvailable()'s one-shot `network.isInitialized` guard (which could never retrigger a connect() once set, even after the network was lost and regained), a single transient failure could mean missed VoLTE calls/SMS for up to 50 minutes, or indefinitely until a manual VoLTE/airplane-mode toggle. SipHandler.kt: - Add `sessionActive` flag, `scheduleReconnect()` with exponential backoff (5s -> 120s cap), and `ensureRegistered()`. - connect()'s two hard-failure paths (bad initial challenge, failed authenticated REGISTER) now call scheduleReconnect() instead of just returning. - registerCallback() no longer throws/kills the thread on a non-200 response; it schedules a reconnect instead. - A successful registration resets the backoff counter and marks the session active. - getVolteNetwork()'s NetworkCallback now keys reconnection off sessionActive instead of the permanently-latched network.isInitialized check, so losing and regaining the network actually triggers a reconnect. PhhImsService.kt: - Shorten the periodic keep-alive alarm from 3,000,000ms (50 min) to 180,000ms (3 min); cheap now that ensureRegistered() only does real work when needed. PhhImsBroadcastReceiver.kt: - Periodic alarm handler now calls ensureRegistered() instead of a raw register() against a socket that may already be dead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously any REGISTER failure (bad challenge, non-200 response, or a thrown exception in registerCallback via require(statusCode == 200)) left the client permanently deregistered with no automatic recovery path other than the periodic keep-alive alarm, which only fired every 50 minutes. Combined with onAvailable()'s one-shot
network.isInitializedguard (which could never retrigger a connect() once set, even after the network was lost and regained), a single transient failure could mean missed VoLTE calls/SMS for up to 50 minutes, or indefinitely until a manual VoLTE/airplane-mode toggle.SipHandler.kt:
sessionActiveflag,scheduleReconnect()with exponential backoff (5s -> 120s cap), andensureRegistered().PhhImsService.kt:
PhhImsBroadcastReceiver.kt: