I’m struggling with something very simple I suppose.
I’ve setup a PBX and calls over UDP work just fine. However, when I try to setup a call from an UDP-client (endpoint which has transport=udp), it can’t call the TCP-client (transport=tcp).
Both clients are connected to the same server. Call from the TCP-client to UDP-client works but when the call has ended, TCP-client is unaware of hangup.
I’ve tried to add multiple transports to the same endpoint since the following syntax (valid in sip.conf) doesn’t appear to be working anymore in pjsip.conf:
config_options.c:733 aco_process_var: Error parsing protocol=tls,tcp at line 15
However, it looks like this method also doesn’t work since only the last transport is active.
The transport option in PJSIP is used to explicitly control what transport is used for an endpoint, it doesn’t control what transports are allowed. That’s not currently configurable.
The way that a transport is chosen is based on the underlying SIP URI. This is described on the wiki[1].
For TCP clients you’ll likely want to enable “rewrite_contact” so that the TCP connection which has been established by the client is used for calling it. You will also want to remove the transport option unless you are using the bundled PJSIP, as normal PJSIP has a bug currently where it will not reuse the TCP connection if transport is set.
However, when the TCP-client (242680) calls the UDP-client (227532), the UDP-client just keeps ringing. I’ve tried adding/removing rewrite_contact for the UDP-client . It seems that it is using a the IP of the trunk instead of the device itself (wrong FROM-tag).
The From is correct. That’s supposed to be us, same for P-Asserted-Identity and Remote-Party-ID. If you add rewrite_contact to the UDP endpoint you will also need to have it register again to be updated. Nothing else looks abnormal. As well if you don’t want the forum to mangle your SIP message you can add it as preformatted text in the editor.
However, every time the UDP-client sets up a call to the TCP-client (which has no transport defined), the following error pops up:
UDP-client calls to TCP-client. INVITE shows following error:
[Jul 14 13:52:14] WARNING[131290]: pjproject:0 <?>: tsx0x7f1e183ee …Failed to send Request msg INVITE/cseq=5542 (tdta0x7f1e18006ea0)! err=171064 (Unsuitable transport selected (PJSIP_ETPNOTSUITABLE))
[242680]
type=endpoint
rewrite_contact=yes (connects using TCP so needs this parameter as you suggested)
direct_media=no
context=DP_BELGIUM
disallow=all
allow=alaw,ulaw,h264,h261,h263,h263p,vp8
auth=auth242680
aors=242680
send_pai=yes
send_rpid=yes
sdp_session=PBXTEST