[Home]

Summary:ASTERISK-22658: PJSIP: If a transport is set on an endpoint, Asterisk will not reuse established connections for that endpoint
Reporter:Jonathan Rose (jrose)Labels:
Date Opened:2013-10-04 11:41:15Date Closed:2017-12-18 11:29:19.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Channels/chan_pjsip
Versions:SVN 12.0.0-beta1 Frequency of
Occurrence
Constant
Related
Issues:
is duplicated byASTERISK-24846 Cancel Request Broken in chan_pjsip when it's used on Trunk with TCP transport
is duplicated byASTERISK-24848 INVITE not send by asterisk on chan_pjsip when endpoint has TCP Transport
is duplicated byASTERISK-24889 Possible bug: PJSIP: stateless behavior when transport=tcp
Environment:Attachments:
Description:http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/2011-October/013439.html

In my case, I set up a PJSIP endpoint to use a transport requiring TLS. Apparently the phones I was using (SNOM360 and SNOM320) wouldn't accept connections established by Asterisk and this effectively prevented me from making outbound phonecalls to the SNOM phones.  I was able to work around it by simply not specifying the transport for the phones, but that leaves the phones allowed to connect through other means such as UDP or TCP transports.
Comments:By: Nick Repin (turnip) 2016-04-03 20:29:01.750-0500

It appears that the same issue causes the following (Asterisk 13.7.2), which seems like a major issue to me:

1) Configure an endpoint to expressly use a TCP or TLS transport (e.g., "transport=0.0.0.0-tcp"). Other settings don't seem to matter.
2) The softphone associated with the endpoint is behind NAT (for example, behind an ADSL modem, or on a Vodafone mobile data network). The phone uses STUN, which helps to connect to Asterisk, but I don't think it matters in terms of this particular issue. Both CSipSimple on Android and Bria on Windows are affected.
3) The phone connects to Asterisk and can make outbound calls. However, it doesn't receive MWI updates or inbound calls. What happens with MWI, the phone sends SUBSCRIBE. Asterisk replies with OK (which goes through the existing connection), then NOTIFY, The latter goes down the PJSIP stack, but instead of reusing the existing connection, PJSIP creates a new connection with a random source port number. Of course, the new TCP/TLS connection cannot reach the phone due to NAT.
4) To fix the issue, the transport variable must not be specified for an endpoint. Once "transport" is removed, MWI updates and inbound calls get through to the phone.