Skip to content

TEL-6718: Fix transfer_extension CRIT log spam in switch_channel.c:1580 - #538

Open
minhtuan1407-telnyx wants to merge 2 commits into
telnyx/telephony/deploy-developmentfrom
fix/TEL-6718-transfer-extension-crit
Open

TEL-6718: Fix transfer_extension CRIT log spam in switch_channel.c:1580#538
minhtuan1407-telnyx wants to merge 2 commits into
telnyx/telephony/deploy-developmentfrom
fix/TEL-6718-transfer-extension-crit

Conversation

@minhtuan1407-telnyx

Copy link
Copy Markdown

Summary

Fixes TEL-6718[CRIT] switch_channel.c:1580 Invalid data (${transfer_extension} contains a variable) log spam.

Root Cause

Commit 6d3c0eaf7c (ENGDESK-43915: Fire FS Events for IVR Transfer) added transfer tracking variables in switch_ivr_session_transfer() using switch_channel_set_variable(), which defaults to var_check=SWITCH_TRUE.

When extension contains unexpanded FreeSWITCH ${...} references (legitimately passed via ESL uuid_transfer), switch_string_var_check_const() detects ${ and emits the CRIT at switch_channel.c:1580.

Fix

Change the transfer tracking variable writes to use switch_channel_set_variable_var_check(..., SWITCH_FALSE) so the metadata is stored as-is:

switch_channel_set_variable_var_check(channel, "transfer_extension", extension, SWITCH_FALSE);
switch_channel_set_variable_var_check(channel, "transfer_dialplan", use_dialplan, SWITCH_FALSE);
switch_channel_set_variable_var_check(channel, "transfer_context", use_context, SWITCH_FALSE);

Why this is safe

  • These are informational transfer-tracking values, not values that need validation/expansion.
  • SWITCH_TRANSFER_SOURCE_VARIABLE already uses SWITCH_FALSE in the same function.
  • This prevents false-positive CRITs without changing transfer behavior.

Test Plan

  1. Trigger uuid_transfer with an extension containing ${var}.
  2. Verify no CRIT at switch_channel.c:1580.
  3. Verify transfer events still contain Transfer-Extension, Transfer-Dialplan, and Transfer-Context.
  4. Verify normal transfers remain unchanged.

— 🦀 Analysis by Council of Claws (Dev, Orchestrator)

Dev Agent and others added 2 commits March 13, 2026 19:17
The ENGDESK-43915 commit (6d3c0ea) added transfer event tracking variables
using switch_channel_set_variable() which defaults to var_check=SWITCH_TRUE.
When the transfer extension contains unexpanded ${...} references (e.g. from
ESL uuid_transfer commands), switch_string_var_check_const() detects the
pattern and logs a CRIT at switch_channel.c:1580, accounting for 97.67% of
all CRIT logs in b2bua.

Fix: Use switch_channel_set_variable_var_check() with SWITCH_FALSE for the
transfer tracking variables (transfer_extension, transfer_dialplan,
transfer_context). These are informational values stored for transfer event
tracking and do not need variable content validation.

This is consistent with the existing pattern two lines above where
SWITCH_TRANSFER_SOURCE_VARIABLE uses SWITCH_FALSE for the same reason.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants