When using the Sinch Voice platform in many use cases a callback server will be required to control the flow of a call.
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
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
You configure your application server URL in the Sinch Dashboard Voice & Video -> Apps -> In-app Voice & Video SDKs -> Callback URL.
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/
The figure below illustrates the lifecycle of a call and shows where both callbacks and REST API calls are located or can be made.
Developer documentation related to callbacks: https://developers.sinch.com/docs/voice/api-reference/callbacks
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?
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
Let us know how you proceed
Roland-Ian
Documentation for Voice Calling API: https://developers.sinch.com/docs/voice/api-reference/
Android : https://developers.sinch.com/docs/in-app-calling/android-cloud/
iOS : https://developers.sinch.com/docs/in-app-calling/ios-cloud/
Javascript: https://developers.sinch.com/docs/in-app-calling/js-cloud/
Latest Voice SDKs: https://developers.sinch.com/docs/in-app-calling/sdk-downloads/
Voice SDK
Reference Apps: JS, Android, iOS https://github.com/sinch/rtc-reference-applications
Calling API
webhook callback application: https://github.com/sinch/voice-api-webhook-nodejs
php client + samples : https://github.com/sinch/voice-api-php
How to: https://community.sinch.com/t5/Virtual-Numbers/Getting-a-number-from-Sinch/ta-p/8081
Login to https://dashboard.sinch.com/numbers/buy-numbers find the number you want.