J2ME SIP 连接 VIA 标头
我在 J2ME 应用程序中将 INVITE 发送到 sip 服务器,并使用 rtp 进行数据传输。VIA 标头存在冲突,即,隐含的 via 标头包含 UDP 而不是 rtp。但我没有在代码中的任何地方使用“upd”。如果我们考虑 JAINSIP,我们可以修改 VIA 标头。但是 j2m2 api 不允许修改 VIA 标头(此处)。
我该如何解决这个问题?如何避免在我的请求中隐式添加 udp 到 VIA 标头。我应该在哪里再次看到?
这是我发送的邀请码
try { final String ip = scn.getLocalAddress();
contact = "sip:user@" + scn.getLocalAddress() + ":" + scn.getLocalPort();
scc = (SipClientConnection) Connector.open("sip:[email protected]:5060;transport=tcp");
scc.setListener(this);
scc.initRequest("INVITE", scn);
scc.setRequestURI("sip:[email protected]:5060;transport=tcp");
scc.setHeader("From", "sip:user@" + scn.getLocalAddress() + ":" + scn.getLocalPort() + ";transport=tcp");
scc.setHeader("To", "sip:[email protected]:5060;transport=tcp");
scc.setHeader("Contact", contact);
System.out.println("Session id is :" + sId);
scc.setHeader("Session-Id", sId);
scc.setHeader("Content-Type", "application/sdp");
String sdp = "....";
OutputStream os = scc.openContentOutputStream();
os.write(sdp.getBytes());
os.close();
I send INVITE to a sip server in a J2ME app and use rtp for data transmision.There is a conflict in VIA header which is that,implecite via header contain UDP instead of rtp. But I haven't use 'upd' any where in my code.If we consider the JAINSIP we can modify the VIA header header.But j2m2 api doesn't allow to modify the VIA header(here).
How can I solve this?how to avoid implicitly adding udp to VIA header in my request.Where I should see again??
Here is my sending INVITE Code
try { final String ip = scn.getLocalAddress();
contact = "sip:user@" + scn.getLocalAddress() + ":" + scn.getLocalPort();
scc = (SipClientConnection) Connector.open("sip:[email protected]:5060;transport=tcp");
scc.setListener(this);
scc.initRequest("INVITE", scn);
scc.setRequestURI("sip:[email protected]:5060;transport=tcp");
scc.setHeader("From", "sip:user@" + scn.getLocalAddress() + ":" + scn.getLocalPort() + ";transport=tcp");
scc.setHeader("To", "sip:[email protected]:5060;transport=tcp");
scc.setHeader("Contact", contact);
System.out.println("Session id is :" + sId);
scc.setHeader("Session-Id", sId);
scc.setHeader("Content-Type", "application/sdp");
String sdp = "....";
OutputStream os = scc.openContentOutputStream();
os.write(sdp.getBytes());
os.close();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论