Hello guys,<br><br>I&#39;m having a strange problem with my Kamailio 1.5.3 when trying to register an Audiocodes Gateway. I&#39;m using authentication for REGISTER messages.<br><br>The GW sends a REGISTER without credentials, so I do a proxy_challenge. Then the GW sends a REGISTER with credentials but the proxy_authorize is returning -4.<br>
<br>I did an NGREP to check the messages and they don&#39;t seem malformed, can you tell me if there is something on the functions that might be loosing the Proxy-Authorization header?<br>This happens only with this GW, not if i register a softphone (XLITE).<br>
<br>Within route block:<br><span style="font-family: courier new,monospace;">...</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">if (is_method(&quot;REGISTER&quot;))</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">        {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">                     route(11);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">                     save(&quot;location&quot;);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">                     exit();</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">                }</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">...</span><br><br>Route(11):<br><span style="font-family: courier new,monospace;">route[11] {</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">   # ----- AUTENTICACION DE UN MENSAJE -----</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">   if (!proxy_authorize(&quot;&quot;, &quot;subscriber&quot;))</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">   {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">      switch($retcode)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">      {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">      case -1:</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">         xlog(&quot;L_INFO&quot;, &quot;AUTH: Invalid username\n&quot;);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">         sl_send_reply(&quot;403&quot;, &quot;Forbidden&quot;);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">         exit;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">      case -2:</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">         xlog(&quot;L_INFO&quot;, &quot;AUTH: Invalid password\n&quot;);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">         sl_send_reply(&quot;403&quot;, &quot;Forbidden&quot;);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">         exit;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">      case -3:</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">         xlog(&quot;L_INFO&quot;, &quot;AUTH: Nonce ambiguo\n&quot;);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">         break;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">      case -4:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">         xlog(&quot;L_INFO&quot;, &quot;AUTH: No credentials\n&quot;);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">         break;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">      #default:</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">         #xlog(&quot;L_INFO&quot;, &quot;AUTH: Unknown error\n&quot;);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">         #break;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">      }</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">      </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">      #xlog(&quot;L_DBG&quot;, &quot;AUTH: -Data- Auth Username = $au\n&quot;);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">      #xlog(&quot;L_DBG&quot;, &quot;AUTH: -Data- Domain = $fd\n&quot;);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">      #xlog(&quot;L_DBG&quot;, &quot;AUTH: -Data- From Username = $fU\n&quot;);</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">      proxy_challenge(&quot;192.168.200.130&quot;,&quot;0&quot;);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">      exit;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">   };</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">   </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">   xlog(&quot;L_INFO&quot;, &quot;AUTH: Valid username and credentials\n&quot;);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">   consume_credentials();</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">}</span><br><br>NGREP:<br><span style="font-family: courier new,monospace;">#</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">U <a href="http://10.0.1.200:5060">10.0.1.200:5060</a> -&gt; <a href="http://192.168.200.130:5060">192.168.200.130:5060</a></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">REGISTER sip:192.168.200.130 SIP/2.0.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Via: SIP/2.0/UDP 10.0.1.200;branch=z9hG4bKac26395445.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Max-Forwards: 70.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">From: &lt;<a href="mailto:sip%3Atestdevice@10.0.1.200">sip:testdevice@10.0.1.200</a>&gt;;tag=1c26389068.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">To: &lt;<a href="mailto:sip%3Atestdevice@10.0.1.200">sip:testdevice@10.0.1.200</a>&gt;.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Call-ID: <a href="mailto:154992670511200004613@10.0.1.200">154992670511200004613@10.0.1.200</a>.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">CSeq: 68 REGISTER.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Contact: &lt;<a href="http://sip:testdevice@10.0.1.200:5060">sip:testdevice@10.0.1.200:5060</a>&gt;;expires=180.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Allow: REGISTER,OPTIONS,INVITE,ACK,CANCEL,BYE,NOTIFY,PRACK,REFER,INFO,SUBSCRIBE,UPDATE.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Expires: 180.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">User-Agent: Audiocodes-Sip-Gateway-/v.5.80A.023.006.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Content-Length: 0.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">.</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">#</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">U <a href="http://192.168.200.130:5060">192.168.200.130:5060</a> -&gt; <a href="http://10.0.1.200:5060">10.0.1.200:5060</a></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">SIP/2.0 407 Proxy Authentication Required.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Via: SIP/2.0/UDP 10.0.1.200;branch=z9hG4bKac26395445.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">From: &lt;<a href="mailto:sip%3Atestdevice@10.0.1.200">sip:testdevice@10.0.1.200</a>&gt;;tag=1c26389068.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">To: &lt;<a href="mailto:sip%3Atestdevice@10.0.1.200">sip:testdevice@10.0.1.200</a>&gt;;tag=f8f2ab2c1295e90ed7dbb499b30f44b2.ee1a.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Call-ID: <a href="mailto:154992670511200004613@10.0.1.200">154992670511200004613@10.0.1.200</a>.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">CSeq: 68 REGISTER.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Proxy-Authenticate: Digest realm=&quot;192.168.200.130&quot;, nonce=&quot;4b142e8900000000188436d32ee472791b706f36952f4162&quot;.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Server: Kamailio (1.5.3-notls (i386/linux)).</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Content-Length: 0.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">.</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">#</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">U <a href="http://10.0.1.200:5060">10.0.1.200:5060</a> -&gt; <a href="http://192.168.200.130:5060">192.168.200.130:5060</a></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">REGISTER sip:192.168.200.130 SIP/2.0.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Via: SIP/2.0/UDP 10.0.1.200;branch=z9hG4bKac26766380.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Max-Forwards: 70.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">From: &lt;<a href="mailto:sip%3Atestdevice@10.0.1.200">sip:testdevice@10.0.1.200</a>&gt;;tag=1c26389068.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">To: &lt;<a href="mailto:sip%3Atestdevice@10.0.1.200">sip:testdevice@10.0.1.200</a>&gt;.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Call-ID: <a href="mailto:154992670511200004613@10.0.1.200">154992670511200004613@10.0.1.200</a>.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">CSeq: 69 REGISTER.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Proxy-Authorization: Digest username=&quot;testdevice&quot;,realm=&quot;192.168.200.130&quot;,nonce=&quot;4b142e8900000000188436d32ee472791b706f36952f4162&quot;,uri=&quot;sip:192.168.200.130&quot;,algorithm=MD5,response=&quot;9fa0904b94f94152619a16c46ffa6485&quot;.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Contact: &lt;<a href="http://sip:testdevice@10.0.1.200:5060">sip:testdevice@10.0.1.200:5060</a>&gt;;expires=180.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Allow: REGISTER,OPTIONS,INVITE,ACK,CANCEL,BYE,NOTIFY,PRACK,REFER,INFO,SUBSCRIBE,UPDATE.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Expires: 180.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">User-Agent: Audiocodes-Sip-Gateway-/v.5.80A.023.006.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Content-Length: 0.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">.</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">#</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">U <a href="http://192.168.200.130:5060">192.168.200.130:5060</a> -&gt; <a href="http://10.0.1.200:5060">10.0.1.200:5060</a></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">SIP/2.0 407 Proxy Authentication Required.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Via: SIP/2.0/UDP 10.0.1.200;branch=z9hG4bKac26766380.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">From: &lt;<a href="mailto:sip%3Atestdevice@10.0.1.200">sip:testdevice@10.0.1.200</a>&gt;;tag=1c26389068.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">To: &lt;<a href="mailto:sip%3Atestdevice@10.0.1.200">sip:testdevice@10.0.1.200</a>&gt;;tag=f8f2ab2c1295e90ed7dbb499b30f44b2.b7c8.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Call-ID: <a href="mailto:154992670511200004613@10.0.1.200">154992670511200004613@10.0.1.200</a>.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">CSeq: 69 REGISTER.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Proxy-Authenticate: Digest realm=&quot;192.168.200.130&quot;, nonce=&quot;4b142e8900000001515ab7891a3d534cc3f15e5627322da3&quot;.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Server: Kamailio (1.5.3-notls (i386/linux)).</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Content-Length: 0.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">.</span><br><br>Thanks in advance!<br>Uriel<br>