<p class="MsoNormal" style="line-height: normal;"><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;">Hi
List,<br>
I am using kamailio 1.4 and authenticating INVITE if the source ip address is
not in trusted table but  one of the IP which is not in the trusted
table was able to bypass INVITE authentication, . I don’t have SIP traces saved from
the called but when that was happening I could see that the INVITE didn’t have
auth credentials but caller was able to bypass authentication and was sending
calls to my upstream gateway.</span></p>

<p class="MsoNormal" style="line-height: normal;"><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;">Caller’s
IP is definitely not in the trusted table, I am just wondering is it something wrong
in my script or similar issue has reported before ;<br>
</span></p><p class="MsoNormal" style="line-height: normal;"><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;">Thanks in Advance</span></p><p class="MsoNormal" style="line-height: normal;">
<span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;">Asim<br></span></p><p class="MsoNormal" style="line-height: normal;"><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;">
route[2] {<br>
        xlog(&quot;L_INFO&quot;,
&quot;[ROUTE-2] Received initial INVITE from $si\n&quot;);<br>
<br>
        setflag(2);<br>
        setflag(3);<br>
<br>
        if(is_from_local()) {<br>
               
if(!allow_trusted()) {<br>
                       
xlog(&quot;L_INFO&quot;, &quot;[ROUTE-2 !] Issuing proxy challenge\n&quot;);<br>
<br>
                       
if(!proxy_authorize(&quot;&quot;, &quot;subscriber&quot;)) {<br>
                               
proxy_challenge(&quot;&quot;, &quot;1&quot;);<br>
                               
exit;<br>
                       
}<br>
<br>
                       
else if(!check_from()) {<br>
                               
xlog(&quot;L_INFO&quot;, &quot;[ROUTE-2 !] From URI denied\n&quot;);<br>
                               
sl_send_reply(&quot;403&quot;, &quot;Forbidden&quot;);<br>
                               
exit;<br>
                       
}<br>
               
}<br>
<br>
               
else {<br>
                       
xlog(&quot;L_INFO&quot;, &quot;[ROUTE-2 !] From URI domain not local -
denied\n&quot;);<br>
                       
sl_send_reply(&quot;403&quot;, &quot;Forbidden&quot;);<br>
                       
exit;<br>
               
}<br>
        }<br>
   consume_credentials();<br>
<br>
        xlog(&quot;L_INFO&quot;,
&quot;[ROUTE-2 -&gt;] Authentication credentials valid\n&quot;);<br>
<br>
        if(nat_uac_test(&quot;1&quot;)) {<br>
               
xlog(&quot;L_INFO&quot;, &quot;[ROUTE-2 -&gt;] RFC1918 contact found - fixing
up\n&quot;);<br>
               
fix_nated_contact();<br>
               
force_rport();<br>
               
setbflag(7);<br>
        }<br>
<br>
<br>
        if(nat_uac_test(&quot;8&quot;)
&amp;&amp; search(&quot;Content-Type: application/sdp&quot;)) {<br>
               
xlog(&quot;L_INFO&quot;, &quot;[ROUTE-2 -&gt;] RFC1918 SDP endpoint found -
fixing up\n&quot;);<br>
               
fix_nated_sdp(&quot;10&quot;);<br>
        }<br>
<br>
<br>
        # Apply outbound translations and
figure out where to route the call.<br>
<br>
        route(4); # this route the calls to
upstream gateway.<br>
}<br>
<br>
<br>
These messages i was getting in syslog</span></p>

<p class="MsoNormal" style="line-height: normal;"><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;">[ROUTE-2] Received initial INVITE
from xxx.xxx.xxx.xxx(Caller_IP)</span></p>

<p class="MsoNormal" style="line-height: normal;"><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;">ERROR:auth:consume_credentials: no
authorized credentials found (error in scripts) </span></p>

<p class="MsoNormal" style="line-height: normal;"><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;"> [ROUTE-2 -&gt;] Authentication
credentials valid </span></p>

<p class="MsoNormal" style="line-height: normal;"><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;"> [ROUTE-4] Applying outbound translations
to: 0022334455</span></p>

<p class="MsoNormal" style="line-height: normal;"><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;"> [ROUTE-4 -&gt;] Translated
RURI user part to: 22334455</span></p>

<p class="MsoNormal" style="line-height: normal;"><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;"> [ROUTE-4 -&gt;] Gateway
election: my_upstream_gateway</span></p>

<p class="MsoNormal" style="line-height: normal;"><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;"> [ROUTE-5] Accounting
translation: sip:0022334455@my_upstream_gateway</span></p>

<p class="MsoNormal" style="line-height: normal;"><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;"> [ROUTE-2 -&gt;] Relaying</span></p>

<p class="MsoNormal"> </p>