Vision-Agents icon indicating copy to clipboard operation
Vision-Agents copied to clipboard

Add Telnyx media streaming plugin

Open a692570 opened this issue 5 months ago â€ĸ 4 comments

Why

Vision Agents already has a Twilio phone plugin and phone examples. Telnyx also supports WebSocket media streaming with PCMU, PCMA, L16, and bidirectional RTP, so this adds a parallel carrier media bridge without changing core agent APIs.

Reference: https://developers.telnyx.com/docs/voice/programmable-voice/media-streaming

Changes

  • Add vision-agents-plugins-telnyx as a workspace package and optional vision-agents[telnyx] extra
  • Add Telnyx media stream WebSocket handling for connected, start, media, stop, error, mark, and dtmf events
  • Add PCMU, PCMA, and L16 RTP payload conversion helpers using Vision Agents PcmData
  • Add a Telnyx call registry and attach_phone_to_call bridge matching the existing Twilio plugin shape
  • Add tests for audio conversion, registry behavior, media stream receive, and bidirectional audio send

Testing

  • uv run ruff check plugins/telnyx agents-core/pyproject.toml pyproject.toml README.md
  • uv run ruff format --check plugins/telnyx
  • uv run pytest plugins/twilio/tests plugins/telnyx/tests
  • git diff --check
  • secret scan over the diff found no matches

a692570 avatar Jun 03 '26 22:06 a692570

Review Change Stack

No actionable comments were generated in the recent review. 🎉

â„šī¸ Recent review info
âš™ī¸ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 774adc34-28d3-4e69-824d-0b6f83050a7a

đŸ“Ĩ Commits

Reviewing files that changed from the base of the PR and between 851dbaf06e575352932979015969dc9a82889b5a and 82aedc781d67c0d478c4af707d5281263cad5637.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • README.md
  • agents-core/pyproject.toml
  • pyproject.toml
✅ Files skipped from review due to trivial changes (2)
  • README.md
  • pyproject.toml
🚧 Files skipped from review as they are similar to previous changes (1)
  • agents-core/pyproject.toml

📝 Walkthrough

Walkthrough

This PR adds a complete Telnyx plugin to Vision-Agents, enabling bidirectional audio integration for Telnyx voice calls. The plugin includes workspace configuration updates, audio codec conversion for PCMU/PCMA/L16 RTP payloads, an in-memory call registry with lifecycle management and token validation, a WebSocket-based media stream handler that bridges Telnyx and GetStream RTC audio, RTC call attachment for bidirectional audio forwarding, and comprehensive unit tests. The implementation also updates the main README to reflect Telnyx support alongside existing Twilio integration.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

â¤ī¸ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Jun 03 '26 22:06 coderabbitai[bot]

Hi thank you for your PR, our team is reviewing and will follow up.

Nash0x7E2 avatar Jun 13 '26 03:06 Nash0x7E2

@a692570 - can you have a look at the remarks from Coderabbit?

Nash0x7E2 avatar Jun 13 '26 03:06 Nash0x7E2

@Nash0x7E2 thanks for the nudge. I addressed the CodeRabbit remarks in the latest branch updates.

Covered:

  • removed caller and callee phone numbers from info logs
  • gated outbound Telnyx audio until the start frame is parsed
  • recreated the audio track from the negotiated media format
  • added RTC cleanup when the Telnyx media stream closes
  • added tests for negotiation, gated send, and cleanup
  • merged current main to clear the PR conflict

Local checks passed:

  • uv lock --check
  • uv run pytest plugins/telnyx/tests/test_telnyx.py plugins/telnyx/tests/test_audio.py
  • uv run ruff check plugins/telnyx && uv run ruff format --check plugins/telnyx
  • uv run mypy plugins/telnyx

CodeRabbit is passing now and the PR is no longer conflicted. GitHub still shows the PR as blocked because the fork PR CI workflows appear to need maintainer approval/action.

a692570 avatar Jun 15 '26 00:06 a692570