首页 > 解决方案 > Pjsua(pjsip 客户端)不想使用 TCP

问题描述

我正在尝试使用 pjsua 向 SIP 服务器发出 SIP 请求,pjsua 是 pjsip 的 SIP 客户端(版本 2.10,2020-02-14)。以这种方式启动客户端:

pjsua-x86_64-apple-darwin19.4.0 --id sip:addreessee@sever_host_name:5061;transport=tcp --no-udp

使用“S”命令发送任意请求,键入要在请求中使用的 SIP 方法(我尝试使用 MESSAGE 和其他方法),然后添加为目标 URI“sip:sever_host_name:5061”

结果是:

Destination URI: sip:addreessee@sever_host_name:5061 
13:48:02.121           pjsua_core.c  .TX 342 bytes Request msg MESSAGE/cseq=53264 (tdta0x7f96c501cca8) to UDP sever_host_name:5061:
MESSAGE sip:addresse@sever_host_name:5061 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.15:5060;rport;branch=z9hG4bKPjI-s3KUBrnruOqLAKEtCOLnJ.jJPKmoDe
Max-Forwards: 70
From: <sip:addreessee@server_host_name>;tag=1lsf1PY19Qc4fk-8IhoqTV9plx3kX0yC
To: <sip:addreessee@server_host_name>
Call-ID: -X2iZRlerEaevvVvOZlAX5STQnBaGuN2
CSeq: 53264 MESSAGE
Content-Length:  0

所以请求是通过 UDP 传输层发送的,而不是 TCP。谁能告诉我我做错了什么?

标签: sippjsip

解决方案


;transport=tcp您应该每次都添加到您的请求 URI。

你可以在这里阅读更多(链接


推荐阅读