<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>Hi Bogdan,<br><br>My authentication route is as follow,<br><br>&nbsp;&nbsp; if (!allow_trusted()) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!proxy_authorize("","subscriber")) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(!lookup("location") ){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy_challenge("","0");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else if (!check_from()) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_send_reply("403", "Spoofed From-URI
 detected");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xlog("L_INFO","Spoofed From-URI detected ! from --&gt; $fu -- IP $si PORT:$sp");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(is_present_hf("Proxy-Authorization")){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; consume_credentials();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br><br>This route is before the dispatch route (t_relay())<br>I think retransmitted INVITEs get block by this route so If I use the <span style="font-weight: bold;">t_check_trans()&nbsp; as </span>follow will I able to absorb the retransmitted INVITE ?<br><br>&nbsp;&nbsp; if (!allow_trusted()) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!proxy_authorize("","subscriber")) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight: bold;"> if(!lookup("location") &amp;&amp; ! t_check_trans() ){</span><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy_challenge("","0");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else if (!check_from()) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_send_reply("403", "Spoofed From-URI detected");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xlog("L_INFO","Spoofed From-URI detected ! from --&gt; $fu -- IP $si PORT:$sp");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(is_present_hf("Proxy-Authorization")){<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; consume_credentials();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; }<br><br>modparam("auth", "disable_nonce_check", 1) setting this is not a good idea i think.<br><br>thanks<br><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Pasan Meemaduma &lt;pasandev@ymail.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> OpenSIPS users mailling list &lt;users@lists.opensips.org&gt;<br><b><span style="font-weight: bold;">Sent:</span></b> Monday, July 12, 2010 16:46:26<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [OpenSIPS-Users] proxy_authorize("","subscriber") bug ??<br></font><br><meta http-equiv="x-dns-prefetch-control" content="off"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div>Hi Bogdan,<br><br>Thanks for the quick
 reply,<br><br>What I now suspect is the security mechanism for stale nonces introduced in later 1.4 causing this. The identical configuration works fine with opensips 1.4<br><br>This problem started to appear after I upgrade server from openser to opensips about a month ago. <br><br>Loosing registration is the most worst problem since its affecting incoming calls.<br><br>For the moment what I did was add the following in my opensips.cfg after going through the mailing list archives.<br><br><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">modparam("auth", "disable_nonce_check", 1)<br><br>As I understood opensips reject nonce which is used before even if it send with correct credentials. This could be the problem
 that Re-INVITEs get 407 .<br><br>I can't do much changes to observe more debuging information like setting set debug =6&nbsp; as this is a production server.<br><br>I'm going to apply the new setting modparam("auth", "disable_nonce_check", 1) tomorrow on our offpeak time and see whether it will resolve the problem.<br><br>I'll get back to here tomorrow with the results.<br><br><br><br><div style="font-family: arial,helvetica,sans-serif; font-size: 13px;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Bogdan-Andrei Iancu &lt;bogdan@voice-system.ro&gt;<br><b><span style="font-weight: bold;">To:</span></b> OpenSIPS users mailling list &lt;users@lists.opensips.org&gt;<br><b><span style="font-weight: bold;">Sent:</span></b> Monday, July 12, 2010 15:46:18<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [OpenSIPS-Users] proxy_authorize("","subscriber") bug ??<br></font><br>Hi Pasan,<br><br>first,
 for non-REGISTER requests use only the proxy_XXXX() functions.<br><br>For debugging the failure, try:<br><br>1) print the return code of the proxy_authorize() (use $retcode) - see <br><a rel="nofollow" target="_blank" href="http://www.opensips.org/html/docs/modules/1.6.x/auth_db.html#id228340">http://www.opensips.org/html/docs/modules/1.6.x/auth_db.html#id228340</a><br><br>2) set debug =6 and post the log corresponding to the INVITE processing .<br><br>Regards,<br>Bogdan<br><br>Pasan Meemaduma wrote:<br>&gt; Hi All,<br>&gt;<br>&gt; I'm having trouble with my authentication routine with opensips 1.5<br>&gt;<br>&gt; I'm currently using opensips 1.5.3-1<br>&gt;<br>&gt; And there are lot of voip equipments using this production server.<br>&gt;<br>&gt; problem is&nbsp; that sometimes for some sip clients <br>&gt; proxy_authorize("","subscriber") returns false even with correct <br>&gt; credentials.<br>&gt;<br>&gt; basically most of the times this happens to
 Re-INVITEs in a
 dialogue <br>&gt; (messages with Proxy-Authorization Header).<br>&gt;<br>&gt; This is causing in progress calls being failed. sip client gives up <br>&gt; when it changes again.<br>&gt;<br>&gt; And another problem is with www_authorize("", "subscriber")<br>&gt;<br>&gt; It has the same problem returns false even with correct credentials. <br>&gt; and this happens randomly so , its hard to figure out why .<br>&gt;<br>&gt; does any one else having problem with simillar issues with using these <br>&gt; routines ?<br>&gt;<br>&gt; Is it a bug in these routines ?<br>&gt;<br>&gt; Is there a new release for 1.5 branch which has fixed this sort of a <br>&gt; problem.<br>&gt;<br>&gt; any help on this would be very appreciated.<br>&gt;<br>&gt; currently server has more than 8000 entries in location table at any <br>&gt; given time and handles more than 3000 calls per day.<br>&gt;<br>&gt; following is one such sip trace that i got from a call<br>&gt;<br>&gt;<br>&gt;
 Even the re- INVITE has correct Proxy-Authorization header present <br>&gt; opensips change it again.<br>&gt;<br>&gt; U 2010/06/24 16:03:40.466974 y.y.y.y:5060 -&gt; x.x.x.x:5060<br>&gt; INVITE sip:<a rel="nofollow" ymailto="mailto:1234567890@x.x.x.x" target="_blank" href="mailto:1234567890@x.x.x.x">1234567890@x.x.x.x</a> SIP/2.0.<br>&gt; To:&nbsp; &lt;sip:<a rel="nofollow" ymailto="mailto:1234567890@x.x.x.x" target="_blank" href="mailto:1234567890@x.x.x.x">1234567890@x.x.x.x</a>&gt;.<br>&gt; From: "abcdefgh" &lt;sip:<a rel="nofollow" ymailto="mailto:abcdefgh@x.x.x.x" target="_blank" href="mailto:abcdefgh@x.x.x.x">abcdefgh@x.x.x.x</a>&gt;;tag=252070.<br>&gt; Call-ID: 444603gj@192.168.1.20.<br>&gt; CSeq: 5 INVITE.<br>&gt; Via: SIP/2.0/UDP 192.168.1.20:5060;branch=z9hG4bK155910d13;rport.<br>&gt; Allow: ACK,BYE,CANCEL,INVITE,INFO,NOTIFY,OPTIONS,PRACK,REFER,UPDATE.<br>&gt; Contact: &lt;sip:abcdefgh@192.168.1.20:5060&gt;.<br>&gt; Supported:
 replaces,precondition.<br>&gt; Accept: application/sdp,application/cpim-pidf+xml.<br>&gt; Expires:
 240.<br>&gt; User-Agent: BiPAC 7404VGPX 5.53.s6.b1.<br>&gt; Accept-Language: en.<br>&gt; Content-Type: application/sdp.<br>&gt; Content-Length: 306.<br>&gt; Content-Language: en.<br>&gt; Content-Disposition: session.<br>&gt; Max-Forwards: 70.<br>&gt; Proxy-Authorization: Digest <br>&gt; username="abcdefgh",realm="x.x.x.x",nonce="4c22f542000042ba42dd84f4cd197a73f815b9c34124752c",uri="sip:<a rel="nofollow" ymailto="mailto:1234567890@x.x.x.x" target="_blank" href="mailto:1234567890@x.x.x.x">1234567890@x.x.x.x</a>",response="32f7b1dfebfa87b20d1efe0e47019b81".<br>&gt; .<br>&gt; v=0.<br>&gt; o=abcdefgh 862 862 IN IP4 192.168.1.20.<br>&gt; s=-.<br>&gt; c=IN IP4 192.168.1.20.<br>&gt; t=0 0.<br>&gt; m=audio 5100 RTP/AVP 18 0 8 101.<br>&gt; a=rtpmap:18 G729/8000.<br>&gt; a=rtpmap:0 PCMU/8000.<br>&gt; a=rtpmap:8 PCMA/8000.<br>&gt; a=rtpmap:101 telephone-event/8000.<br>&gt; a=fmtp:101 0-15,66,70.<br>&gt; a=curr:qos e2e send.<br>&gt; a=des:qos optional e2e
 sendrecv.<br>&gt;
 a=sendrecv.<br>&gt;<br>&gt;<br>&gt; U 2010/06/24 16:03:40.468557 x.x.x.x:5060 -&gt; y.y.y.y:5060<br>&gt; SIP/2.0 407 Proxy Authentication Required.<br>&gt; To:&nbsp; &lt;sip:<a rel="nofollow" ymailto="mailto:1234567890@x.x.x.x" target="_blank" href="mailto:1234567890@x.x.x.x">1234567890@x.x.x.x</a>&gt;;tag=a1270bde159848b15079f3c250cc0b75.56af.<br>&gt; From: "abcdefgh" &lt;sip:<a rel="nofollow" ymailto="mailto:abcdefgh@x.x.x.x" target="_blank" href="mailto:abcdefgh@x.x.x.x">abcdefgh@x.x.x.x</a>&gt;;tag=252070.<br>&gt; Call-ID: 444603gj@192.168.1.20.<br>&gt; CSeq: 5 INVITE.<br>&gt; Via: SIP/2.0/UDP <br>&gt; 192.168.1.20:5060;branch=z9hG4bK155910d13;rport=5060;received=y.y.y.y.<br>&gt; Proxy-Authenticate: Digest realm="x.x.x.x", <br>&gt; nonce="4c22f55a00004fac9c389333991faa357d4dda38f4b9159f".<br>&gt; Server: Voip.<br>&gt; Content-Length: 0.<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;
 ------------------------------------------------------------------------<br>&gt;<br>&gt;
 _______________________________________________<br>&gt; Users mailing list<br>&gt; <a rel="nofollow" ymailto="mailto:Users@lists.opensips.org" target="_blank" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>&gt; <a rel="nofollow" target="_blank" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>&gt;&nbsp;  <br><br><br>-- <br>Bogdan-Andrei Iancu<br>OpenSIPS Bootcamp<br>20 - 24 September 2010, Frankfurt, Germany<br>www.voice-system.ro<br><br><br>_______________________________________________<br>Users mailing list<br><a rel="nofollow" ymailto="mailto:Users@lists.opensips.org" target="_blank" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br><a rel="nofollow" target="_blank" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br></div></div>
</div><br><meta http-equiv="x-dns-prefetch-control" content="on"></div></div>
</div><br></body></html>