how sinch callback works - android

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,
what are the requests to the server.?
how can i find what to what country the call is going on ?
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

Configure a calling callback url in the dashboard for you app
Implement your backend details can be found here: https://www.sinch.com/docs/rest-apis/api-documentation/#callingcallbackapi
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.

Related

How to complete order after successful payment opencart api android?

I am developing an android app using Opencart API.
I could managed to get payumoney payment responses and could verify them. But I don't understand what's next. The order status has to be updated, History to be created and the cart has to be cleared.
I guess checkout/success is meant for web and it returns html. I just need the order status updated and cart cleared.
You are looking in the wrong place.
Each stop payment has its controller to receive a response about the status of payment. Usually it lies in the controller/payment .
The payment system after payment calls this method and the entire procedure for creating and changing the status occurs in it.
Usually it simply calls the method
$this->model->checkout->order->addHistory(...);

How am I supposed to send my REST Api response from android back to the IBM watson?

I am designing android chatbot using watson. I have a usecase where I need to call external REST api. So I define the function name and parameters in the action tag of JSON editor. I receive those variables in my android code through conversation Api. My question is how am I suppose to send my REST Api response back to the watson? I know I have to use /message api in which I need to set a context. And initially I get the context from the MessageResponse class after the conversation API gets executed. And how are we going to let Watson know about the rest api response. How do we link that response to watson? Help me with some code if you can.
For calling external REST API it is recommended to use Cloud Functions - in the implementation of the cloud function you create the API request you need. Then in Watson Assitant you add the "action" field where you specify what of your cloud function to call and where to store the result (the result will be stored to some variable in the "context" field). More info in the documentation about how to make programatic calls from a dialog node.

Twilio incoming call not working in android voice sdk

i have used android voice sdk
github link
if i click call button i am getting congratulatory message and not showing any notification like incoming call. Please help i am doing this from long time.
in twilio site it is showing correct but not getting incoming calls.
Twilio developer evangelist here.
The basics of the Quickstart application get you to the point that you make an outgoing call and the example TwiML Application returns a congratulations voice message, as you've discovered.
You now have to build on top of this in order to place calls to other clients.
First you need to update the server application so that you pass an identity to it rather than using the default.
Then you need to add a UI within your own application that can give you a choice of clients to dial. I don't know what your app does, so you need to figure how you want to display this to users yourself. You could just give them a free text field to type the name of another client into or list all active users.
You'll then need to pass the client name you want to call into the parameters when you create the call.
You will also need to update the server route to receive those parameters and place the call to the other client.
To cover all of this, I recommend following the full quickstart tutorial for Twilio Programmable Voice on Android.

What is the best way to change website contents without the user giving any trigger

For example, whenever someone "likes" your post in Facebook, you get a notification. You don't have to refresh your page to get the notification. Or whenever someone sends you a message in Whatsapp you immediately get it.
How do they implement that? Does it use Ajax to listen for database changes every second or so?
I want to build an Android application which should do something whenever the value of a remote database changes. Should I use a service to check for the database value every second and compare it to the previous value? Is this the best way to do it?
You could either setup a gcm service or use the native android service to hit your database at a fixed interval of time . GCM would be more efficient and would be recommended , if your app is an extensive real time sort of an app like a messenger or something
You should look into Google Cloud Messaging. But you will need a server to implement it.
https://developers.google.com/cloud-messaging/

Sinch Conference Call Android

I have searched about making a conference call using Sinch Android SDK but unable to find any working example. I found one link, but there is no solution mentioned.
According to the documentation (https://www.sinch.com/docs/voice/android/#setupaconferencecall):
CallClient callClient = sinchClient.getCallClient();
Call call = callClient.callConference("<conferenceId>");
call.addCallListener(...);
My question is, If Conference ID is random then How to create Conference Room and How to add Users to that room? Is there any example or sample available for Android?
EDIT
I create one user with ID 1 and another user with ID 2. I call the function on button click on both of the user devices,
Call call = callClient.callConference("ConferenceID123");
As callConference will create the conference room on the fly. The call on both users get established but there is no voice completely blank on both user devices. And when I hang-up, there is 0 packet send or received. Can you please help me out where I am wrong?
You create your own rooms and keep a list of that and then connect any users to that room.

Categories

Resources