<div dir="ltr">Hi everyone, <div>I'm using Kamailio as TLS gateway/filter for an internal Asterisk server<br></div><div><br></div><div>the network schema is  : <br></div><div><br></div><div>UAC (tls) --- INTERNET  --- (tls) KAMAILIO (sip udp) --- LAN --- (sip udp) ASTERISK</div><div> </div><div>with kamailio in multi-homed mode <br></div><div><br></div><div>WAN network interface for sip tls <br></div><div>LAN network interface for sip udp  to asterisk server <br></div><div><br></div><div><div><br></div><div>UAC address 80.0.0.1</div><div>KAMAILIO Wan address 80.0.0.2</div><div><br></div><div>KAMAILIO Lan address 172.16.0.2</div><div>ASTERISK Lan address 172.16.0.3</div><div><br><br></div></div><div><br></div><div>SIP-TLS call example<br></div><div>If the UAC use tls(sip) all works good <br></div><br><div><img src="cid:ii_l95lfjd11" alt="sip-ok-small.jpeg" width="558" height="363"><br></div><div><br></div><div>SIPS call example<br></div><div>If the same UAC use his default settings tls(sips)  , there are problems with ACK and BYE packet</div><div><br></div><div><img src="cid:ii_l95ln33g2" alt="sip-ko-small.jpeg" width="558" height="367"><br></div><div>the SIP OK SDP packet from kamailio to UAC  is <br></div><div><br></div><div>2022/10/10 09:28:47.854721 <a href="http://80.0.0.2:5061">80.0.0.2:5061</a> -> <a href="http://80.0.0.1:49992">80.0.0.1:49992</a><br>SIP/2.0 200 OK<br>Via: SIP/2.0/TLS 192.168.0.1:49992;rport=49992;received=80.0.0.1;branch=z9hG4bKM01j360VrBdH5VSV<br>Record-Route: <sip:172.16.0.1:5060;lr;r2=on;ftag=F798336AA08EF9FCFA89D3BDFE0C8C8F><br>Record-Route: <sip:80.0.0.2:5061;transport=tls;lr;r2=on;ftag=F798336AA08EF9FCFA89D3BDFE0C8C8F><br>Call-ID: 1EC2AB679C1EA1BAB60FD03B09F878020B12D3E7<br>From: <<a href="mailto:sips%3A200@pbx.voip.com">sips:200@pbx.voip.com</a>>;tag=F798336AA08EF9FCFA89D3BDFE0C8C8F<br>To: <sips:*<a href="mailto:43@pbx.voip.com">43@pbx.voip.com</a>>;tag=961d0e22-a4f0-453c-9870-6a41578afc96<br>CSeq: 2 INVITE<br>Contact: <sip:<a href="http://172.16.0.2:5060">172.16.0.2:5060</a>><br>P-Asserted-Identity: "xxxxxxxxx" <sips:*<a href="mailto:43@pbx.voip.com">43@pbx.voip.com</a>><br>Content-Type: application/sdp<br><br></div><div><br></div><div>and the UAC send the ACK and BYE from a different tcp port and to: sips:172.16.0.2:5060;transport=tcp <br></div><div><br></div><div><br></div><div>2022/10/10 09:28:48.495365 <a href="http://80.0.0.1:49996">80.0.0.1:49996</a> -> <a href="http://80.0.0.2:5061">80.0.0.2:5061</a><br>ACK sips:172.16.0.2:5060;transport=tcp SIP/2.0<br>Via: SIP/2.0/TLS 192.168.0.1:49996;branch=z9hG4bKppftdQze20lnwT41;rport<br>Route: <sip:80.0.0.2:5061;transport=tls;lr;r2=on;ftag=F798336AA08EF9FCFA89D3BDFE0C8C8F><br>Route: <sip:172.16.0.1:5060;lr;r2=on;ftag=F798336AA08EF9FCFA89D3BDFE0C8C8F><br>Max-Forwards: 70<br>To: <sips:*<a href="mailto:43@pbx.voip.com">43@pbx.voip.com</a>>;tag=961d0e22-a4f0-453c-9870-6a41578afc96<br>From: <<a href="mailto:sips%3A200@pbx.voip.com">sips:200@pbx.voip.com</a>>;tag=F798336AA08EF9FCFA89D3BDFE0C8C8F<br>Call-ID: 1EC2AB679C1EA1BAB60FD03B09F878020B12D3E7<br>CSeq: 2 ACK<br></div><div><br></div><div><br></div><div>kamailio error log</div><div>WARNING:  <core> [core/forward.c:229]: get_send_socket2(): protocol/port mismatch (forced udp:<a href="http://172.16.0.2:5060">172.16.0.2:5060</a>, to tls:<a href="http://172.16.0.3:5060">172.16.0.3:5060</a>)<br></div><div><br></div><div><br></div><div><br></div><div><br></div><div>
How can I solve this ?<br></div><div><br></div><div>Best Regards</div><div><br></div><div>Leo<br></div><div><br></div></div>