在我的代码中,我设置了以下设置以将一个帐户添加到 pjsip,在此之后 60 秒超时帐户没有重新注册,如果有人知道告诉我。在我的情况下重新注册没有发生,有什么问题?
int[] accId = new int[1];
accId[0] = 1;
pjsua_acc_config cfg = new pjsua_acc_config();
pjsua.acc_config_default(cfg);
csipsimple_acc_config css_cfg = new csipsimple_acc_config();
pjsua.csipsimple_acc_config_default(css_cfg);
cfg.setPriority(100);
cfg.setId(pjsua.pj_str_copy("sip:" + sipUser + "@" + sipServer));
cfg.setReg_uri(pjsua.pj_str_copy("sip:" + sipServer));
cfg.setReg_timeout(60);
cfg.setCred_count(1);
cfg.setUse_rfc5626(pjsuaConstants.PJ_TRUE);
cfg.setReg_delay_before_refresh(0);
cfg.setPublish_enabled(0);
pjsua_transport_config rtpCfg = cfg.getRtp_cfg();
rtpCfg.setPort(5060);//5060 //4000
pjsip_cred_info cred_info = cfg.getCred_info();
cred_info.setRealm(pjsua.pj_str_copy(sipServer));
cred_info.setScheme(pjsua.pj_str_copy("Digest"));
cred_info.setUsername(pjsua.pj_str_copy(sipUser));
cred_info.setData_type(pjsip_cred_data_type.
PJSIP_CRED_DATA_PLAIN_PASSWD.swigValue());
cred_info.setData(pjsua.pj_str_copy(password));
cfg.setKa_interval(40);
pjsua.csipsimple_set_acc_user_data(cfg, css_cfg);
status = pjsua.acc_add(cfg, pjsuaConstants.PJ_FALSE, accId);
if (status == pjsuaConstants.PJ_SUCCESS) {
status = pjsua.acc_set_online_status(accId[0], 1);
Log.i("Setting online status to online", "---online--"
+status);
} else {
Log.i("Not success", "---un success--" + status);