Search code examples
androidcallbacksinch

how sinch callback works


i want a create a android paid calling app using sinch. sinch includes a callback API to get details of call. i wanted to use this but no idea how to. i read the documentation. but it is not enough

my question is,

  1. what are the requests to the server.?
  2. how can i find what to what country the call is going on ?
  3. how can i restrict calls based on the account balance in our database

Note: i can generate the userid for calling it is a 15 digit string i will use it as username to connect a call


Solution

    1. Configure a calling callback url in the dashboard for you app
    2. Implement your backend details can be found here: https://www.sinch.com/docs/rest-apis/api-documentation/#callingcallbackapi
    3. When you get the ICE event, you will get who is calling, look up the balance in your database, if the user doesnt have balance create a hangup action instead of ConnectPSTN.