Repository navigation
feat(telnyx): keep TeXML call timing and relayed annotations as tags - #9
Merged
Merged
Conversation
The TeXML recording callback carries CallInitiatedAt and RecordingStartTime.
The gap between them is the ringback, where a pre-answer recording notice
plays, so a downstream consent check needs both. They now become the
call_initiated_at and recording_started_at tags.
A service that relays the callback can add Annotation-<name> form fields,
for example which notice it played and that file's hash. Each becomes an
annotation_<name> tag. Names are limited to [A-Za-z0-9_]{1,64}; others are
dropped. They carry the same trust as the rest of the unsigned TeXML form.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
The TeXML
recordingStatusCallbackhandler keeps two more pieces of the callback, and the builder emits them as vCon tags next to the existing Telnyx IDs.CallInitiatedAtandRecordingStartTimebecome thecall_initiated_atandrecording_started_attags. The gap between them is the ringback, which is where a pre-answer recording notice plays. That makes the two timestamps the evidence a consent check needs, since the notice itself isn't in a recording that starts at answer.Annotation-<name>form fields, for example which notice it played and that file's hash. Each becomes anannotation_<name>tag. Names are limited to[A-Za-z0-9_]{1,64}, and anything else is dropped.Trust
Annotations are exactly as trusted as the rest of the TeXML form. That path is unsigned, as the existing docstring notes, so deployments should keep the endpoint reachable only by the relaying service.
Testing
pytest tests: 486 passed.black --check .andruff check .are clean. The TeXML test now asserts the timing tags, and a new test covers annotation passthrough and dropping invalid names.🤖 Generated with Claude Code