SIP servlet,chatserver [英] SIP servlets, chatserver

查看:187
本文介绍了SIP servlet,chatserver的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试让SIP servlet聊天服务器正常工作,以及此处找到的textclient

I'm trying to get a SIP servlet chat server working, together with the textclient found here.

当我使用2个客户端向对方发送消息时(点对点),一切顺利。但是当我将一个或多个客户端与我的服务器一起使用时,我必须等待32秒,然后服务器才会在 doMessage()方法中获取任何新消息。
我正在使用Netbeans和Sailfin作为我的SIP服务器。我正在查看Sailfin中的请求或响应之间是否存在某种限制或可配置的延迟或超时?

When I use 2 clients to send messages to eachother (peer to peer), everything goes well. But when I use one or more clients together with my server, I have to wait exactly 32 seconds before the server picks up any new messages in the doMessage() method. I'm using Netbeans together with Sailfin as my SIP server. Is there some kind of limitation or configurable delay or timeout between requests or responses in Sailfin I'm looking over?

如果需要,我可以发布服务器代码。

I can post the server code, if needed.

谢谢

推荐答案

要回答我自己的问题,如果有人遇到过同样的问题,我发现这是textclient中针对RFC 3261的以下8.1.1.7节的错误。

To answer my own question, if someone ever encounters the same problem, i found this is a bug in the textclient against the following section 8.1.1.7 of RFC 3261.


分支参数值必须对于UA发送的所有
请求,在空间和时间上是唯一的
。此规则的
例外是CANCEL和非2xx响应的
ACK。正如下面讨论的
,一个CANCEL请求将
与其取消的请求具有相同的分支
参数值。
如第17.1.1.3节所述,非2xx响应的
ACK也将使
具有与其确认响应的INVITE
相同的分支ID。

The branch parameter value MUST be unique across space and time for all requests sent by the UA. The exceptions to this rule are CANCEL and ACK for non-2xx responses. As discussed below, a CANCEL request will have the same value of the branch parameter as the request it cancels. As discussed in Section 17.1.1.3, an ACK for a non-2xx response will also have the same branch ID as the INVITE whose response it acknowledges.

分支
ID参数的唯一性属性,以便于将其用作
a交易ID,不属于RFC
2543。

The uniqueness property of the branch ID parameter, to facilitate its use as a transaction ID, was not part of RFC 2543.

符合此规范的元素
插入的分支ID务必
始终以字符
z9hG4bK开头。

The branch ID inserted by an element compliant with this specification MUST always begin with the characters "z9hG4bK".

SipLayer.java中的以下行

The following line in SipLayer.java

ViaHeader viaHeader = headerFactory.createViaHeader(getHost(),
getPort(), "udp", "branch1");

将使用branch1参数创建每条消息。使此参数唯一可以解决问题。

Will create every message with the "branch1" parameter. Making this parameter unique fixes the problem.

这篇关于SIP servlet,chatserver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆