fix(call): resolve T103 timeout in 1:1 audio calls#202
Merged
Conversation
Root cause diagnosed by @botnick in #198: the responder never considers its conn_req satisfied because linejs was missing the BEPI/MC media-channel handshake and had inconsistent channel IDs. Changes: 1. Channel ID consistency: for 1:1 calls, set localMediaChanId equal to srcChanId so the conn_rsp body mChanId and cc-header srcChanId match (the native app keeps them identical). 2. DATA channel SRTP: derive a recv SRTP context for the peer's DATA stream (pt=98) in 1:1 calls, not just group calls. Without this, inbound data-channel packets fail auth tag verification. 3. MC JOIN_REQ / CHANGE_REQ handlers: the peer drives a BEPI media handshake after answer (join_req, change_req) that linejs never answered. Added handlers that respond with join_rsp (0x3285), change_rsp (0x3286), and check_rpt (0x3287). 4. bepi_channel_open (0x1102): send the SC-layer channel-open message after join_rsp, matching the native app's post-answer sequence. 5. Refactored defaultOneToOneDataSessionPayload to share stream spec with the new MC response handlers.
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.
Summary
Fixes the T103 timeout (
CONN_REQ_FAIL.timeout, relCode=511) in 1:1 audio calls, where the responder tears down the call ~10s after answering.Root cause diagnosed by @botnick in #198 (with full native app wire captures + Frida instrumentation):
conn_rspbody advertisedmChanId=Xbut cc-header usedsrcChanId=Y. The native app keeps these identical. The responder couldn't correlate our MC messages with the conn handshake.join_req,change_req) that linejs never answered. Without responses, the peer never considers the connection established.pt=98) failed SRTP auth because linejs only derived DATA keying for group calls.Changes
localMediaChanId = srcChanIdfor 1:1 calls — conn_rsp body and cc-header now use the same channel ID#configureMediafor 1:1 callsJOIN_REQ→JOIN_RSP(0x3285) handlerCHANGE_REQ→CHANGE_RSP(0x3286) handlerCHECK_RPT(0x3287) sent after joinbepi_channel_open(0x1102) SC-layer message sent after join_rspdefaultOneToOneDataSessionPayloadto reuse shared stream specReplaces the closed #199 which took a wrong approach (UPD_RSP keepalive).
Ref: #198
Test plan
deno checkpassesdeno fmtpasses