<div dir="ltr">simple send_reply("200", "OK");, sorry<br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-11-13 16:02 GMT+02:00 Alexandru Covalschi <span dir="ltr"><<a href="mailto:568691@gmail.com" target="_blank">568691@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Thanks for your reply! But the problem is - I need to provide to API user's login and password. Kamailio doesn't know them. So my idea was to transmit to API the salt and encrypted password. Would that work? I see it that way<br></div>1. User sends register request.<br></div>2. Kamailio sends to API salt and ecnr.passwd<br></div>3. API recalculates MD5 on its side and compares with encr.passwd<br></div>4. Sends OK if it's ok, huh<br></div>5. I receive OK from API and send simple 200 OK to user<br><br></div>Do you see any logical mistakes here? Do I need some speacial 200 OK to approve registration, or simple send_reply("401", "OK"); is enough?<br><br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2015-11-13 15:21 GMT+02:00 Sebastian Damm <span dir="ltr"><<a href="mailto:damm@sipgate.de" target="_blank">damm@sipgate.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hello,<br><br></div>if your script can return the password for the user to Kamailio, you could use the pv_*_authenticate functions. You can pass the password to check against to these functions in a pseudo variable.<br><br><a href="http://www.kamailio.net/docs/modules/4.3.x/modules/auth.html#auth.f.pv_www_authenticate" target="_blank">http://www.kamailio.net/docs/modules/4.3.x/modules/auth.html#auth.f.pv_www_authenticate</a><br><br></div>Best Regards,<br></div>Sebastian<br><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Fri, Nov 13, 2015 at 2:14 PM, Alexandru Covalschi <span dir="ltr"><<a href="mailto:568691@gmail.com" target="_blank">568691@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">UPD: If upper method is possible - I assume I can check if message has Auth header using <br><pre>if (has_credentials("myrealm")) {
    ...
}<br><font face="arial,helvetica,sans-serif">Can you please specify how to grab it?</font></pre></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">2015-11-13 15:08 GMT+02:00 Alexandru Covalschi <span dir="ltr"><<a href="mailto:568691@gmail.com" target="_blank">568691@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hello!<br></div>My problem is I need to do users authentication through API. So I need to replace<br><pre>if (!www_authenticate("$td", "subscriber")) {
        www_challenge("$td", "1");
}<br><br></pre><pre><span style="font-family:arial,helvetica,sans-serif">With</span><br><br>if (!my_auth_script()) {
        www_challenge("$td", "1");
}<br></pre>The main problem is - how can I grab or compare users password? I know nonce, which I understand is MD5 salt. Can I, for example, grab users password from API, then grab the MD5 string and the nonce user sent me, calculate MD5 on base of API password and nonce - and then compare MD5 strings sent by user and calculated? <br></div><span><font color="#888888"><div><div><div><div><br>-- <br><div><div dir="ltr">Alexandru Covalschi<br>ABRISS-Solutions<div>VoIP engineer and system administrator<br>phone: <a href="tel:%2B37367398493" value="+37367398493" target="_blank">+37367398493</a><br>web: <a href="http://abs-telecom.com/" target="_blank">http://abs-telecom.com/</a></div></div></div>
</div></div></div></div></font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br><div><div dir="ltr">Alexandru Covalschi<br>ABRISS-Solutions<div>VoIP engineer and system administrator<br>phone: <a href="tel:%2B37367398493" value="+37367398493" target="_blank">+37367398493</a><br>web: <a href="http://abs-telecom.com/" target="_blank">http://abs-telecom.com/</a></div></div></div>
</div>
</div></div><br></div></div>_______________________________________________<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><br>
<br></blockquote></div><br></div></div>
<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><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div><div dir="ltr">Alexandru Covalschi<br>ABRISS-Solutions<div>VoIP engineer and system administrator<br>phone: <a href="tel:%2B37367398493" value="+37367398493" target="_blank">+37367398493</a><br>web: <a href="http://abs-telecom.com/" target="_blank">http://abs-telecom.com/</a></div></div></div>
</div>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr">Alexandru Covalschi<br>ABRISS-Solutions<div>VoIP engineer and system administrator<br>phone: +37367398493<br>web: <a href="http://abs-telecom.com/" target="_blank">http://abs-telecom.com/</a></div></div></div>
</div>