Skip to main content
telnyx-voice-python Make and receive calls, transfer, bridge, and manage call lifecycle with Call Control. Includes application management and call events. This skill provides Python SDK examples.
Aller à l'installation Skills Marketplace Découvrez et explorez les compétences IA créées par la communauté.
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Copier le promptAfficher les détails du prompt Une commande directe contourne le prompt de vérification. Examinez la source avant de l'exécuter.
npx skills add https://github.com/team-telnyx/telnyx-toolkit --skill telnyx-voice-pythonLa commande reste sur une seule ligne. Faites défiler horizontalement pour la vérifier avant de la copier.
Vous préférez une copie locale ? Téléchargez les fichiers actuellement disponibles dans SkillsMP.
Télécharger Zip Téléchargement... SOC
Basé sur la classification professionnelle SOC
name telnyx-voice-python description Make and receive calls, transfer, bridge, and manage call lifecycle with Call Control. Includes application management and call events. This skill provides Python SDK examples. metadata {"author":"telnyx","product":"voice","language":"python","generated_by":"telnyx-ext-skills-generator"}
Telnyx Voice - Python
Installation
pip install telnyx
Setup
import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY" ),
)
All examples below assume client is already initialized as shown above.
Answer call
Answer an incoming call.
POST /calls/{call_control_id}/actions/answer
response = client.calls.actions.answer(
call_control_id="call_control_id" ,
)
print (response.data)
Bridge calls
Bridge two call control calls.
POST /calls/{call_control_id}/actions/bridge — Required: call_control_id
response = client.calls.actions.bridge(
call_control_id_to_bridge="call_control_id" ,
call_control_id_to_bridge_with="v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg" ,
)
(response.data)
print
Dial Dial a number or SIP URI from a given connection.
POST /calls — Required: connection_id, to, from
response = client.calls.dial(
connection_id="7267xxxxxxxxxxxxxx" ,
from_="+18005550101" ,
to="+18005550100" ,
)
print (response.data)
Hangup call POST /calls/{call_control_id}/actions/hangup
response = client.calls.actions.hangup(
call_control_id="call_control_id" ,
)
print (response.data)
Transfer call Transfer a call to a new destination.
POST /calls/{call_control_id}/actions/transfer — Required: to
response = client.calls.actions.transfer(
call_control_id="call_control_id" ,
to="+18005550100" ,
)
print (response.data)
List all active calls for given connection Lists all active calls for given connection.
GET /connections/{connection_id}/active_calls
page = client.connections.list_active_calls(
connection_id="1293384261075731461" ,
)
page = page.data[0 ]
print (page.call_control_id)
List call control applications Return a list of call control applications.
GET /call_control_applications
page = client.call_control_applications.list ()
page = page.data[0 ]
print (page.id )
Create a call control application Create a call control application.
POST /call_control_applications — Required: application_name, webhook_event_url
call_control_application = client.call_control_applications.create(
application_name="call-router" ,
webhook_event_url="https://example.com" ,
)
print (call_control_application.data)
Retrieve a call control application Retrieves the details of an existing call control application.
GET /call_control_applications/{id}
call_control_application = client.call_control_applications.retrieve(
"id" ,
)
print (call_control_application.data)
Update a call control application Updates settings of an existing call control application.
PATCH /call_control_applications/{id} — Required: application_name, webhook_event_url
call_control_application = client.call_control_applications.update(
id ="id" ,
application_name="call-router" ,
webhook_event_url="https://example.com" ,
)
print (call_control_application.data)
Delete a call control application Deletes a call control application.
DELETE /call_control_applications/{id}
call_control_application = client.call_control_applications.delete(
"id" ,
)
print (call_control_application.data)
List call events Filters call events by given filter parameters.
page = client.call_events.list ()
page = page.data[0 ]
print (page.call_leg_id)
Webhooks The following webhook events are sent to your configured webhook URL.
All webhooks include telnyx-timestamp and telnyx-signature-ed25519 headers for verification (Standard Webhooks compatible).
Event Description callAnsweredCall Answered callStreamingStartedCall Streaming Started callStreamingStoppedCall Streaming Stopped callStreamingFailedCall Streaming Failed callBridgedCall Bridged callInitiatedCall Initiated callHangupCall Hangup callRecordingSavedCall Recording Saved callMachineDetectionEndedCall Machine Detection Ended callMachineGreetingEndedCall Machine Greeting Ended callMachinePremiumDetectionEndedCall Machine Premium Detection Ended callMachinePremiumGreetingEndedCall Machine Premium Greeting Ended
Plus depuis ce dépôt Complete Telnyx toolkit — ready-to-use tools (STT, TTS, RAG, Networking, 10DLC) plus SDK documentation for JavaScript, Python, Go, Java, and Ruby.
Automated Telnyx bot account signup via challenge-response
Track agent activities using the Telnyx AI Missions API. Use this skill when executing multi-step tasks that should be logged and tracked. Supports creating voice/SMS agents, scheduling calls, and retrieving conversation insights. Use when tasks involve calling people, sending SMS, or any substantial tracked work.