TEL-6986: avoid muting partner leg on inactive hold - #576
TEL-6986: avoid muting partner leg on inactive hold#576minhtuan1407-telnyx wants to merge 5 commits into
Conversation
|
Added an opt-in compatibility/rollback knob after HWR review: Default remains Option A. If unset, B-leg HWR Dev-FreeSWITCH re-review verdict: APPROVE. — 🪽 Hermes War Room |
|
Updated per Tuan direction: TEL-6986 behavior is now opt-in per selected calls, not system-wide by default. Use: Unset/default preserves historical inactive propagation. Setting the variable on either bridge leg skips inactive propagation to a non-held/non-inactive partner leg for that call. HWR Dev-FreeSWITCH re-review verdict: APPROVE. — 🪽 Hermes War Room |
|
🔬 Analyst review — TEL-6986 partner-leg inactive-hold mute Verdict: REQUEST CHANGES Evidence — tracing the predicateThe hot path (post-patch if (new_smode == SENDRECV || new_smode == RECVONLY) {
if (other_engine->rmode != INACTIVE) {
other_engine->smode = opp_smode;
}
} else if (new_smode != INACTIVE || !disable_inactive_partner_propagation ||
other_engine->rmode == INACTIVE || partner_held) {
other_engine->smode = opp_smode;
}Walking
With default Issues1.
|
Summary
Fixes TEL-6986 with Option A: do not propagate a held B-leg
a=inactiveanswer to a non-held partner/A-leg media flow.The B-leg SDP behavior remains RFC-correct:
But the partner leg is no longer forced to
SWITCH_MEDIA_FLOW_INACTIVEunless the partner itself is held/inactive.Root cause
Current source updates the partner leg's audio
smodewhen generating an SDP answer for a re-INVITE.For the failing case:
Then
switch_core_media_write_frame()suppresses audio writes because it only allows normal audio writes when target audio flow isSENDRECVorSENDONLY.This explains the observed evidence:
Implementation
In
src/switch_core_media.c, when generating an SDP answer for a re-INVITE:sendrecv,sendonly, andrecvonlyflows;inactive, update the partner to inactive only if the partner endpoint is also held/inactive:rmode == SWITCH_MEDIA_FLOW_INACTIVE, orCF_HOLD, orCF_LEG_HOLDING.This keeps
a=inactivescoped to the held dialog leg and avoids muting the separate non-held B2BUA partner leg.Opt-in channel variable
Added an opt-in channel variable so TEL-6986 behavior can be enabled only for selected calls:
Default/unset behavior preserves the historical behavior: a B-leg
a=inactiveanswer still propagates inactive media flow to the partner leg.When this variable is set on either bridge leg, inactive propagation is skipped for a non-held/non-inactive partner leg, keeping that partner leg writable for TEL-6986-style calls.
Why not
bridge_generate_comfort_noiseThis PR intentionally does not use
bridge_generate_comfort_noise.The latest TEL-6986 evidence showed the issue is partner media-flow propagation/write suppression, not the existing comfort-noise/CNG substitution feature. The logs also used explicit
playback(/usr/share/sounds/noise.wav), notbridge_generate_comfort_noise.HWR review
HWR Dev-FreeSWITCH review verdict: APPROVE.
Review findings:
src/switch_core_media.c;bridge_generate_comfort_noisereferences in the diff;int partner_helddeclaration is at the top of the block;switch_core_session_get_partner()/switch_core_session_rwunlock()pairing remains intact;git diff --checkpasses;Validation
Local validation performed:
Runtime validation still required on a patched B2BUA build:
Supersedes the previous hold-generated-silence/comfort-noise approach in #574.
— 🪽 Hermes War Room