<div dir="ltr"><div><div>Sorry I don't have a deep knowledge in SIP protocol either how kamailio works internally. </div><div><br></div><div>These are the invite messages:</div><div><br></div><div>T <a href="http://88.15.197.56:34204">88.15.197.56:34204</a> -> <a href="http://146.185.142.19:9773">146.185.142.19:9773</a> [AP]<br></div><div>INVITE <a href="http://sip:+34639446862@146.185.142.19:9773">sip:+34639446862@146.185.142.19:9773</a> SIP/2.0.</div><div>Via: SIP/2.0/TCP 88.15.197.56:34204;rport;branch=z9hG4bKPj4778a63e-b3a1-4908-99b9-524161085409;alias.</div><div>Max-Forwards: 70.</div><div>From: <a href="mailto:sip%3A%2B3412345678910@146.185.142.19">sip:+3412345678910@146.185.142.19</a>;tag=9db4d38c-badb-41fe-8910-44857fb759c1.</div><div>To: <a href="mailto:sip%3A%2B34639446862@146.185.142.19">sip:+34639446862@146.185.142.19</a>.</div><div>Contact: <sip:+3412345678910@88.15.197.56:34204;transport=TCP;ob>.</div><div>Call-ID: 4c2fcd40-9b71-4dcf-b2dd-ee85318883f9.</div><div>CSeq: 32366 INVITE.</div><div>Route: <sip:146.185.142.19:9773;transport=tcp;lr>.</div><div>Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS.</div><div>Supported: replaces, 100rel, timer, norefersub.</div><div>Session-Expires: 1800.</div><div>Min-SE: 90.</div><div>Content-Type: application/sdp.</div><div>Content-Length: 473.</div><div>.</div><div>v=0.</div><div>o=- 3727764645 3727764645 IN IP4 192.168.1.35.</div><div>s=pjmedia.</div><div>b=AS:84.</div><div>t=0 0.</div><div>a=X-nat:0.</div><div>m=audio 4002 RTP/AVP 98 97 99 104 3 0 8 9 96.</div><div>c=IN IP4 192.168.1.35.</div><div>b=TIAS:64000.</div><div>a=rtcp:4003 IN IP4 192.168.1.35.</div><div>a=sendrecv.</div><div>a=rtpmap:98 speex/16000.</div><div>a=rtpmap:97 speex/8000.</div><div>a=rtpmap:99 speex/32000.</div><div>a=rtpmap:104 iLBC/8000.</div><div>a=fmtp:104 mode=30.</div><div>a=rtpmap:3 GSM/8000.</div><div>a=rtpmap:0 PCMU/8000.</div><div>a=rtpmap:8 PCMA/8000.</div><div>a=rtpmap:9 G722/8000.</div><div>a=rtpmap:96 telephone-event/8000.</div><div>a=fmtp:96 0-16.</div><div><br></div><div>#</div><div>T <a href="http://146.185.142.19:9773">146.185.142.19:9773</a> -> <a href="http://88.15.197.56:34204">88.15.197.56:34204</a> [AP]</div><div>SIP/2.0 100 trying -- your call is important to us.</div><div>Via: SIP/2.0/TCP 88.15.197.56:34204;rport=34204;branch=z9hG4bKPj4778a63e-b3a1-4908-99b9-524161085409;alias;received=88.15.197.56.</div><div>From: <a href="mailto:sip%3A%2B3412345678910@146.185.142.19">sip:+3412345678910@146.185.142.19</a>;tag=9db4d38c-badb-41fe-8910-44857fb759c1.</div><div>To: <a href="mailto:sip%3A%2B34639446862@146.185.142.19">sip:+34639446862@146.185.142.19</a>.</div><div>Call-ID: 4c2fcd40-9b71-4dcf-b2dd-ee85318883f9.</div><div>CSeq: 32366 INVITE.</div><div>Server: kamailio (4.3.4 (x86_64/linux)).</div><div>Content-Length: 0.</div><div>.</div><div><br></div><div>#</div><div>T <a href="http://146.185.142.19:9773">146.185.142.19:9773</a> -> <a href="http://31.221.250.100:52775">31.221.250.100:52775</a> [AP]</div><div>INVITE sip:+34639446862@31.221.250.100:52775;transport=TCP;ob SIP/2.0.</div><div>Record-Route: <sip:146.185.142.19:9773;transport=tcp;lr>.</div><div>Via: SIP/2.0/TCP 146.185.142.19:9773;branch=z9hG4bK59dc.a677b7aceca06187ebd35e44c30f42a4.0;i=3.</div><div>Via: SIP/2.0/TCP 88.15.197.56:34204;received=88.15.197.56;rport=34204;branch=z9hG4bKPj4778a63e-b3a1-4908-99b9-524161085409;alias.</div><div>Max-Forwards: 69.</div><div>From: <a href="mailto:sip%3A%2B3412345678910@146.185.142.19">sip:+3412345678910@146.185.142.19</a>;tag=9db4d38c-badb-41fe-8910-44857fb759c1.</div><div>To: <a href="mailto:sip%3A%2B34639446862@146.185.142.19">sip:+34639446862@146.185.142.19</a>.</div><div>Contact: <sip:+3412345678910@88.15.197.56:34204;transport=TCP;ob>.</div><div>Call-ID: 4c2fcd40-9b71-4dcf-b2dd-ee85318883f9.</div><div>CSeq: 32366 INVITE.</div><div>Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS.</div><div>Supported: replaces, 100rel, timer, norefersub.</div><div>Session-Expires: 1800.</div><div>Min-SE: 90.</div><div>Content-Type: application/sdp.</div><div>Content-Length: 473.</div><div>.</div><div>v=0.</div><div>o=- 3727764645 3727764645 IN IP4 192.168.1.35.</div><div>s=pjmedia.</div><div>b=AS:84.</div><div>t=0 0.</div><div>a=X-nat:0.</div><div>m=audio 4002 RTP/AVP 98 97 99 104 3 0 8 9 96.</div><div>c=IN IP4 192.168.1.35.</div><div>b=TIAS:64000.</div><div>a=rtcp:4003 IN IP4 192.168.1.35.</div><div>a=sendrecv.</div><div>a=rtpmap:98 speex/16000.</div><div>a=rtpmap:97 speex/8000.</div><div>a=rtpmap:99 speex/32000.</div><div>a=rtpmap:104 iLBC/8000.</div><div>a=fmtp:104 mode=30.</div><div>a=rtpmap:3 GSM/8000.</div><div>a=rtpmap:0 PCMU/8000.</div><div>a=rtpmap:8 PCMA/8000.</div><div>a=rtpmap:9 G722/8000.</div><div>a=rtpmap:96 telephone-event/8000.</div><div>a=fmtp:96 0-16.</div></div><div><br></div><div>The Via and Contact both have the public ip, it's weird because I'm not using STUN in clients. </div><div>The route and the record route are the sip domain with the transport tag. <sip:146.185.142.19:9773;transport=tcp;lr>.</div><div>So how it should be to be market as "natted" and be sent to rtpproxy? </div><div>Thanks for your patience.</div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-02-16 11:06 GMT+01:00 Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<p>Wondering if you actually read properly my previous response.
There is no "nat=yes" in Route params because the call (via
initial INVITE) is not marked as natted -- look at what is sent to
the network for the initial INVITE in the Record-Route header.</p>
<p>Daniel<br>
</p><span class="">
<br>
<div class="m_-2614714469107987551moz-cite-prefix">On 16.02.18 10:45, Pau Giralt wrote:<br>
</div>
</span><blockquote type="cite">
<div dir="ltr"><span class="">These are the complete logs for the previous call:
<div><br>
</div>
</span><div>[...]</div>
<div><br>
</div>
<div><br>
</div>
<div>As you can see check_route_param(): params are
<;transport=tcp;lr></div>
</div><div><div class="h5">
<div class="gmail_extra"><br>
<div class="gmail_quote">2018-02-15 18:16 GMT+01:00
Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<p>Based on the logs, there is no check_route_param()
executed. Actually, it is an initial INVITE, doesn't
have a to-tag, so there is no Route header added
previously by kamailio where check_route_param() can
work on.</p>
<p>Looking at the headers, this initial INVITE has Via and
Contact with public addresses (maybe UA is using stun),
only the SDP seems to have carrier grand nat address.
You have to adjust the parameter for nat_uac_test() in
order to detect it is a natted call.</p>
<p>Cheers,<br>
Daniel<br>
</p>
<span> <br>
<div class="m_-2614714469107987551m_619335301534630616moz-cite-prefix">On
15.02.18 15:35, Pau Giralt wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>My kamailio version is:<br>
<br>
version: kamailio 4.4.6 (x86_64/linux) becbde<br>
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP,
TLS_HOOKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK,
SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC,
TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX,
FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE,
USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST,
HAVE_RESOLV_RES<br>
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE
262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE
65535, DEFAULT PKG_SIZE 8MB<br>
poll method support: poll, epoll_lt, epoll_et,
sigio_rt, select.<br>
id: becbde <br>
compiled on 08:18:45 Jul 3 2017 with gcc 5.4.0<br>
<br>
<br>
</div>
I've pasted the logs below.<br>
<div>
<div>
<div> <br>
( ... )<br>
</div>
</div>
</div>
</div>
</blockquote>
</span> [...]
<div>
<div class="m_-2614714469107987551h5"><br>
<blockquote type="cite">
<div dir="ltr">
<div>
<div>
<div><br>
</div>
<div>Thanks!<br>
<br>
</div>
</div>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2018-02-15 15:02
GMT+01:00 Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<p>Hello,</p>
<p>first, what is the version of kamailio?</p>
<p>Then, can you load debugger module and
set cfgtrace=1, then send here all log
messages for a case exposing this issue?
It should show what actions are executed
from config.</p>
<p>Cheers,<br>
Daniel<br>
</p>
<div>
<div class="m_-2614714469107987551m_619335301534630616h5"> <br>
<div class="m_-2614714469107987551m_619335301534630616m_2439203765309466644moz-cite-prefix">On
15.02.18 12:08, Pau Giralt wrote:<br>
</div>
</div>
</div>
<blockquote type="cite">
<div>
<div class="m_-2614714469107987551m_619335301534630616h5">
<div dir="ltr">
<p>Hi!</p>
<p> I'm working with kamailio and
rtpproxy.<br>
When I configure the clients to
send sip messages through TCP
adding the ";transport=tcp" in the
sip message the rtpproxy is not
working anymore.</p>
<p>The code is never passing the
point pasted below, inside
route[NATMANAGE] in kamailio.cfg</p>
<pre><code>if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB))) return;
</code></pre>
<p>Therefore, <code>rtpproxy_manage("co");</code>
is never reached.</p>
<p>Could it be a parsing problem? (
<code>check_route_param("nat=yes")</code>
)</p>
<p>The config file is exactly the
same as the one provided in the
kamailio repository (the default
one)<br>
</p>
<p>Thanks!</p>
<br>
</div>
<br>
<fieldset class="m_-2614714469107987551m_619335301534630616m_2439203765309466644mimeAttachmentHeader"></fieldset>
<br>
</div>
</div>
<pre>______________________________<wbr>_________________
Kamailio (SER) - Users Mailing List
<a class="m_-2614714469107987551m_619335301534630616m_2439203765309466644moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a>
<a class="m_-2614714469107987551m_619335301534630616m_2439203765309466644moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">https://lists.kamailio.org/cgi<wbr>-bin/mailman/listinfo/sr-users</a><span class="m_-2614714469107987551m_619335301534630616HOEnZb"><font color="#888888">
</font></span></pre>
<span class="m_-2614714469107987551m_619335301534630616HOEnZb"><font color="#888888"> </font></span></blockquote>
<span class="m_-2614714469107987551m_619335301534630616HOEnZb"><font color="#888888"> <br>
<pre class="m_-2614714469107987551m_619335301534630616m_2439203765309466644moz-signature" cols="72">--
Daniel-Constantin Mierla
<a class="m_-2614714469107987551m_619335301534630616m_2439203765309466644moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" target="_blank">www.twitter.com/miconda</a> -- <a class="m_-2614714469107987551m_619335301534630616m_2439203765309466644moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda" target="_blank">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - March 5-7, 2018, Berlin - <a class="m_-2614714469107987551m_619335301534630616m_2439203765309466644moz-txt-link-abbreviated" href="http://www.asipto.com" target="_blank">www.asipto.com</a>
Kamailio World Conference - May 14-16, 2018 - <a class="m_-2614714469107987551m_619335301534630616m_2439203765309466644moz-txt-link-abbreviated" href="http://www.kamailioworld.com" target="_blank">www.kamailioworld.com</a></pre>
</font></span></div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
<pre class="m_-2614714469107987551m_619335301534630616moz-signature" cols="72">--
Daniel-Constantin Mierla
<a class="m_-2614714469107987551m_619335301534630616moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" target="_blank">www.twitter.com/miconda</a> -- <a class="m_-2614714469107987551m_619335301534630616moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda" target="_blank">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - March 5-7, 2018, Berlin - <a class="m_-2614714469107987551m_619335301534630616moz-txt-link-abbreviated" href="http://www.asipto.com" target="_blank">www.asipto.com</a>
Kamailio World Conference - May 14-16, 2018 - <a class="m_-2614714469107987551m_619335301534630616moz-txt-link-abbreviated" href="http://www.kamailioworld.com" target="_blank">www.kamailioworld.com</a></pre>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div></div></blockquote><div><div class="h5">
<br>
<pre class="m_-2614714469107987551moz-signature" cols="72">--
Daniel-Constantin Mierla
<a class="m_-2614714469107987551moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" target="_blank">www.twitter.com/miconda</a> -- <a class="m_-2614714469107987551moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda" target="_blank">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - March 5-7, 2018, Berlin - <a class="m_-2614714469107987551moz-txt-link-abbreviated" href="http://www.asipto.com" target="_blank">www.asipto.com</a>
Kamailio World Conference - May 14-16, 2018 - <a class="m_-2614714469107987551moz-txt-link-abbreviated" href="http://www.kamailioworld.com" target="_blank">www.kamailioworld.com</a></pre>
</div></div></div>
</blockquote></div><br></div>