Hello guys,<br><br>I'm having a strange problem with my Kamailio 1.5.3 when trying to register an Audiocodes Gateway. I'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'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("REGISTER"))</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("location");</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("", "subscriber"))</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("L_INFO", "AUTH: Invalid username\n");</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> sl_send_reply("403", "Forbidden");</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("L_INFO", "AUTH: Invalid password\n");</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> sl_send_reply("403", "Forbidden");</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("L_INFO", "AUTH: Nonce ambiguo\n");</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("L_INFO", "AUTH: No credentials\n");</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("L_INFO", "AUTH: Unknown error\n");</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("L_DBG", "AUTH: -Data- Auth Username = $au\n");</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> #xlog("L_DBG", "AUTH: -Data- Domain = $fd\n");</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> #xlog("L_DBG", "AUTH: -Data- From Username = $fU\n");</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> proxy_challenge("192.168.200.130","0");</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("L_INFO", "AUTH: Valid username and credentials\n");</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> -> <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: <<a href="mailto:sip%3Atestdevice@10.0.1.200">sip:testdevice@10.0.1.200</a>>;tag=1c26389068.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">To: <<a href="mailto:sip%3Atestdevice@10.0.1.200">sip:testdevice@10.0.1.200</a>>.</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: <<a href="http://sip:testdevice@10.0.1.200:5060">sip:testdevice@10.0.1.200:5060</a>>;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> -> <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: <<a href="mailto:sip%3Atestdevice@10.0.1.200">sip:testdevice@10.0.1.200</a>>;tag=1c26389068.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">To: <<a href="mailto:sip%3Atestdevice@10.0.1.200">sip:testdevice@10.0.1.200</a>>;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="192.168.200.130", nonce="4b142e8900000000188436d32ee472791b706f36952f4162".</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> -> <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: <<a href="mailto:sip%3Atestdevice@10.0.1.200">sip:testdevice@10.0.1.200</a>>;tag=1c26389068.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">To: <<a href="mailto:sip%3Atestdevice@10.0.1.200">sip:testdevice@10.0.1.200</a>>.</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="testdevice",realm="192.168.200.130",nonce="4b142e8900000000188436d32ee472791b706f36952f4162",uri="sip:192.168.200.130",algorithm=MD5,response="9fa0904b94f94152619a16c46ffa6485".</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Contact: <<a href="http://sip:testdevice@10.0.1.200:5060">sip:testdevice@10.0.1.200:5060</a>>;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> -> <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: <<a href="mailto:sip%3Atestdevice@10.0.1.200">sip:testdevice@10.0.1.200</a>>;tag=1c26389068.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">To: <<a href="mailto:sip%3Atestdevice@10.0.1.200">sip:testdevice@10.0.1.200</a>>;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="192.168.200.130", nonce="4b142e8900000001515ab7891a3d534cc3f15e5627322da3".</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>