TEN-Agent icon indicating copy to clipboard operation
TEN-Agent copied to clipboard

fix(ai_agents): align Telnyx SIP example with Call Control events

Open a692570 opened this issue 6 months ago • 0 comments

Summary

  • use Telnyx Call Control REST endpoints directly for dial, answer, and hangup
  • parse Telnyx webhook event payloads and update sessions from call_control_id
  • set stream_codec and stream_bidirectional_codec to PCMU so inbound and outbound media match the example's mu-law audio conversion
  • send bidirectional media frames in the Telnyx media shape without Twilio streamSid or extra stream_id fields
  • encode Call Control command paths
  • remove the unused Telnyx Python SDK dependency and align README API examples with the implemented routes
  • add focused tests for Telnyx URL building, webhook parsing, session updates, dial payloads, cleanup hangup behavior, and outbound media payload shape

Testing

  • python3 ai_agents/agents/examples/voice-assistant-sip-telnyx/tenapp/test_telnyx_call_control_events.py
  • python3 -m py_compile ai_agents/agents/examples/voice-assistant-sip-telnyx/tenapp/ten_packages/extension/main_python/server.py ai_agents/agents/examples/voice-assistant-sip-telnyx/tenapp/ten_packages/extension/main_python/extension.py ai_agents/agents/examples/voice-assistant-sip-telnyx/tenapp/test_telnyx_call_control_events.py
  • git diff --check

Secret scan

  • scanned the PR diff for key, token, password, bearer, authorization, private key, GitHub token, Slack token, AWS key, and Telnyx key patterns
  • matches were only code field names and the test placeholder test-key

a692570 avatar Jun 03 '26 04:06 a692570