0

I'm using pjsua python module, and I don't know how to create a custom message like below:

mY'0E@@b,%+&KEEPALIVE sip:user@192.168.0.10 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.10;rport;branch=z9hG4bKPjgdQdo8azxxwRZ9aCVJy5Wdr27fTgDBUy
Max-Forwards: 70
From: <sip:user@192.168.0.10>;tag=w0na7ZUHDVaB8QG38EGdH5f23W3fzKL6
To: <sip:server@192.168.0.10>
Contact: <sip:server@192.168.0.10>
Call-ID: -TtcAtmNnJM5uteQDgMmddoWx7IM1fDP
CSeq: 1 KEEPALIVE
Applier-ID: 24598
Expires: 2147483647
User-Agent: PU/1.0.0
Content-Length:  0

Obs: The server and client are in the same PC.

Exists any way to do this? Thanks.

4

1 回答 1

1

我还没有尝试过,但是您可以通过使用该py_pjsua模块来做到这一点:

http://trac.pjsip.org/repos/wiki/Py_PJSUA

pjsua_call_send_request: 通过调用发送任意请求。这对于发送 INFO 请求很有用。请注意,应用程序不应使用此函数发送会更改邀请会话状态的请求,例如 re-INVITE、UPDATE、PRACK 和 BYE。

PJSIP 邮件列表中的一条消息解决了类似的情况,并指示on_call_tsx_state()回调可用于监视响应。

这似乎符合您的要求,因为我假设 KEEPALIVE 不会更改会话状态。请参阅此处的文档

于 2014-03-28T21:26:03.943 回答