[pjsip] pjsua2 doesn't answer invite challenge

Aduílio aduiliosilva at leucotron.com.br
Thu May 29 09:21:15 EDT 2014


I'm using pjsua2, version 2.2.1, built for Android.

It's registering correctly but when it makes outgoing calls the server 
responds UNAUTHORIZED and pjsua2 doesn't understands this and doesn't 
resend INVITE with the challenge answer.

My server must authenticate the INVITE.

accCfg.setIdUri("sip:" + user + "@" + domain + ":" + port);
accCfg.getNatConfig().setIceEnabled(true);
accCfg.getRegConfig().setRegistrarUri("sip:" + domain + ":" + port);
accCfg.getRegConfig().setTimeoutSec(timeout);
AuthCredInfoVector creds = accCfg.getSipConfig().getAuthCreds();
creds.clear();
creds.add(new AuthCredInfo("Digest", "*", user, 0, password));
try {
     account.modify(accCfg);
} catch (Exception e) {
     e.printStackTrace();
}

MyCall call = new MyCall(account, -1);
CallOpParam prm = new CallOpParam(true);
CallSetting opt = prm.getOpt();
opt.setAudioCount(1);
opt.setVideoCount(0);
try {
     call.makeCall("sip:" + dialedNumber + "@" + domain, prm);
} catch (Exception e) {
     e.printStackTrace();
     call.delete();
     return;
}

Aduilio





More information about the pjsip mailing list