Android making a call with a predefined call duration - android

I am building an Android application that will automatically make calls and send SMSes to some telephone numbers.
The problem is I need to specify the duration (how long the call will last for) of all the calls.
Is there any way to specify the call duration from Java code? Or how do I cut the present outgoing call?

You may work on Java Runnables and then merge it with call and telephony API.

Related

Get Asterisk HangupCauseCode using linphone?

I am working with linphone call feature using Asterisk server. I have set call limit to one(1) in asterisk server for every sip users. So it will permit only 1 outgoing call and 1 incoming call at a time. Now I want to know if other user calls to user which is already busy with other call then how can I realize that, the end user is busy? Is there any way to get that using linphone lib? Or is there any way to get Asterisk HangupCauseCode using linphonelib?
I have checked with LinphoneCall.getReason() while CallEnd state but it returns null.
You should write your dialplan and save somewhere DIALSTATUS variable after dial attempt.

What is InCallService(Android) equivalent in iOS

In Android, they have this new API called InCallService where you can get call events and for each call object you can do some action. I'm looking for equivalent in iOS. In iOS, I wanted to do the achieve the same thing specifically for outgoing call also. In iOS there is CXCallObserverDelegate protocol but in this case I can only get UUID of the call that's all I can get. I'm not able to do any additional action for the call. I wanted to execute DTMF tone once the call is active but it is not possible. In CallKit there is cxaction called CXPlayDTMFCallAction but this only applies for VOIP application and what I need is to execute the dtmf for gsm calls. Does anybody have any solution for here?

Outgoing Call End Classification

I just want to know if when an outgoing call ends, we can differentiate and know if it was due to normal hangup (normal call end), or call end due to disconnection (loss of signal, network congestion, or any reason from the carrier)
There are two main interfaces to call events depending on whether you are using the standard call app provided or are implementing your own user interface to manage calls.
If you are using the standard call service then you limited to whatever callbacks the Android telephony manager propvides:
https://developer.android.com/reference/android/telephony/TelephonyManager.html
This is a fairly limited set of events and I don't think will give you what you are looking for. It will allow you detect that the phone has gone from off hook to idle state, but not why.
If you are implementing the user interface yourself for call control, then you have access to a rusher set of events via the InCallService:
https://developer.android.com/reference/android/telecom/InCallService.html
This provides more information in callbacks but it still does not give a 'disconnect reason' for calls, AFAIK.
Note also that to use the InCallService your app must be registered as the default phone app.

How to Get Outgoing call duration with Twilio Client API in Android?

I have developed Twilio SDK in my Android application. For outgoing and incoming it is worked well. But when i try to set the timer for call duration, i am unable to get the notification from the other device. Is there any method to find out the other device(Which was notified after picking the call)?
Please help me on this.
Thanks,
I'm not sure if you still need help with this or not, or I get exactly your issue.
What I'm doing is keeping the timestamp of when the call was started (incoming/outgoing) in any of the clients. Then in my activity/fragment, since I have my own callbacks for the Twilio events, as soon as I know there's a call going on, I use Chronometer which is like a TextView that automatically sets things as soon as you set a base time and start it.
get timestamp of when that call started
Chronometer.setBase(timestamp);
Chonometer.start();
So it shows the duration. Remember to have your own Twilio manager class to hold that value for you so if you leave your activity and come back, the duration will be displayed correctly.
Good luck

Get called number of an incoming call in android

My question may look a bit strange.
I want to know if, in android, it is possible to know which number has been called when you receive an incoming call (I'm not speaking about caller id).
For example: let's assume that my phone number is 555-12345, my operator will route to my phone every number starting with 555-12345.
This means that you can call me by dialing 555-12345, but also by dialing 555-12345-37967 or 555-12345-34 etc.
Is there a way to know which number the caller has dialed?
If it is not possible to do this using Android API, would be possible to achieve my goal at lower level? Maybe using a customized firmware?
I was searching for this and not found any answer, the sample app (sipDemo) do not handle incoming call too. Fortunately I found the answer:
mSipManager.getSessionFor(intent).getPeerProfile().getUserName()
Good luck ;)

Categories

Resources