Dial
Dial 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.
Expected Webhooks:
- call.initiated
- call.answered or call.hangup
- 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.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 body
Example request
{
"answering_machine_detection": "detect",
"answering_machine_detection_config": {
"after_greeting_silence_millis": 1000,
"between_words_silence_millis": 1000,
"greeting_duration_millis": 1000,
"greeting_silence_duration_millis": 2000,
"greeting_total_analysis_time_millis": 50000,
"initial_silence_millis": 1000,
"maximum_number_of_words": 1000,
"maximum_word_length_millis": 2000,
"silence_threshold": 512,
"total_analysis_time_millis": 5000
},
"audio_url": "http://www.example.com/sounds/greeting.wav",
"bridge_intent": true,
"bridge_on_answer": true,
"client_state": "aGF2ZSBhIG5pY2UgZGF5ID1d",
"command_id": "891510ac-f3e4-11e8-af5b-de00688a4901",
"conference_config": {
"conference_name": "telnyx-conference",
"start_conference_on_enter": true
},
"connection_id": "7267xxxxxxxxxxxxxx",
"conversation_relay_config": {
"custom_parameters": {
"customer_id": "12345"
},
"dtmf_detection": true,
"greeting": "Hi! Ask me anything!",
"interruptible": "speech",
"interruptible_greeting": "dtmf",
"language": "en-US",
"tts_provider": "telnyx",
"url": "wss://example.com/conversation-relay",
"voice": "Telnyx.KokoroTTS.af"
},
"custom_headers": [
{
"name": "head_1",
"value": "val_1"
},
{
"name": "head_2",
"value": "val_2"
}
],
"deepfake_detection": {
"enabled": true,
"rtp_timeout": 30,
"timeout": 15
},
"dialogflow_config": {
"analyze_sentiment": false,
"partial_automated_agent_reply": false
},
"enable_dialogflow": false,
"from": "+18005550101",
"from_display_name": "Company Name",
"link_to": "ilditnZK_eVysupV21KzmzN_sM29ygfauQojpm4BgFtfX5hXAcjotg==",
"media_encryption": "SRTP",
"send_digits_on_answer": "wwww200",
"send_silence_when_idle": true,
"sip_auth_password": "password",
"sip_auth_username": "username",
"sip_headers": [
{
"name": "User-to-User",
"value": "12345"
}
],
"sip_transport_protocol": "TLS",
"stream_track": "both_tracks",
"stream_url": "wss://www.example.com/websocket",
"time_limit_secs": 60,
"timeout_secs": 60,
"to": "+18005550100 or sip:username@sip.telnyx.com;secure=srtp",
"webhook_retries_policies": {
"call.hangup": {
"retries_ms": [
1000,
2000,
5000
]
}
},
"webhook_url": "https://www.example.com/server-b/",
"webhook_url_method": "POST",
"webhook_urls": {
"call.bridge": [
"https://www.example.com/webhooks/bridge"
],
"call.hangup": [
"https://www.example.com/webhooks/hangup"
]
},
"webhook_urls_method": "POST"
}Response
Successful response with details about a call status that includes recording_id.
Example response
{
"data": {
"call_control_id": "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg",
"call_duration": 50,
"call_leg_id": "2dc6fc34-f9e0-11ea-b68e-02420a0f7768",
"call_session_id": "2dc1b3c8-f9e0-11ea-bc5a-02420a0f7768",
"client_state": "aGF2ZSBhIG5pY2UgZGF5ID1d",
"end_time": "2019-01-23T18:11:52.574Z",
"is_alive": false,
"record_type": "call",
"recording_id": "d7e9c1d4-8b2a-4b8f-b3a7-9a671c9e9b0a",
"start_time": "2019-01-23T18:10:02.574Z"
}
}Changes
Changed in 9 of the 61 revisions of this API.1013
- ▲
the
webhook_urls/additionalProperties/request property type/format changed fromstring/uritoarray/request-property-type-changed
- ▲
the response's body type/format changed from
object/to/for statusdefaultresponse-body-type-changed
- ▲
the
errors/items/response's property type/format changed fromobject/to/for statusdefaultresponse-property-type-changed
- ▲
the
errors/items/coderesponse's property type/format changed frominteger/int32tostring/integerfor statusdefaultresponse-property-type-changed
This revision also has 64 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ▲
- ▲
the response's body type/format changed from
/toobject/for statusdefaultresponse-body-type-changed
- ▲
the
errors/items/response's property type/format changed from/toobject/for statusdefaultresponse-property-type-changed
- ▲
the
errors/items/coderesponse's property type/format changed fromstring/integertointeger/int32for statusdefaultresponse-property-type-changed
- ▲
the
errors/items/source/pointerresponse's property type/format changed fromstring/json-pointertostring/for statusdefaultresponse-property-type-changed
This revision also has 41 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ▲
- ○
added the new optional request property
assistant/voice_settingsnew-optional-request-property
- ○
- ○
added
Reson8discriminator mapping keys to thetranscription_config/transcription_engine_configrequest propertyrequest-property-discriminator-mapping-added
- ○
added the new
Reson8enum value to the request propertytranscription_config/transcription_enginerequest-property-enum-value-added
- ○
added
TranscriptionEngineReson8Configto thetranscription_config/transcription_engine_configrequest propertyoneOflistrequest-property-one-of-added
- ○
- ○
added the new optional request property
route_to_mobilenew-optional-request-property
- ○
- ○
added
Humaindiscriminator mapping keys to thetranscription_config/transcription_engine_configrequest propertyrequest-property-discriminator-mapping-added
- ○
added the new
Humainenum value to the request propertytranscription_config/transcription_enginerequest-property-enum-value-added
- ○
added
TranscriptionEngineHumainConfigto thetranscription_config/transcription_engine_configrequest propertyoneOflistrequest-property-one-of-added
- ○
- ○
added the new optional request property
retry_on_timeoutnew-optional-request-property
- ○
- ▲
removed the enum value
parakeet/tdt-0.6b-v3of the request propertytranscription_config/transcription_engine_config/oneOf[subschema #9: Transcription engine Parakeet config]/transcription_modelrequest-property-enum-value-removed
- ○
the
transcription_modelrequest property default value changed fromparakeet/tdt-0.6b-v3tonvidia/parakeet-v3request-property-default-value-changed
- ○
added the new
nvidia/parakeet-v3enum value to the request propertytranscription_config/transcription_engine_config/oneOf[subschema #9: Transcription engine Parakeet config]/transcription_modelrequest-property-enum-value-added
- ▲
- ▲
removed the enum value
nvidia/parakeet-v3of the request propertytranscription_config/transcription_engine_config/oneOf[subschema #9: Transcription engine Parakeet config]/transcription_modelrequest-property-enum-value-removed
- ○
the
transcription_modelrequest property default value changed fromnvidia/parakeet-v3toparakeet/tdt-0.6b-v3request-property-default-value-changed
- ○
added the new
parakeet/tdt-0.6b-v3enum value to the request propertytranscription_config/transcription_engine_config/oneOf[subschema #9: Transcription engine Parakeet config]/transcription_modelrequest-property-enum-value-added
This revision also has 111 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ▲