我可以使用 pjsip 成功注册到我的 sip 服务器。
但是当使用 tls 传输从 pjsip 发送寄存器时,碰巧有额外的字符串附加到联系人标头。
Contact: <sip:8888@192.168.1.14: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);