The problem
I'm working on an Android VoIP application. I have to signal an incoming call to the cars' navigation system when the phone is connected to them via Bluetooth.
What I did so far
Beside a lot of searching and reading, and trial and errors this is the current state:
- found a similar, but unanswered, question here on StackOverflow: How to make a VOIP app use a carkit like the native call app?
When there is an incoming call (SIP INVITE was received by the app) the following happens:
- set the mode in AudioManager to RINGING:
audioManager.setMode(AudioManager.MODE_RINGING);
- request audio focus:
audioManager.requestAudioFocus(this, AudioManager.STREAM_RING, AudioManager.AUDIOFOCUS_GAIN);
- enabled and started bluetoothSco:
audioManager.setBluetoothScoOn(true);
audioManager.startBluetoothSco();
What happens
In the car the in call screen is displayed directly, instead of the incoming call. So, the user can only hang up the call, and cannot answer since the answer button is not displayed.
I'm guessing that I'm not signalling correctly the state even though the JavaDoc on AudioManager says that the RINGING mode is used for signalling such a thing.
Please let me know if you have any ideas on how to solve this issue.