Skip to content

feat(recording): Telnyx recording parity#106

Merged
nicolotognoni merged 2 commits into
PatterAI:mainfrom
a692570:telnyx-recording-parity
May 25, 2026
Merged

feat(recording): Telnyx recording parity#106
nicolotognoni merged 2 commits into
PatterAI:mainfrom
a692570:telnyx-recording-parity

Conversation

@a692570
Copy link
Copy Markdown
Contributor

@a692570 a692570 commented May 25, 2026

This PR brings Telnyx call recording to feature parity with Twilio across the Python and TypeScript SDKs.

Background

Telnyx Call Control already supports recording via the actions/record_start and actions/record_stop REST endpoints. Both Python and TypeScript stream bridges already POST to these endpoints when recording=True is passed. This PR closes the remaining feature gaps.

What Changed

Python — libraries/python/getpatter/server.py

  • Added a call.recording.saved webhook handler in the Telnyx voice webhook. When Telnyx notifies that a recording is saved, we extract the recording URL (trying recording_urls → public_recording_urls, mp3 then wav) and log an INFO message.
  • Mirrors the existing Twilio /webhooks/twilio/recording route and the existing TypeScript handler.

Python tests — libraries/python/tests/unit/test_telnyx_bridge_unit.py

  • Added two unit tests:
    • test_recording_posts_to_telnyx_api — verifies record_start is sent when recording=True is passed to telnyx_stream_bridge.
    • test_recording_stopped_on_call_end — verifies record_stop is posted in the finally block when the stream ends.

Documentation — all READMEs

  • Removed the "Recording is Twilio-only" claim from:
    • Root README.md
    • libraries/python/README.md
    • libraries/typescript/README.md

TypeScript — libraries/typescript/src/stream-handler.ts

  • Updated the startRecordingIfRequested JSDoc comment to reflect that both Twilio and Telnyx are supported.

Files Changed

  • libraries/python/getpatter/server.py
  • libraries/python/README.md
  • libraries/python/tests/unit/test_telnyx_bridge_unit.py
  • libraries/typescript/README.md
  • libraries/typescript/src/stream-handler.ts
  • README.md

What Was NOT Changed

  • No Twilio code paths were modified — Twilio recording stays exactly as-is.
  • No new dependencies added — Telnyx recording is pure httpx, already a base dependency.
  • The existing telnyx_stream_bridge start/stop recording functions and the TypeScript server TS equivalent are unchanged.

Usage

When a call is answered, telnyx_stream_bridge automatically POSTs to Telnyx actions/record_start. When the stream ends (or the call hangs up), it POSTs to actions/record_stop. The webhook handler logs the recording URL when Telnyx emits call.recording.saved.

Edge Cases

  • If Telnyx does not emit call.recording.saved (e.g. recording stopped before any audio), nothing is logged — no noise.
  • If the recording payload lacks URL fields, the log line shows an empty URL but still records the call control ID.
  • Telnyx auto-stops recording on hangup, so the explicit record_stop in the finally block is best-effort and non-fatal.

@nicolotognoni nicolotognoni force-pushed the telnyx-recording-parity branch from 243ea4f to e54d5c1 Compare May 25, 2026 16:18
nicolotognoni added a commit that referenced this pull request May 25, 2026
GitHub Actions does not pass repository secrets
(`CLAUDE_CODE_OAUTH_TOKEN`) or emit OIDC tokens for `pull_request`
workflows triggered by forks. The `anthropics/claude-code-action@v1`
action consequently fails with "Could not fetch an OIDC token" every
time an external contributor opens a PR, leaving a spurious red check
on the rollup.

Gate the job on `github.event.pull_request.head.repo.fork == false` so
the workflow is skipped (not failed) for fork PRs. Maintainers can
still trigger a code review manually by mentioning @claude in a comment
— that path goes through `claude.yml` (`workflow_dispatch` /
`issue_comment` triggers) which runs in the upstream repo's security
context with access to secrets.

No behaviour change for PRs opened from branches in the upstream repo.

Refs PR #106 (Telnyx recording parity by external contributor) which
surfaced the noise.
Abhishek and others added 2 commits May 25, 2026 18:41
Bring Telnyx call recording to feature parity with Twilio across
the Python and TypeScript SDKs.

Telnyx Call Control already supports recording via the
 and  REST endpoints.
Both Python and TypeScript stream bridges already POST to these
endpoints when  is passed.  This PR closes the
remaining gaps:

- **Python server**: add a  webhook handler
  that logs the recording URL (mirrors the Twilio
   route and the existing TS handler).
  Tries  → , mp3 then wav.

- **Docs**: remove the "Recording is Twilio-only" claim from all
  three READMEs (root, python/, typescript/).

- **TypeScript inline docs**: update the
  comment to reflect that both Twilio and Telnyx are supported.

- **Tests**: add unit tests for Telnyx bridge recording
  (,
  ).

Files changed:
- libraries/python/getpatter/server.py
- libraries/python/README.md
- libraries/python/tests/unit/test_telnyx_bridge_unit.py
- libraries/typescript/README.md
- libraries/typescript/src/stream-handler.ts
- README.md

No Twilio code paths were modified.  No new dependencies were added
(Telnyx recording is pure httpx, already a base dependency).
Maintainer follow-up on Abhishek's Telnyx recording parity PR (#106):

- Resolved README rebase conflict against post-0.6.2 main. Aligned all
  three READMEs (root, libraries/python, libraries/typescript) on the
  same copy ("Recording parity is supported via Telnyx Call Control;
  consult the Telnyx portal for configuration details.") that #103
  introduced on the root README.
- Added CHANGELOG.md entries under ## Unreleased / ### Added and
  ### Changed (invariant 0 of documentation-best-practices.md).
- Added 4 unit tests in tests/unit/test_server_unit.py covering the new
  call.recording.saved webhook handler:
    * mp3 URL preferred over wav
    * wav fallback when mp3 missing
    * public_recording_urls fallback when recording_urls is empty
    * empty payload still logs call_control_id, returns 200
  The contributor's tests covered the bridge (which was already
  implemented pre-PR); this commit covers the actually new code path.

All tests green: pytest tests/unit/test_server_unit.py
::TestTelnyxRecordingSavedWebhook → 4 passed; existing
TestTelnyxRecording bridge tests → 2 passed.
@nicolotognoni nicolotognoni force-pushed the telnyx-recording-parity branch from e54d5c1 to 3d95577 Compare May 25, 2026 16:54
@nicolotognoni nicolotognoni merged commit 71764ea into PatterAI:main May 25, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants