Friday, 18 September 2015

Ringingtone while connecting call android pjsip pjsua2

Generate tone by yourself. You can use android.media.ToneGenerator. Something like this:
ToneGenerator toneGenerator = new ToneGenerator(AudioManager.STREAM_VOICE_CALL, 100);
toneGenerator.startTone(ToneGenerator.TONE_CDMA_NETWORK_USA_RINGBACK, 1000);
EDIT
You can get CallInfo in 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 for repeating tone you can use handler with postDelayed. Create helper class for this.

1 comment:

  1. hi,

    Ringingtone while connecting call android pjsip pjsua2

    how to resolve it??

    ReplyDelete