<div dir="ltr">Hello,<div><br></div><div>Great!</div><div>Thank you for your help.</div><div>Loic</div><div class="gmail_extra"><br><div class="gmail_quote">2015-10-05 19:12 GMT+02:00 Alex Balashov <span dir="ltr"><<a href="mailto:abalashov@evaristesys.com" target="_blank">abalashov@evaristesys.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Here's an example from our config:<br>
<br>
#!subst "/DB_USER/xxxxxxxx/"<br>
#!subst "/DB_PASSWORD/xxxxxxxxxx/"<br>
<br>
event_route[xhttp:request] {<br>
        # Challenge for authentication credentials DB_NAME and DB_PASSWORD.<br>
<br>
        xlog("L_INFO", "[R-XHTTP-REQUEST:$ci] Received HTTP request $rm $hu from $si:$sp\n");<br>
<br>
        if(is_present_hf("Authorization") && defined $au && $au ne "DB_USER") {<br>
                xlog("L_INFO", "[R-XHTTP-REQUEST:$ci] !> Invalid user: $au\n");<br>
                sl_send_reply("403", "Forbidden");<br>
                exit;<br>
        }<br>
<br>
        # The challenge does not send a qop= parameter, in order to ease<br>
        # the burden on the client.<br>
<br>
        if(!pv_www_authenticate("$Ri", "DB_PASSWORD", "0", "POST")) {<br>
                switch($rc) {<br>
                        case -1:<br>
                                xlog("L_INFO", "[R-XHTTP-REQUEST:$ci] !> Generic authentication error\n");<br>
                                sl_send_reply("403", "Forbidden");<br>
                                break;<br>
<br>
                        case -2:<br>
                                xlog("L_INFO", "[R-XHTTP-REQUEST:$ci] !> Invalid password -- rejecting\n");<br>
                                sl_send_reply("403", "Forbidden");<br>
                                break;<br>
<br>
                        default:<br>
                                xlog("L_INFO", "[R-XHTTP-REQUEST:$ci] !> Unauthorised -- issuing authentication challenge\n");<br>
                                www_challenge("$Ri", "0");<br>
                }<br>
<br>
                exit;<br>
        }<br>
<br>
        xlog("L_INFO", "[R-XHTTP-REQUEST:$ci] -> Authorised user: $au\n");<br>
<br>
        consume_credentials();<br>
<br>
-- Alex<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Alex Balashov | Principal | Evariste Systems LLC<br>
303 Perimeter Center North, Suite 300<br>
Atlanta, GA 30346<br>
United States<br>
<br>
Tel: <a href="tel:%2B1-800-250-5920" value="+18002505920" target="_blank">+1-800-250-5920</a> (toll-free) / <a href="tel:%2B1-678-954-0671" value="+16789540671" target="_blank">+1-678-954-0671</a> (direct)<br>
Web: <a href="http://www.evaristesys.com/" rel="noreferrer" target="_blank">http://www.evaristesys.com/</a>, <a href="http://www.csrpswitch.com/" rel="noreferrer" target="_blank">http://www.csrpswitch.com/</a></font></span><div class="HOEnZb"><div class="h5"><br>
<br>
_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a></div></div></blockquote></div>
</div></div>