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.initiatedcall.answered or call.hangupcall.machine.detection.ended if answering_machine_detection was requestedcall.machine.greeting.ended if answering_machine_detection was requested to detect the end of machine greetingcall.machine.premium.detection.ended if answering_machine_detection=premium was requestedcall.machine.premium.greeting.ended if answering_machine_detection=premium was requested and a beep was detectedstreaming.started, streaming.stopped or streaming.failed if stream_url was setWhen the record parameter is set to record-from-answer, the response will include a recording_id field.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Call request
The DID or SIP URI to dial out to. Multiple DID or SIP URIs can be provided using an array of strings
"+18005550100 or sip:username@sip.telnyx.com"
The from number to be used as the caller id presented to the destination (to number). The number should be in +E164 format.
"+18005550101"
The ID of the Call Control App (formerly ID of the connection) to be used when dialing the destination.
The from_display_name string to be used as the caller id name (SIP From Display Name) presented to the destination (to number). The string should have a maximum of 128 characters, containing only letters, numbers, spaces, and -_~!.+ special characters. If ommited, the display name will be the same as the number in the from field.
"Company Name"
The URL of a file to be played back to the callee when the call is answered. The URL can point to either a WAV or MP3 file. media_name and audio_url cannot be used together in one request.
"http://example.com/message.wav"
The media_name of a file to be played back to the callee when the call is answered. The media_name must point to a file previously uploaded to api.telnyx.com/v2/media by the same user/organization. The file must either be a WAV or MP3 file.
"my_media_uploaded_to_media_storage_api"
The list of comma-separated codecs in a preferred order for the forked media to be received.
"G722,PCMU,PCMA,G729,OPUS,VP8,H264"
The number of seconds that Telnyx will wait for the call to be answered by the destination to which it is being called. If the timeout is reached before an answer is received, the call will hangup and a call.hangup webhook with a hangup_cause of timeout will be sent. Minimum value is 5 seconds. Maximum value is 600 seconds.
60
Sets the maximum duration of a Call Control Leg in seconds. If the time limit is reached, the call will hangup and a call.hangup webhook with a hangup_cause of time_limit will be sent. For example, by setting a time limit of 120 seconds, a Call Leg will be automatically terminated two minutes after being answered. The default time limit is 14400 seconds or 4 hours and this is also the maximum allowed call length.
30 <= x <= 14400600
Enables Answering Machine Detection. Telnyx offers Premium and Standard detections. With Premium detection, when a call is answered, Telnyx runs real-time detection and sends a call.machine.premium.detection.ended webhook with one of the following results: human_residence, human_business, machine, silence or fax_detected. If we detect a beep, we also send a call.machine.premium.greeting.ended webhook with the result of beep_detected. If we detect a beep before call.machine.premium.detection.ended we only send call.machine.premium.greeting.ended, and if we detect a beep after call.machine.premium.detection.ended, we send both webhooks. With Standard detection, when a call is answered, Telnyx runs real-time detection to determine if it was picked up by a human or a machine and sends an call.machine.detection.ended webhook with the analysis result. If greeting_end or detect_words is used and a machine is detected, you will receive another call.machine.greeting.ended webhook when the answering machine greeting ends with a beep or silence. If detect_beep is used, you will only receive call.machine.greeting.ended if a beep is detected.
premium, detect, detect_beep, detect_words, greeting_end, disabled Optional configuration parameters to modify 'answering_machine_detection' performance.
Optional configuration parameters to dial new participant into a conference.
Custom headers to be added to the SIP INVITE.
[
{ "name": "head_1", "value": "val_1" },
{ "name": "head_2", "value": "val_2" }
]Use this field to set the Billing Group ID for the call. Must be a valid and existing Billing Group ID.
"f5586561-8ff0-4291-a0ac-84fe544797bd"
Use this field to add state to every subsequent webhook. It must be a valid Base-64 encoded string.
"aGF2ZSBhIG5pY2UgZGF5ID1d"
Use this field to avoid duplicate commands. Telnyx will ignore others Dial commands with the same command_id.
"891510ac-f3e4-11e8-af5b-de00688a4901"
Use another call's control id for sharing the same call session id
"ilditnZK_eVysupV21KzmzN_sM29ygfauQojpm4BgFtfX5hXAcjotg=="
Indicates the intent to bridge this call with the call specified in link_to. When bridge_intent is true, link_to becomes required and the from number will be overwritten by the from number from the linked call.
true
Whether to automatically bridge answered call to the call specified in link_to. When bridge_on_answer is true, link_to becomes required.
true
If supplied with the value self, the current leg will be parked after unbridge. If not set, the default behavior is to hang up the leg. When park_after_unbridge is set, link_to becomes required.
"self"
Defines whether media should be encrypted on the call.
disabled, SRTP, DTLS SIP Authentication username used for SIP challenges.
SIP Authentication password used for SIP challenges.
SIP headers to be added to the SIP INVITE request. Currently only User-to-User header is supported.
[
{ "name": "User-to-User", "value": "value" }
]Defines SIP transport protocol to be used on the call.
UDP, TCP, TLS Use this field to modify sound effects, for example adjust the pitch.
{
"pitch": "0.8",
"semitone": -2,
"octaves": 0.1,
"track": "both"
}The destination WebSocket address where the stream is going to be delivered.
"wss://www.example.com/websocket"
Specifies which track should be streamed.
inbound_track, outbound_track, both_tracks "both_tracks"
Specifies the codec to be used for the streamed audio. When set to 'default' or when transcoding is not possible, the codec from the call will be used.
PCMU, PCMA, G722, OPUS, AMR-WB, L16, default "PCMA"
Configures method of bidirectional streaming (mp3, rtp).
mp3, rtp "rtp"
Indicates codec for bidirectional streaming RTP payloads. Used only with stream_bidirectional_mode=rtp. Case sensitive.
PCMU, PCMA, G722, OPUS, AMR-WB, L16 "G722"
Specifies which call legs should receive the bidirectional stream audio.
both, self, opposite "both"
Audio sampling rate.
8000, 16000, 22050, 24000, 48000 16000
Establish websocket connection before dialing the destination. This is useful for cases where the websocket connection takes a long time to establish.
true
Generate silence RTP packets when no transmission available.
true
Use this field to override the URL for which Telnyx will send subsequent webhooks to for this call.
"https://www.example.com/server-b/"
HTTP request type used for webhook_url.
POST, GET "GET"
Start recording automatically after an event. Disabled by default.
record-from-answer "record-from-answer"
Defines which channel should be recorded ('single' or 'dual') when record is specified.
single, dual "single"
Defines the format of the recording ('wav' or 'mp3') when record is specified.
wav, mp3 "wav"
Defines the maximum length for the recording in seconds when record is specified. The minimum value is 0. The maximum value is 43200. The default value is 0 (infinite).
1000
The number of seconds that Telnyx will wait for the recording to be stopped if silence is detected when record is specified. The timer only starts when the speech is detected. Please note that call transcription is used to detect silence and the related charge will be applied. The minimum value is 0. The default value is 0 (infinite).
100
The audio track to be recorded. Can be either both, inbound or outbound. If only single track is specified (inbound, outbound), channels configuration is ignored and it will be recorded as mono (single channel).
both, inbound, outbound "outbound"
When set to trim-silence, silence will be removed from the beginning and end of the recording.
trim-silence "trim-silence"
The custom recording file name to be used instead of the default call_leg_id. Telnyx will still add a Unix timestamp suffix.
1 - 40"my_recording_file_name"
The call leg which will be supervised by the new call.
"v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg"
The role of the supervisor call. 'barge' means that supervisor call hears and is being heard by both ends of the call (caller & callee). 'whisper' means that only supervised_call_control_id hears supervisor but supervisor can hear everything. 'monitor' means that nobody can hear supervisor call, but supervisor can hear everything on the call.
barge, whisper, monitor Enables Dialogflow for the current call. The default value is false.
true
Enable transcription upon call answer. The default value is false.
true
{
"language": "en",
"client_state": "aGF2ZSBhIG5pY2UgZGF5ID1d",
"command_id": "891510ac-f3e4-11e8-af5b-de00688a4901"
}Defines the SIP region to be used for the call.
US, Europe, Canada, Australia, Middle East "Canada"
Successful response with details about a call status that includes recording_id.
{
"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"
}