Does anyone understand why the Agent Scripting JSON payload is truncating custom attributes when a call routes through our secondary BYOC trunk?
We are managing 15 BYOC trunks in the Asia/Singapore region. The primary carrier handles 90% of traffic, but during peak hours, failover triggers to the secondary carrier. When this happens, the JSON parse error: Unexpected token < appears in the script execution logs.
The script relies on retrieving trunk-specific metadata via the /api/v2/analytics/reporting/query endpoint to populate dynamic text-to-speech prompts. The primary trunk returns a valid JSON object with all required fields. However, the secondary trunk response seems to include XML-like headers or malformed content, causing the script engine to crash.
We have verified the SIP registration status is healthy for both carriers. The issue is isolated to the data retrieval step within the Architect flow. We are using SDK Python 2.1.8 for our backend validation scripts. The error occurs consistently when the trunk_id variable switches to the secondary carrier ID.
Has anyone encountered similar metadata formatting discrepancies between primary and secondary BYOC trunks? We need to ensure the scripting engine receives a clean JSON payload regardless of the active carrier.