Asterisk call flow - android

I want to use asterisk server for SIP/VOIP calls from/to android app. I searched for good Sip client and found CSip simple is good.
Suppose there are 2 users A and B.
when A wants to call to B,
A sends request to internal server
Internal server will check if A can call B or not by populating some database value
If yes, Server will ask B if it wants to accept call from A
If yes, server will setup call between A and B
How i should configure these things in asterisk to achieve this and also like to know that if CSipSimple will be best for android?
If i am wrong anywhere please correct me.
Thanks

CSipSimple will be best for android.
For asterisk i try to solve your problem. Try below configuration to make call.
Suppose there are 2 users A and B.
A user server
Modified A server extension.conf
[my_outgoing]
//exten => _X.,1,Dial(SIP/${EXTEN})
exten => _X.,1,AGI(test.php)
// test.php is check for balance of A and if A having enough balance then it will call B from this file it self
Modified A server sip.conf
[2221]
username=2221
type=friend
secret=2221
host=dynamic
context=my_outgoing
Modified B server extension.conf
[my_incoming]
//exten => _X.,1,Answer()
exten => _X.,1,AGI(test2.php)
// Here test2.php is for run IVR from script and give user for press 1 or 2 to accept and reject the call etc...
// if you are using the real device or soft phone then it will handle the call option by it self
// If you have to handle this using script then code to handle call written into this
// And if GUI [from soft phone] is there to handle call then write bellow line only
exten => _X.,1,Dial(SIP/${EXTEN})
Modified B server sip.conf
[2222]
username=2222
type=friend
secret=2222
host=dynamic
context=default
Now try to register both user from different device and try to make call.
Call from A(2221) to B(2222)

Related

How to disconnect phone call in flutter?

I made app that call automatically on given number, code below. Now I want to disconnect that call for after f.g 10 sec. It is possible if yes how to do it?
android_intent.Intent()
..setAction(android_action.Action.ACTION_CALL)
..setData(Uri(scheme: "tel", path: _controllerPhone.text))
..startActivity().catchError((e) => print(e));
Since the call application is a different application than your application, you can not intervene. Of course, you could do this very easily if you were making a call directly in your application.

Invoke Calling from Fulfilment Webhook response

I have a contact app, I created an Action Project which eventually decide a number to call based on user conversation. The number to call is being decided at backend (Fullfilment using Webhook).
I want to start call on number being decided at backend(As it is when you say 'Call 55555555' in Google Assistant).
I am not able to find any document on how to start a call using response from Fullfilment.
Please suggest.
You cannot programmatically start a phone call with Actions on Google.

Web RTC - One to One call,no error but, no remote video streaming

Am using Kurento Media server for the one to one call.
In browser the call happens with no issues.
But I want to implement this in android.
Am using this, https://github.com/MaxMaes/WebRTCTest
Since, it is stated, the project is not complete, Am trying to complete this.
Am following all the steps of WebRTC.
Am able to connect to kurento one-one call app, running in server. The flow goes like this
Party A created in browser.
Party B created in android app.
A makes a call to B.
Now, on receiving "incoming call" message, the call is accepted.
pc.createOffer is called.
onCreateSuccess, pc.setLocalDescription is done. sdpoffer is sent to B.
parallelly, receiving "onIceCandidate", pc.addIceCanditate is done.
ICEGatheringState = Complete
A receives the, callResponse, and sends "startcommunication"with sdpAnswer.
pc.setRemoteDescription, from sdpAnswer is done.
onAddStream called. A remote renderer is added to the UI.
But no streaming is coming.
From A, B is receiving "iceCandidate". is anything to be done on this?
In both sides, I dont get the remote video But able to see local video
And I dont get any error.
In onAddRemoteStream change
VideoRendererGui.update(remoteRender, REMOTE_X, REMOTE_Y,   REMOTE_WIDTH,REMOTE_HEIGHT, scalingType)
add one more parameter after scalingType
 VideoRendererGui.update(remoteRender,
 REMOTE_X, REMOTE_Y,   REMOTE_WIDTH,REMOTE_HEIGHT, scalingType,true)
Hope this will help you.
you have it like this?
onAddRemoteStream(MediaStream remoteStream){
remoteStream.videoTracks.get(0).addRenderer(new VideoRenderer(remoteRender));
}
In some case you can not receive video if not sending video.
Workarounded with this: https://stackoverflow.com/a/51883182/571410

Communication between main firemonkey application and local service

I've got a Firemonkey application with a Local Android Service.
When the user opens it, he has to write something in a TEdit and when he clicks an OK button, the application starts the local android service :
FLocationServiceConn := TLocalServiceConnection.Create; // -- android_service
FLocationServiceConn.StartService('LocationService'); // -- android_service
The service sends user's location to a remote server using a nethttpclient object.
The problem is that I need to send TEdit.Text info with the user's location to the remote server (I need to know which is the user), so I need to pass that info to the service when it starts.
I haven't found how to pass parameters to a local service. I have tried to create a file when the user clicks OK button (it works)
miau:=TStringList.Create;
miau.Text:='test';
miau.SaveToFile(TPath.Combine(TPath.GetDocumentsPath, 'conf.txt'));
but when I try to read that file from the service, it crashes...(It seems TPath is the problem).
What do you think? Which would be the best way to send the users info (TEdit.Text) to the local service?
Thank you very much

How capture/log api calls (function calls) made by Android app?

I have installed an app on AVD (emulator) Android.
Is there a way to get to know the api calls(functions calls) made by the app when I
play around with it on the AVD(emulator).
Is there a way I can log/capture all the api calls (function calls) made by the app as I interact with it.
Is anybody aware of the tool that captures the flow of the application in terms of api calls(function calls).
For example if there is a messing app, then typical operations would be
[1] launch app
[2] write message
[3] send message
so I want to capture the api calls corresponding to when [1] i.e when the
app is launched.
then log/capture api calls when [2] i.e write message. finally what api calls were made
when I do [3] i.e hit send button.
You can capture all the activity launched by the app in command prompt via :
adb logcat | grep "ActivityManager"
Probably too late to answer, but I use stetho and it's working great. You can also look into preference values directly from here.
If you are referring to an App you wrote, you can use the Log class to log messages to logcat.
You can also use the Trace tool to see what's going on in your device and infere the api calls.

Categories

Resources