jsr289 学习手记(一)

jsr289 学习手记
jsr289是jcp在2008年推出的sip servlet 1.1标准。代替之前比较旧的jsr116 sip servlet1.0
近段时间在看这个。
没有很多有条理的归纳,只是以提纲提要的形式归纳一下就好。

1 如果应用设置了load on startup的时候报错,容器应该调用SipApplicationRouter.applicationUndeployed().方法

2 sip servlet 与Http servlet生命周期类似,一次初始化,多次反复调用

3 Servlet接口内If the message is a request the response argument MUST be null, and if the message is a response, the request argument MUST be null.

4 SipServlet内有一大堆do***方法,其中很多方法默认的response是501/nothing
but The doAck and doCancel do nothing

5 如果接收到unknown的request,按么可以override doRequest()方法

6 在所有情况下都会被容器调用service()而调用,并且带有一个request的 object和null的response

7 调用过程中出错的话必须返回500,最好在sip Header给出出错信息
8不要手动修改from 和to的头的tag,交由容器管理
9为提高性能,尽快创建ApplicationSession和sipSession对象
10 Session
From the SDP specification: “A multimedia session is a set of multimedia senders and receivers and the data streams flowing from senders to receivers. A multimedia conference is an example of a multimedia session.” [RFC 2327] (A session as defined for SDP can comprise one or more RTP sessions.) As defined, a callee can be invited several times, by different calls, to the same session. If SDP is used, a session is defined by the concatenation of the user name, session id, network type, address type and address elements in the origin field.

11 SIP transaction
A SIP transaction occurs between a client and a server and comprises all messages from the first request sent from the client to the server up to a final (non-1xx) response sent from the server to the client.
核心API:

12 并行搜索:同时向多个地址发送请求,寻找其中的有效的案例。

SipFactory sipfactory = (SipFactory) getServletContext().getAttribute(
SIP_FACTORY);

相比上一版本的改进
不再将from和to header定义为System header以便提供更加灵活的身份识别。RFC 4916
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值