cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

What’s a callback?

When using the Sinch Voice platform in many use cases a callback server will be required to control the flow of a call.  

 

Why do I need a callback server?

This is for you to be able to have control over certain elements, such as: authorising calls, routing calls, setting a cli (calling line identifier) to the receiving user.  It is mandatory to have a callback server for calling a PSTN destination

 

What do I need to implement a callback server?

You will need an application server that can parse incoming HTTP POST requests and return HTTP POST responses with SVAML commands (json) in the HTTP body.  Some example callback severs can be found here: Sinch Github voice samples or for simple testing you can use a service such as https://webhook.site

 

Where do I configure my callback server URL?

You configure your application server URL in the Sinch Dashboard Voice & Video -> Apps -> In-app Voice & Video SDKs -> Callback URL.

 

What is SVAML?

SVAML is a call control markup language developed by Sinch. When your application or server receives a callback event from the Sinch Voice platform, it can respond with a SVAML object to control the voice call. https://developers.sinch.com/docs/voice/api-reference/svaml/

 

What are the call events you send?

  • ICE (Incoming Call Event)  A call has been initiated, what action do you want to take?
  • ACE (Answered Call Event). Callback triggered by an the callee answering 
  • PIE (Prompt Input Event). Callback triggered by a runMenu action.
  • DICE (Disconnect Call Event) The call has ended, here is the summary.

 

Callback Diagram

The figure below illustrates the lifecycle of a call and shows where both callbacks and REST API calls are located or can be made.

Screenshot 2022-11-16 at 09.37.49.png

 

Developer documentation related to callbacks:  https://developers.sinch.com/docs/voice/api-reference/callbacks 

Comments
tulsiwdv
New Contributor

I created an account and obtained a demo number using a test app.  I completed the setup of a sample from https://github.com/sinch/voice-api-webhook-nodejs. Then, on the 'apps->settings' page, upon clicking 'Test a callback URL', I received an error 400. Additionally, there seems to be an issue with the GET method in the code. Could someone please guide me in resolving these issues?

Roland_Ian
Employee
Employee

Hi tulsiwdv

 

Thanks for using our code samples!

 

There was a missing req parameter in  the app.get.

 

Please clone the repo again, to receive the fix, or make this change to get the GET function to work.

 

From

 

app.get('/', (res) => {
res.send('GET Pong!');
});

 

To

 

app.get('/', (req, res) => {
res.send('GET Pong!');
});

 

I would suggest to look in your ngrok you will see the 200OK  arriving even thought he dashboard reports 400 error

Screenshot 2023-04-03 at 12.36.04.png

 

Let us know how you proceed

 

Roland-Ian

Version history
Last update:
‎11-16-2022 07:25 AM
Updated by: