在用xlite\eyebeam与asterisk测试mwi时,发现存在一个问题,软phone在正确响应(发送200 ok)第一个收到的mwi notify后,对后续的notify皆回复错误的200 ok,直到下一次subsribe。但是响应一次notify后,又再错误处理后续的notify。
分析sip信令包发现,软phone回复后续notify的200 ok中的cseq与notify的不对应,而是与第一个notify的一致,而且对notify的message body并不处理,似乎xlite或者eyebeam对同一个dialog内的后续notify都误认为是重发。
根据rfc3265,典型的消息流程如下:
Subscriber Notifier
|-----SUBSCRIBE---->| Request state subscription
|<-------200--------| Acknowledge subscription
|<------NOTIFY----- | Return current state information
|--------200------->|
|<------NOTIFY----- | Return current state information
|--------200------->|
明显,xlite的处理有问题。
再看看asterisk是怎么做的。在sip channel的handle subscibe里,回复200 ok后会马上发送mwi给subscriber。这个似乎没什么必要,但是
Upon successfully accepting or refreshing a subscription, notifiers
MUST send a NOTIFY message immediately to communicate the current
resource state to the subscriber. This NOTIFY message is sent on the
same dialog as created by the SUBSCRIBE response. If the resource
has no meaningful state at the time that the SUBSCRIBE message is
processed, this NOTIFY message MAY contain an empty or neutral body.
See section 3.2.2. for further details on NOTIFY message generation.
Note that a NOTIFY message is always sent immediately after any 200-
class response to a SUBSCRIBE request, regardless of whether the
subscription has already been authorized.
好吧,asterisk是对的,不过为了测试mwi,只能先注掉发送第一次notify的代码,果然xlite、eyebeam就能正确处理notify的message body了。
阅读(4214) | 评论(2) | 转发(0) |