Call recordings are useful, but they are usually passive.
This example turns a live phone call into something your app can use right away.
The edge-call-transcription-agent example answers an inbound call on Telnyx Edge Compute, starts streaming transcription, stores final transcript segments in an Agent SDK actor, summarizes the call after hangup with Telnyx AI Inference, persists the record, and sends the summary by SMS.
Code: https://github.com/team-telnyx/telnyx-code-examples/tree/main/edge-call-transcription-agent
What it builds
The app is a TypeScript Edge Compute function with two Agent SDK actors:
-
TranscribeAgent- one actor per call -
TranscriptRegistry- one shared actor for listing stored transcripts
The call flow:
call.initiated
-> record call state
-> answer call
call.answered
-> speak greeting
call.speak.ended
-> start inbound transcription
call.transcription
-> append transcript segment
call.hangup
-> summarize
-> store
-> SMS summary
Routes
-
POST /webhooks/voicereceives Telnyx Call Control events -
GET /serves a lightweight dashboard -
GET /transcriptslists recent stored transcripts -
GET /transcripts/:call_control_idfetches one transcript -
GET /debug/state?call_control_id=...shows live actor state -
GET /health/livenessandGET /health/readinessare health checks
Why actors help
Streaming transcription arrives as many events.
The app needs to remember:
- which call this is
- whether it is answering, transcribing, summarizing, sending, or done
- interim transcript segments
- final transcript text
- start and end timestamps
- summary status
An actor per call makes that state easy to hold.
The source maps each call_control_id to one TranscribeAgent, so the transcript can build up across webhook events.
The AI summary
After hangup, the actor queues a finalize pipeline:
summarize -> store -> notify
The summary uses Telnyx AI Inference through the Edge Compute binding:
this.env.TELNYX.ai.openai.chat.createCompletion({
model,
messages: [
{ role: "system", content: SUMMARY_SYSTEM_PROMPT },
{ role: "user", content: transcript },
],
max_tokens: 200,
temperature: 0.3,
});
The default model is:
zai-org/GLM-5.2
The prompt asks for a concise SMS-friendly summary under 320 characters.
SMS notification
Once the summary is ready, the app sends it over Telnyx Messaging:
this.env.TELNYX.messages.send({
from: this.env.SMS_FROM,
to: this.env.SMS_TO,
text: state.summary,
});
Use placeholders in examples and configure real numbers only as private runtime values:
SMS_FROM=<TELNYX_SMS_FROM>
SMS_TO=<SUMMARY_RECIPIENT>
Try it
git clone https://github.com/team-telnyx/telnyx-code-examples.git
cd telnyx-code-examples/edge-call-transcription-agent
npm install
Set secrets:
telnyx-edge secret set TELNYX_API_KEY <YOUR_TELNYX_API_KEY>
telnyx-edge secret set SMS_FROM <TELNYX_SMS_FROM>
telnyx-edge secret set SMS_TO <SUMMARY_RECIPIENT>
Deploy:
telnyx-edge ship
Point your Call Control app webhook to:
https://edge-call-transcription-agent-<id>.telnyxcompute.com/webhooks/voice
Then call the Telnyx number assigned to the Call Control application.
Production notes
Before using this with real callers, add:
- webhook signature verification
- auth on transcript and debug endpoints
- transcript redaction
- retention rules
- SMS opt-out and consent handling
- idempotency for Call Control and SMS actions
- monitoring for STT, LLM summary, storage, and SMS delivery
The useful pattern is simple: live call events, durable state, AI summary, and post-call notification in one edge app.
Resources:
- Code: https://github.com/team-telnyx/telnyx-code-examples/tree/main/edge-call-transcription-agent
- Agent SDK docs: https://developers.telnyx.com/docs/agent-sdk
- Edge Compute docs: https://developers.telnyx.com/docs/edge-compute
- Call Control API reference: https://developers.telnyx.com/api-reference/call-control
- Streaming transcription guide: https://developers.telnyx.com/docs/voice/programmable-voice/transcription
- Messaging docs: https://developers.telnyx.com/docs/messaging
- Telnyx AI Inference docs: https://developers.telnyx.com/docs/inference
- Telnyx AI skills and toolkits: https://github.com/team-telnyx/ai
Top comments (0)