I'm developing a SIP client based on pjsip on Android (i'm using the csipsimple code as a reference for now).
WHen I try to register the account I get the following error:
Unable to generate suitable Contact header for registration: Unsupported transport (PJSIP_EUNSUPTRANSPORT)
My code is almost the same as in here The sipServer string is the ip address of the registrar "192.168...."
I have also tried not to specify the transport method like in the following code:
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(10);
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.setPublish_enabled(0);
cfg.setReg_delay_before_refresh(-1);
cfg.setUse_timer(pjsua_sip_timer_use.PJSUA_SIP_TIMER_OPTIONAL);
pjsua.csipsimple_set_acc_user_data(cfg, css_cfg);
status = pjsua.acc_add(cfg, pjsuaConstants.PJ_FALSE, accId);
The error is:
E/libpjsip(20934): pjsua_acc.c ..Unable to generate suitable Contact header for registration: Unsupported transport (PJSIP_EUNSUPTRANSPORT) [status=171060]
Of course after this there is no trace on wireshark: the lib gives up before sending any data.
Thanks
I had to add the following code:
int[] tId = new int[1];
int status;
pjsua.transport_config_default(cfgTrasport);
cfgTrasport.setPort(5060);
status = pjsua.transport_create(pjsip_transport_type_e.PJSIP_TRANSPORT_UDP, cfgTrasport, tId);
if (status != pjsuaConstants.PJ_SUCCESS) {
Log.e("pjsua.transport_create returned status="+status);
}
来源:https://stackoverflow.com/questions/16483996/error-while-trying-registering-with-pjsip-pjsip-eunsuptransport