Dial
Changed onDial a number or SIP URI from a given connection. A successful response will include a call_leg_id which can be used to correlate the command with subsequent webhooks.
To place the call with an AI assistant from the start, include assistant.id and any per-call overrides in the assistant object; Telnyx attempts to warm up the assistant before placing the call and starts it automatically when the called party answers.
Expected Webhooks:
- call.initiated
- call.answered or call.hangup
- call.conversation.created when the requested assistant conversation is created, or call.conversation.start_failed when it could not be started after the called party answered
- call.hold and call.unhold if the call is held/unheld
- call.machine.detection.ended if answering_machine_detection was requested
- call.machine.greeting.ended if answering_machine_detection was requested to detect the end of machine greeting
- call.machine.premium.detection.ended if answering_machine_detection=premium was requested
- call.machine.premium.greeting.ended if answering_machine_detection=premium was requested and a beep was detected
- call.machine.premium.call_screening.detected if answering_machine_detection=premium_ios_call_screening_detection was requested and an Apple Call Screening tone was detected
- call.deepfake_detection.result if deepfake_detection was enabled
- call.deepfake_detection.error if deepfake_detection was enabled and an error occurred
- streaming.started, streaming.stopped or streaming.failed if stream_url was set
When the record parameter is set to record-from-answer, the response will include a recording_id field.
Request
- Base URL: https://api.telnyx.com/v2
- URL: https://api.telnyx.com/v2/calls
- Auth: HTTP bearer
Request body
Example request
{
"to": "+18005550100 or sip:username@sip.telnyx.com;secure=srtp",
"from": "+18005550101",
"from_display_name": "Company Name",
"connection_id": "7267xxxxxxxxxxxxxx",
"conference_config": {
"conference_name": "telnyx-conference",
"start_conference_on_enter": true
},
"audio_url": "http://www.example.com/sounds/greeting.wav",
"send_digits_on_answer": "wwww200",
"timeout_secs": 60,
"time_limit_secs": 60,
"webhook_url": "https://www.example.com/server-b/",
"webhook_url_method": "POST",
"webhook_urls": {
"call.hangup": [
"https://www.example.com/webhooks/hangup"
],
"call.bridge": [
"https://www.example.com/webhooks/bridge"
]
},
"webhook_urls_method": "POST",
"webhook_retries_policies": {
"call.hangup": {
"retries_ms": [
1000,
2000,
5000
]
}
},
"answering_machine_detection": "detect",
"answering_machine_detection_config": {
"total_analysis_time_millis": 5000,
"after_greeting_silence_millis": 1000,
"between_words_silence_millis": 1000,
"greeting_duration_millis": 1000,
"initial_silence_millis": 1000,
"maximum_number_of_words": 1000,
"maximum_word_length_millis": 2000,
"silence_threshold": 512,
"greeting_total_analysis_time_millis": 50000,
"greeting_silence_duration_millis": 2000
},
"deepfake_detection": {
"enabled": true,
"timeout": 15,
"rtp_timeout": 30
},
"custom_headers": [
{
"name": "head_1",
"value": "val_1"
},
{
"name": "head_2",
"value": "val_2"
}
],
"client_state": "aGF2ZSBhIG5pY2UgZGF5ID1d",
"command_id": "891510ac-f3e4-11e8-af5b-de00688a4901",
"link_to": "ilditnZK_eVysupV21KzmzN_sM29ygfauQojpm4BgFtfX5hXAcjotg==",
"bridge_intent": true,
"bridge_on_answer": true,
"media_encryption": "SRTP",
"sip_auth_username": "username",
"sip_auth_password": "password",
"sip_headers": [
{
"name": "User-to-User",
"value": "12345"
}
],
"sip_transport_protocol": "TLS",
"stream_url": "wss://www.example.com/websocket",
"stream_track": "both_tracks",
"send_silence_when_idle": true,
"enable_dialogflow": false,
"dialogflow_config": {
"analyze_sentiment": false,
"partial_automated_agent_reply": false
},
"conversation_relay_config": {
"url": "wss://example.com/conversation-relay",
"dtmf_detection": true,
"greeting": "Hi! Ask me anything!",
"voice": "Telnyx.KokoroTTS.af",
"tts_provider": "telnyx",
"language": "en-US",
"interruptible": "speech",
"interruptible_greeting": "dtmf",
"custom_parameters": {
"customer_id": "12345"
}
}
}Response
Successful response with details about a call status that includes recording_id.
Example response
{
"data": {
"call_control_id": "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg",
"call_leg_id": "2dc6fc34-f9e0-11ea-b68e-02420a0f7768",
"call_session_id": "2dc1b3c8-f9e0-11ea-bc5a-02420a0f7768",
"client_state": "aGF2ZSBhIG5pY2UgZGF5ID1d",
"is_alive": false,
"call_duration": 50,
"record_type": "call",
"recording_id": "d7e9c1d4-8b2a-4b8f-b3a7-9a671c9e9b0a",
"start_time": "2019-01-23T18:10:02.574Z",
"end_time": "2019-01-23T18:11:52.574Z"
}
}Changes
- info
added the new
arenum value to the request property/// - info
added the new
beenum value to the request property/// - info
added the new
bgenum value to the request property/// - info
added the new
bnenum value to the request property/// - info
added the new
caenum value to the request property/// - info
added the new
cmnenum value to the request property/// - info
added the new
cmn-Hansenum value to the request property/// - info
added the new
cmn-Hantenum value to the request property/// - info
added the new
csenum value to the request property/// - info
added the new
daenum value to the request property/// - info
added the new
deenum value to the request property/// - info
added the new
elenum value to the request property/// - info
added the new
en-AUenum value to the request property/// - info
added the new
en-GBenum value to the request property/// - info
added the new
en-USenum value to the request property/// - info
added the new
eoenum value to the request property/// - info
added the new
esenum value to the request property/// - info
added the new
etenum value to the request property/// - info
added the new
faenum value to the request property/// - info
added the new
fienum value to the request property/// - info
added the new
frenum value to the request property/// - info
added the new
heenum value to the request property/// - info
added the new
hienum value to the request property/// - info
added the new
hrenum value to the request property/// - info
added the new
huenum value to the request property/// - info
added the new
iaenum value to the request property/// - info
added the new
idenum value to the request property/// - info
added the new
itenum value to the request property/// - info
added the new
jaenum value to the request property/// - info
added the new
koenum value to the request property/// - info
added the new
ltenum value to the request property/// - info
added the new
lvenum value to the request property/// - info
added the new
mrenum value to the request property/// - info
added the new
msenum value to the request property/// - info
added the new
nlenum value to the request property/// - info
added the new
noenum value to the request property/// - info
added the new
plenum value to the request property/// - info
added the new
ptenum value to the request property/// - info
added the new
roenum value to the request property/// - info
added the new
ruenum value to the request property/// - info
added the new
skenum value to the request property/// - info
added the new
slenum value to the request property/// - info
added the new
speechmatics/linden-1enum value to the request property// - info
added the new
speechmatics/linden-1enum value to the request property/// - info
added the new
svenum value to the request property/// - info
added the new
taenum value to the request property/// - info
added the new
thenum value to the request property/// - info
added the new
trenum value to the request property/// - info
added the new
ukenum value to the request property/// - info
added the new
urenum value to the request property/// - info
added the new
vienum value to the request property/// - info
added the new
yueenum value to the request property///
- info
- info
added
deepgram/nova-2-medicaldeepgram/nova-2-phonecalldeepgram/nova-3-medicaldeepgram/fluxdeepgram/flux-multidiscriminator mapping keys to the/////request property - info
added to the
/////request propertyoneOflist
- info