Sinch Voice API: Choosing between v1 and v2
For all new projects, please use Voice API v2. This is especially important for projects involving:
- AI capabilities like Streams and Voice Relay
- Voice campaigns like Batch calling
You should only use the older Voice API v1 if one of the following is a strict requirement:
- The project must be in General Availability (GA).
- The project requires In-App voice or Conferencing (until these features are available in v2).
SVAML is a call control markup language developed by Sinch. When your application or server receives a callback event from the Sinch platform, it can respond with a SVAML object to control the voice call. The SVAML object type is defined like this:
The collection of instructions that can perform various tasks during the call. You can include as many instructions as necessary.
A SVAML object is made up of Actions and Instructions. A SVAML object must contain exactly one action but can have as many instructions as necessary.
| Action | Functionality | ICE | ACE | PIE* |
|---|---|---|---|---|
| hangup | Ends the call | Yes | Yes | Yes |
| continue | Continues the call | No | Yes | Yes |
| connectPstn | Dictates how the PSTN call will be connected | Yes | No | Yes |
| connectMxp | Determines whether the app-app call will be connected | Yes | No | No |
| connectConf | Connects the call to a conference | Yes | Yes | Yes |
| connectSip | Connects the call to a SIP server | Yes | No | Yes |
| connectStream | Connects the call to a Stream/Websocket server - Closed beta | Yes | No | No |
| runMenu | Plays a menu to the callee | Yes | Yes | Yes |
| park | Puts an incoming call on hold | Yes | No | No |
PIE callbacks are not available for DATA calls; only PSTN and SIP calls.
Instructions must always accompany an action and will not work standalone.
| Instruction | Functionality | ICE | ACE | PIE* |
|---|---|---|---|---|
| playFiles | Plays Interactive Voice Response (IVR) files | Yes | Yes | Yes |
| say | Plays a text-to-speech message | Yes* | Yes | Yes |
| sendDtmf | Send DTMF tones | Yes | No | Yes |
| setCookie | Sets a cookie that can be accessed throughout the call | Yes | Yes | Yes |
| startRecording | Starts call recording | Yes | Yes | Yes |
| stopRecording | Stops call recording | No | No | Yes |
| answer | Forces the callee to answer the call. | Yes | No | No |
PIE callbacks are not available for DATA calls; only PSTN and SIP calls.
When using the say instruction with ICE callbacks, not all providers will deliver the message to the callee. To ensure the say instruction is heard, use the answer instruction before say, as in the following example:
instructions: [
{
"name": "answer",
},
{
"name": "say",
"text": "This is a say command issued from an instruction.",
"locale": "en-US",
},
]


