Controlling a call from your application backend is done by responding to callbacks from the Sinch platform and/or by calling REST APIs in the Sinch platform from your application's backend.
Read more about how callbacks work here.
When a call reaches the Sinch platform, the system makes a POST request to the specified calling callback URL.
This event, called the ICE event, can be triggered by either an incoming data call or an incoming PSTN call. Look here for allowed instructions and actions.
If there is no response to the callback within the timeout period, an error message is played, and the call is disconnected.
Must have the value ice.
| Value | Description |
|---|---|
| ice | An Incoming Call Event. |
Used in some types of events, it presents the unique Conference ID assigned to this call.
The unique application key. You can find it in the Sinch dashboard.
The number that will be displayed to the recipient of the call. To set your own CLI, you may use your verified number or your Dashboard virtual number and add it to the connectPSTN SVAML response to the Incoming Call Event request. It must be in E.164 format.
Can be either pstn for PSTN endpoint or mxp for data (app or web) clients.
| Enum Value | Description |
|---|---|
| pstn | A call on the Public Switched Telephone Network. |
| mxp | A data call. |
| PSTN | A call on the Public Switched Telephone Network. |
| MXP | A data call. |
Can be either pstn for PSTN endpoint or mxp for data (app or web) clients.
| Enum Value | Description |
|---|---|
| pstn | A call on the Public Switched Telephone Network. |
| mxp | A data call. |
| PSTN | A call on the Public Switched Telephone Network. |
| MXP | A data call. |
If the call is initiated by a Sinch SDK client, call headers are the headers specified by the caller client. Read more about call headers here.
- redirected by Sinch to an appropriate regionhttps://calling.api.sinch.com/ice
- United Stateshttps://calling-use1.api.sinch.com/ice
- Europehttps://calling-euc1.api.sinch.com/ice
- South Americahttps://calling-sae1.api.sinch.com/ice
- Southeast Asia 1https://calling-apse1.api.sinch.com/ice
- Southeast Asia 2https://calling-apse2.api.sinch.com/ice
An example of an Incoming Call Event.
{ "event": "ice", "callId": "3b0a7ccd-05e1-4728-bafd-023b77c47784", "callResourceUrl": "https://calling-euc1.api.sinch.com/calling/v1/calls/id/3b0a7ccd-05e1-4728-bafd-023b77c47784", "timestamp": "2022-03-21T13:13:59Z", "version": 1, "userRate": { "currencyId": "USD", "amount": 0.03 }, "cli": "31639136121", "to": { "type": "did", "endpoint": "+3197121281500" }, "domain": "pstn", "applicationKey": "3b216e8d-e385-4ff9-ae80-5d11897006b0", "originationType": "PSTN" }
The Incoming Call Event (ICE) requires a valid SVAML object in response.
A SVAML response to an Incoming Call Event that plays a message to the caller and then hangs up the call.
{ "instructions": [ { … } ], "action": { "name": "hangup" } }