我能够使用pjsip成功注册到我的sip服务器。
但是,使用tls传输从pjsip发送注册时,碰巧会有额外的字符串附加到联系人标题。如何在使用TLS时在pjsip中的contactheader中的contacturi后删除sip-id
Contact: <sip:[email protected]:57336;transport=TLS;ob>;reg-id=1;+sip.instance="<urn:uuid:00000000-0000-0000-0000-0000e922f243>"
有人可以告诉如何从联系人头部中删除它?
这是我的代码。所有的
String sipURI = "sip:";
String addTransport = "";
if(enableTLS)
addTransport = ";hide;transport=tls";
String sipid = sipURI + username + "@" + switch_ip + ":" + switch_port;
String registrar = sipURI + switch_ip + ":" + switch_port;
String proxy = sipURI + switch_ip + ":" + switch_port+addTransport;
AccountConfig accCfg = new AccountConfig();
accCfg.setIdUri(sipid);
AuthCredInfoVector creds = accCfg.getSipConfig().getAuthCreds();
creds.clear();
if (username.length() != 0) {
creds.add(new AuthCredInfo("Digest", "*", username, 0, password));
}
StringVector proxies = accCfg.getSipConfig().getProxies();
proxies.clear();
if (proxy.length() != 0) {
proxies.add(proxy);
}
accCfg.getRegConfig().setRegistrarUri(registrar);
accCfg.getRegConfig().setRetryIntervalSec(60);
accCfg.getRegConfig().setTimeoutSec(60);
accCfg.getNatConfig().setIceEnabled(false);
accCfg.getCallConfig().setTimerUse(pjsua_sip_timer_use.PJSUA_SIP_TIMER_INACTIVE); accCfg.getCallConfig().setPrackUse(pjsua_100rel_use.PJSUA_100REL_NOT_USED);
app.addAcc(accCfg);
你可以请你的帐户注册码吗? – 2017-08-11 10:33:02
@McLaLa添加代码 – Jeeva
标签android或pjsua2下次您创建问题:) – 2017-08-11 11:41:16