I have a fantastic idea for an Android app but I would need to be able to detect when an emergency call is made from the handset. I only need to be able to read the number, I won't be changing it at all.
The documentation for NEW_OUTGOING_NUMBER says:
Emergency calls cannot be intercepted using this mechanism, and other
calls cannot be modified to call emergency numbers using this
mechanism.
Obviously I don't want to find out if I can read an emergency number by dialing it. I was hoping someone here might be able to tell me whether or not I can grab EXTRA_PHONE_NUMBER if the number would be, for example 999.
Related
I have been recently working on an app which requires to respond to an Automatic attendant (virtual receptionist) which allows callers to be automatically transferred to an extension without the intervention of an operator/receptionist.
My requirement is such that to make a scheduled phone call to a particular number and to respond to the Automatic attendant instructions ("for sales, press 1, for service, press 2," etc)
Is it possible to achieve similar action that i could otherwise achieve by responding to the system manually by pressing an option (say 1 or 2 from above example) programmatically while the call is still active.
Any help is appreciated.
There's no way to do this. There isn't an API, and since the dialer is not part of the OS and can be any app, you can't count on anything working on all devices.
The best chance you have is to assume the dialer will accept USSD input (USSD is an ancient telephony protocol for sending data to phones). In the USSD language, a comma is a pause. SO if you want to dial a number, than 1 at the prompt you could ask it to dial "number,,,,1" and hope that the dialer accepts USSD input and that the pause is long enough to dial the 1 at the right time. But it will work on only a subset of all devices, and be fragile there.
This might not be an appropriate question for StackOverFlow. If not please recommend me where I can post this question.
We are in the process of developing an application where the customer can call the vendor and the vendor can call the customer. But for privacy reasons we don't want to expose the phone numbers of the customers to the vendors and vice versa.
What are some recommended solutions for this problem?
It's not possible, the URL Scheme requires a number and it is show on the screen while calling.
as you can see here
Maybe, you may have to create something more complex like Skype.
Unfortunately that is not possible as of now. You could hide the phone number by replacing each number as an asterisk (*) in your app.
However, when vendor or customer taps on the phone button to call, then phone number is passed to the device Operating System to call, then this number will show up in the calling list.
In addition to that, your app most likely will not be allowed by Apple reviewers, because user needs to see what phone number he is calling. He might be punished if he keeps calling this secret/scripted phone number which might be 911. That is another serious issue may rise.
My recommendation is to have chatting system, or implementing VoIP(voice over IP) like whatsup or viber style calling within the app. It requires exhausted implementation.
I'm trying to get an idea of what's possible and what isn't in terms of using a custom dialler app for internet calls.
The idea is that the standard Android dialler be used when no internet connection is available, but use a custom-written VOIP dialler / caller app whenever an internet connection is available.
I see that in the Android call settings you can set it to use Internet calling whenever a connection is available. How does this work? Does this simply tell the native dialler app to use internet calling, or is there actually a specific Intent or something that gets fired when an internet call is made so that I can open my custom SIP app?
And also, is the 'standard phone app' icon always linked to the standard phone app, or can you override this phone icon to open your custom VOIP app when a connection is present?
So basically, is there a way to seamlessly and automatically switch between the standard dialler and the custom SIP dialler based on whether or not the phone is connected to the internet?
If not, is this something that could be done by customizing Android?
Thanks,
There are four possible ways of doing what you want that I know of:
1. Replace the Android Dialer
This is hard and a lot of work. The Android Dialer (last time I checked anyway) WAS the telephony stack in Android. So to replace it you have to replace the complete telephony stack (including any public API) i.e. handle all cellular (and now sip) calls in and out of the device. Also the only way to replace it is to root the device as it can't be replaced normally.
2. Provide your own Dialer that is separate to the main dialer.
This has it's advantages that you will never get into "trouble" with anything else.
3. Hook into the outbound call API (ACTION_NEW_OUTGOING_CALL)
This is something that is pretty cool and I haven't seen any other OS allow you to do. Basically you can trap when either the normal dialer starts to dial a number (or when another application starts to dial a number as well) and you can either allow it through, modify it or cancel it. Behavior I've seen from sip clients is that they will cancel the call and put up a selection screen prompting where you want to send the call (sip, cellular or something else).
Here is an example of it's use.
The downsides are:
You can be fighting with other applications to which gets first go. There is a 'priority' setup, but all I've seen is everybody wants to be number one.
On some Android devices where the OEM providers that own Dialer, they don't always fire it!!!
4. Detect when the dialer is shown and show your own dialer in front of it.
This works and does allow you to provide a nicer more integrated feel as you can provide call type selection within the dialer, as well as other custom number lookups but that can be a little tricky to do on some devices.
I would suggest 3 to begin with as it's pretty easy to do and you can get something up going pretty fast. In code that I have worked on, we have done 2, 3 and 4 and also looked into 1.
I want to write an application which be able to divert calls to another number, I know it can be done on phones by it self, but I want to only direct specific number to another number.
is there any way to do this?
If I were to want to create an app that would intercept an incoming call, and based on the phone number the call is coming from, possibly display a different number, how would I go about it? Is it possible at all? This mentions a possible solution, but doesn't really elaborate on it. Anything else come to mind for anybody?
Thanks,
Khalid