I am working on csipsimple version 1915. It work fine for android devices below 4.4.2 . To call somebody in local network I have this method
private void broadCastAndroidCallState(String state, String number) {
//Android normalized event
Intent intent = new Intent(ACTION_PHONE_STATE_CHANGED);
intent.putExtra(TelephonyManager.EXTRA_STATE, state);
if (number != null) {
intent.putExtra(TelephonyManager.EXTRA_INCOMING_NUMBER, number);
}
intent.putExtra(pjService.service.getString(R.string.app_name), true);
pjService.service.sendBroadcast(intent,android.Manifest.permission.READ_PHONE_STATE);
}
But it does not work on android version 4.4.2. When I want to make a call it crashes. I have modified my code as follows
private void broadCastAndroidCallState(String state, String number) {
// Android normalized event
if(!Compatibility.isCompatible(19)) {
// Not allowed to do that from kitkat
Intent intent = new Intent(ACTION_PHONE_STATE_CHANGED);
intent.putExtra(TelephonyManager.EXTRA_STATE, state);
if (number != null) {
intent.putExtra(TelephonyManager.EXTRA_INCOMING_NUMBER, number);
}
intent.putExtra(pjService.service.getString(R.string.app_name), true);
pjService.service.sendBroadcast(intent, android.Manifest.permission.READ_PHONE_STATE);
}
}
By modifying this my application does not crash but cant hear anything. Please help me with this.