Interpretation of Android phonecall types - android

The Android call logs give a type to each call, one of seven options: BLOCKED_TYPE, INCOMING_TYPE, MISSED_TYPE, OUTGOING_TYPE, REJECTED_TYPE, VOICEMAIL_TYPE, and ANSWERED_EXTERNALLY_TYPE.
My application is scanning through call logs, but I'm having difficulty interpreting this type information. The trouble is the options don't seem to be disjoint, i.e. a call I make that is rejected on the other end is both OUTGOING_TYPE and REJECTED_TYPE. A call that is incoming that I reject is INCOMING_TYPE and REJECTED_TYPE.
So it seems I'm missing something, and the docs themselves don't seem sufficient to make a proper interpretation.
My best guess is that BLOCKED_TYPE, MISSED_TYPE, REJECTED_TYPE, VOICEMAIL_TYPE, and ANSWERED_EXTERNALLY_TYPE all imply INCOMING_TYPE, and everything else is simply an unadorned OUTGOING_TYPE call. This is based on the assumption that the phone system does not provide meta-information on how the recipient of my call handled it, thus all the extra information about handling is coming from my phone itself and is about my actions, not theirs.
But I don't really know that. This is a very new area for me. Can someone please enlighten me as to what these call types really mean?

Related

How to detect fake call log created by apps

Play store has numerous apps those creates fake call logs.But, sometimes it's important to detect is that call log real or fake to save yourself being a fool. Can anybody tell me how can we detect same?
If these apps are writing to the actual android call log, I don't think there is much you can do against that.
However, you might want to try the below solution, which can maintain your own call list based on the device behaviour.
In Android you can listen for incoming and outgoing calls, using a BroadcastReceiver. Here is a good tutorial for it:
https://www.codeproject.com/Articles/548416/Detecting-incoming-and-outgoing-phone-calls-on-And
If you implement it correctly, you will only receive events from calls being executed for real. So you can save them in your app's call log.

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 ;)

Android: How to determine if the number being called is valid or invalid

I have a big list of opt-in numbers.
Some of them are bogus or fake.
I need to write a small app that does the following:-
Read numbers from an excel file
Call each number: if the call gets through (the phone rings or is busy/engaged), we mark the number as valid in a new column in the excel sheet. If the number is invalid, we mark the number as invalid.
Is it possible to achieve this in Android?
Can we get the response status while making a call from the app?
Example: Status=Ringing, Status=Busy/Engaged, Status=Invalid etc
Is there a better way of finding if a phone number is valid or invalid?
You can't. You are unable to call any phone number other way than firing out an intent to invoke device's Phone app do the job, therefore full and smooth automation is hardly possible. You may try to do that and at the same time set up own listener to know if the call succeeded or not, but that's far from what you wanted.
You cannot do it in Android but you can develop it in a cloud-based IVR system using Call Control XML (CCXML) and a platform that has good call progress analysis, like Voxeo. Take a look at this Answer which provides more detail. Be careful with this type of solution as there are laws which govern automatic notification. Make sure people opt in for this type of notification/verification.

Android incoming call interception , call forwarding

I would like to know how to intercept incoming calls and also how to forward them. I know there are several questions regarding this topic here and elsewhere on the net, but all the answers use the android.intent.action.PHONE_STATE action which is broadcast always after the phone begins to ring and the call screen is shown.
That's why I'm looking for a solution where i could intercept the call in an early stage before any notification (ringing etc..) has been done. I would like to know if maybe this is possible on a platform level in native code and if yes how ? Or perhaps with some kind of trick with the SDK ?
In general, if you can't do it in Java, you can't do it in the NDK. Most of the time the opposite is true: You can't do MOST things on Android in the NDK.
I don't know of a way to do that, and frankly doubt it exists: It would be a huge security hole if you could download an application that would forward calls to another number.
You may want to look at this source code, it may help you : http://code.google.com/p/auto-answer/
None of the existing apps in Android can forward a call based on a given number. All they can do is forward all or nothing. There's one app in particular (cBlocker) that can forward calls on schedule besides blocking incoming and outgoing calls and SMS based on rules.

How to hang up (disconnect, terminate,..) incomings call?

"How do you hang up incoming calls (in Android of course)?"
First, I know this question has been asked and answered several times, and the response is always "you can't". But if we look in the market we get a few applications (all private software, no access to the source code... :-( ) that do this action, such as CallFilter, Panda firewall and others...
So... does somebody know how these apps do the hang up action, (or terminate, or disconnect or whatever you call it..)?
And other question, if the first don't get a response.. does somebody know how send an incoming call to the voice mail?
Of course, all questions are about how to do it programmatically. So with the voicemail question I know there's a flag in contacts that is used for that, but like I said, I'd like to know the programmatical way.
Thanks all!
Edit 1:
I have been seeing the LogCat traces using the application CallFilter and one trace seems to be interest, when it receives an incoming call, the PHONE_STATE is CALL_STATE_RINGING and fast appears one trace:
"05-03 19:32:34.416: INFO/UsageStats(78): Something wrong here, didn't expect com.android.phone to be paused"
and when CallFilter have done whatever do new trace "05-03 19:32:34.486:
INFO/UsageStats(78): Unexpected resume of com.android.phone while already resumed in com.android.phone"
appear, so i think CallFilter do something in one object com.android.phone, but i don't know how access to this.. any idea??
Edit 2:
I have performed at other times, and i don't see anymore the log traces above, so can be that the above may be that this does not mean anything.. i'm not sure..
the CallFilter application simply show one sec the incoming call, and then hang up.. how they do!!!???
I don't know how to hang up incoming calls, not sure if it's possible.
You can, i think, enter airplane mode programmatically, but it's a brutal method and really not advised. Changing such a setting should be done only by the user when he chooses to.
You may try using this API:
http://www.androidjavadoc.com/0.9_beta/com/android/internal/telephony/ITelephony.html

Categories

Resources