Create your own tone. You can use android.media.ToneGenerator. Something like that:
ToneGenerator toneGenerator = new ToneGenerator(AudioManager.STREAM_VOICE_CALL, 100);
toneGenerator.startTone(ToneGenerator.TONE_CDMA_NETWORK_USA_RINGBACK, 1000);
EDIT
You can get CallInfo at notifyCallState.
CallInfo ci = call.getInfo();
if (ci.getState() == pjsip_inv_state.PJSIP_INV_STATE_EARLY
&& ci.getRole() == pjsip_role_e.PJSIP_ROLE_UAC
&& ci.getLastReason().equals("Ringing")) {
toneGeneratorHelper.startRingBack();
} else {
toneGeneratorHelper.stopRingBack();
}
And to repeat the tone, you can use a handler with postDelayed. Create a helper class for this.
manao source
share