Data Sources
Minimal Server Integration
Keep Telnyx pointed at your app. Add one small forwarder for final STT and one for TTS:Copy-Paste Middleware
Use one server-side helper. STT can run inside the incoming Telnyx webhook handler. TTS must run beside the existing Telnyx speak/playback call because that is where your backend has the bot text.Telnyx SDK Users
Using the Telnyx Node or Python SDK does not replace the STT webhook. Keepwebhook_url
configured on the call so final call.transcription events still reach your backend.
Then wrap the SDK speak call to record TTS.
Node.js:
session_id for STT and TTS events from the same call/session.
It can be the Telnyx conversation_id, call_session_id, or call_control_id; Agnost turns non-UUID Telnyx IDs into stable dashboard UUIDs and keeps the original ID in metadata.
Pass a stable event_id when your middleware can retry the same STT/TTS event.
Agnost’s voice service stores final STT in memory for up to 10 minutes until the next TTS event for the same session_id.
That TTS write becomes one dashboard event with user speech in args and bot speech in result.
If a TTS event arrives without a queued STT, or after that queue expires, Agnost records it as output-only.
Troubleshooting
- Only bot messages appear: TTS is arriving before final STT, more than 10 minutes after STT, or with a different
session_id. - No user input appears: you are forwarding partial STT only. Agnost ignores STT where
finaloris_finalisfalse. - TTS appears in a separate conversation: pass the same Telnyx conversation or call ID as
session_id. - The accepted
session_idlooks different from the Telnyx ID: use the returnedconversation_idin dashboard/debug links. The original Telnyx ID is stored as metadata. - No events appear: confirm
X-Org-Idis set and your server can reach the Agnost voice service. - Missing bot output: you are forwarding STT only. Post the TTS text after the Telnyx speak/playback request succeeds.
