Skip to content
Last updated

Actions allow your Sinch application to control individual calls. The following actions are currently available:

hangup

Hangs up a call.

Available to use in a response to an Incoming Call Event callback, an Answered Call Event callback, or a Prompt Input Event callback.

Example code

application/json
{ "instructions": [ {} ], "action": { "name": "hangup" } }

Schema

namestringrequired

The name property. Must have the value hangup.

Default "hangup"
ValueDescription
hangup

The hangup action.

continue

Continues to set up a call.

Available to use in a response to an Answered Call Event callback or a Prompt Input Event callback.

Example code

application/json

The continue action.

{ "action": { "name": "continue" } }

Schema

namestringrequired

The name property. Must have the value continue.

Default "continue"
ValueDescription
continue

The continue action.

connectPstn

Determines how a PSTN call is connected.

Available to use in a response to an Incoming Call Event callback or a Prompt Input Event callback.

Example code

application/json

The connectPstn action.

{ "action": { "name": "connectPstn", "number": "+461234567890", "locale": "en-US", "maxDuration": 3000, "dialTimeout": 10, "cli": "+460987654321", "suppressCallbacks": false, "indications": "se", "amd": {} } }

Schema

namestringrequired

The name property. Must have the value connectPstn.

Default "connectPstn"
ValueDescription
connectPstn

The connectPstn action.

numberstring

Used to override where PSTN call is connected. If not specified, the extension the client called is used.

Example: "+461234567890"
localestring

Specifies the locale. Uses the language code according to ISO 639, a dash (-), and a country code according to ISO 3166-1 alpha-2. If not specified, the default locale of en-US is used.

Default "en-US"
maxDurationinteger

The max duration of the call in seconds (max 14400 seconds). If the call is still connected at that time, it will be automatically disconnected.

Example: 3000
dialTimeoutinteger

The max duration the call will wait in ringing unanswered state before terminating with TIMEOUT/NO ANSWER on PSTN leg and NA/BUSYon MXP leg.

Example: 3000
clistring

Used to override the CLI (or caller ID) of the client. The phone number of the person who initiated the call is shown as the CLI. To set your own CLI, you may use your verified number or your Dashboard virtual number.

Example: "private"
suppressCallbacksboolean

If enabled, suppresses ACE and DICE callbacks for the call.

Example: false
dtmfstring

A string that determines the DTMF tones to play to the callee when the call is picked up. Valid characters are: 0-9, #, and w. w renders a 500ms pause. For example, the string ww1234#w#, plays a 1 second pause, the DTMF tones for 1, 2, 3, 4, and #, followed by a 500ms pause and finally the # tone. This is useful if the callout destination requires a conference PIN code or an extension. If there is a calling party, it will hear progress while the DTMF is sent.

Example: "ww1234#w#"
indicationsstring

The locale's tone to play while ringing.

Enum ValueDescription
at

Austria

au

Australia

bg

Bulgaria

br

Brazil

be

Belgium

ch

Switzerland

cl

Chile

cn

China

cz

Czech Republic

de

Germany

Example: "us"
amdobject(amdRequest)
Note:

You don't need to set cli or number if the values supplied by the client suffice.

connectMxp

Determines how an application-to-application call is connected.

Available to use in a response to an Incoming Call Event callback.

Example code

application/json

The connectMxp action.

{ "action": { "name": "connectMxp", "destination": {}, "callHeaders": [] } }

Schema

namestringrequired

The name property. Must have the value connectMxp.

Default "connectMxp"
ValueDescription
connectMxp

The connectMxp action.

destinationobject(destinationMxp)

The type of device and number or endpoint to call.

callheadersArray of objects(callHeader)

An optional parameter that allows you to specify or override call headers provided to the receiving Sinch SDK client. Read more about call headers here.

connectConf

Connects an incoming call to a conference.

Available to use in a response to an Incoming Call Event callback or a Prompt Input Event callback.

Example code

application/json

The connectConf action.

{ "action": { "name": "connectConf", "conferenceId": "myConference", "moh": "ring" } }

Schema

namestringrequired

The name property. Must have the value connectConf.

Default "connectConf"
ValueDescription
connectConf

The connectConf action.

conferenceIdstringrequired

The unique identifier of the conference. Shouldn't exceed 64 characters.

Example: "myConference"
conferenceDtmfOptionsobject(conferenceDtmfOptions)

Options to control how DTMF signals are used by the participant in the conference. For information on how to use this feature, read more here.

mohstring

Means "music on hold". If this optional parameter is included, plays music to the first participant in a conference while they're alone and waiting for other participants to join. If moh isn't specified, the user will only hear silence while alone in the conference.

Enum ValueDescription
ring

Plays a progress tone.

music1

Plays music choice 1.

music2

Plays music choice 2.

music3

Plays music choice 3.

connectSip

Determines how to route a call to a SIP server.

Available to use in a response to an Incoming Call Event callback or a Prompt Input Event callback.

Example code

application/json

The connectSip action.

{ "action": { "name": "connectSip", "destination": {}, "maxDuration": 3000, "cli": "private", "transport": "tls", "suppressCallbacks": false, "callHeaders": [] } }

Schema

namestringrequired

The name property. Must have the value connectSip.

Default "connectSip"
ValueDescription
connectSip

The connectSip action.

destinationobject(destinationSip)required

The type of device and number or endpoint to call.

destination.​typestring(sipDestination)required

Type sip for SIP infrastructures.

ValueDescription
sip

A SIP address for SIP infrastructures.

Example: "sip"
destination.​endpointstring(sip address)required

For type sip the value is the SIP address for a SIP endpoint.

Example: "sip:+19876543210@example.sip.sinch.com"
maxDurationinteger

The max duration of the call in seconds (max 14400 seconds). If the call is still connected at that time, it will be automatically disconnected.

Example: 3000
clistring

Used to override the CLI (or caller ID) of the client. The phone number of the person who initiated the call is shown as the CLI. To set your own CLI, you may use your verified number or your Dashboard virtual number.

Example: "private"
transportstring

An optional parameter to specify the SIP transport protocol. If unspecified, UDP is used.

Enum ValueDescription
UDP

User Datagram Protocol

TCP

Transmission Control Protocol

TLS

Transport Layer Security

suppressCallbacksboolean

If enabled, suppresses ACE and DICE callbacks for the call.

Example: false
callHeadersArray of objects(callHeader)
mohstring

Means "music on hold". If this optional parameter is included, plays music to the connected participant if the SIP call is placed on hold. If moh isn't specified and the SIP call is placed on hold, the user will only hear silence while during the holding period .

Enum ValueDescription
ring

Plays a progress tone.

music1

Plays music choice 1.

music2

Plays music choice 2.

music3

Plays music choice 3.

Note:

Make sure you allow our IP addresses in your SIP server for receiving this traffic. For more information on allowlisting see our SIP-trunking documentation.

runMenu

Plays an interactive voice response (IVR) menu to the callee. This menu can play pre-recorded files or text-to-speech messages, collect DTMF tones, and trigger the Prompt Input Event (PIE) callback towards your backend, notifying you of the actions the callee took.

Available to use in a response to an Incoming Call Event callback or an Answered Call Event callback. Can also be used in combination with the Conferences endpoint of the Calling API.

Example code

application/json

The runMenu action.

{ "action": { "name": "runMenu", "barge": true, "mainMenu": "main", "menus": [] } }

Schema

namestringrequired

The name property. Must have the value runMenu.

Default "runMenu"
ValueDescription
runMenu

The runMenu action.

bargeboolean

'Barging' means that the user can press a DTMF digit before the prompt has finished playing. If a valid input is pressed, the message will stop playing and accept the input. If barge is disabled, the user must listen to the entire prompt before input is accepted. By default, barging is enabled.

Default true
localestring

The voice and language you want to use for the text-to-speech message. This can either be defined by the ISO 639 locale and language code or by specifying a particular voice. Supported languages and voices are detailed here. If using the enableVoice to enable voice detection, the locale property is required in order to select the input language.

Example: "en-US"
mainMenustring

Selects the menu item from the menus array to play first.

Example: "main"
enableVoiceboolean

Enables voice detection. If enabled, users can say their answers to prompts in addition to entering them using the keypad.

menusArray of objects(menu)

The list of menus available. The menu with the id value of main will always play first. If no menu has an id value of main, an error is returned.

park

"Parks" the call and places the caller on hold. The caller is placed into a loop, listening to an IVR prompt (either a pre-recorded audio file or generated by text to speech). If the call is unparked, prompts will stop playing immediately. If the max duration is reached, the last prompt will be fully played until the call ends.

Available to use in a response to an Incoming Call Event callback or a Prompt Input Event callback.

Example code

application/json

The park action.

{ "action": { "name": "park", "introPrompt": "#tts[Welcome]", "holdPrompt": "#tts[Thank you for your patience, your call is very important to us.]", "maxDuration": 180 } }

Schema

namestringrequired

The name property. Must have the value park.

Default "park"
ValueDescription
park

The park action.

localestring

The voice and language you want to use for the text-to-speech message. This can either be defined by the ISO 639 locale and language code or by specifying a particular voice. Supported languages and voices are detailed here.

Example: "en-US"
introPromptstring

That prompt that is played when the call is first answered. You can use text-to-speech using the #tts[] element, SSML commands using the #ssml[] element.

Example: "#tts[Welcome]"
holdPromptstring

The prompt that is played on repeat until the call is unparked or the until the maxDuration value is reached. You can use text-to-speech using the #tts[] element, SSML commands using the #ssml[] element.

Example: "#tts[Thank you for your patience, your call is very important to us.]"
maxDurationinteger

The maximum amount of time in seconds that the holdPrompt will be played.

Example: 180
Note:

The maxDuration value can be set to a maximum of 600 seconds (10 minutes).