Search code examples
sippjsip

Pjsua (pjsip client) does not want use TCP


I'm trying to make a SIP request to a SIP server, using pjsua, a SIP client by pjsip (version 2.10, 2020-02-14). Starting the client this way:

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

Using the "S" command to send an arbitrary REQUEST, typing a SIP method (I tried with MESSAGE and others) to use in the request and than adding as destination URI "sip:sever_host_name:5061"

The result is:

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

So the request is sent over UDP transport layer, not TCP. Can anyone tell me what am I doing wrong?


Solution

  • You should add ;transport=tcp to your request URI each time.

    You can read more here (link)