<html>
<body>
<br>
thanks but where I can download <pre>uri_db.so module so that I can
enable this function (</pre>check_to)<br><br>
thanks,ed<br><br>
At 11:08 PM 5/10/2005, Rafael J. Risco G.V. wrote:<br>
<blockquote type=cite class=cite cite="">Hi <br>
you can use check_to function from uri module that Check To username
against URI table or digest credentials, see my example:<br>
<br>
if (method == "REGISTER") {<br><br>
if
(!www_authorize("<a href="http://mydomain.com.pe">mydomain.com.pe</a>
", "subscriber")) {<br>
log(1," ----- Fails to Register
\n"); <br>
www_challenge("<a href="http://mydomain.com.pe">mydomain.com.pe</a>
", "0");<br>
break;<br>
};<br><br>
# only registered users are allowed <br>
if (!check_to()) {<br>
log(1, "LOG: Hijack!!!--> unregistered user registration
attempt\n"); <br>
sl_send_reply("403", "hijack attempt!!!! Only registered
users are allowed");<br>
break;<br>
};<br>
log(1," Registered!!! \n"); <br>
if (!save("location")) {<br>
sl_reply_error();<br>
};<br>
break;<br>
};<br><br>
if ((method == "INVITE" || method== "CANCEL" ||
method== "ACK")) {<br><br>
log(1, "ANALYZING INVITE||CANCEL REQUESTs\n");<br>
if
(!proxy_authorize("<a href="http://mydomain.com.pe">
mydomain.com.pe</a>", "subscriber")) { <br>
proxy_challenge("<a href="http://mydomain.com.pe">mydomain.com.pe</a>
", "1");<br>
break;<br>
} else {<br>
if (method == "INVITE" && !check_from()) { <br>
sl_send_reply("403", "Only registered users are
allowed"); <br>
break;<br>
};<br>
};<br><br>
<br>
/* *********** Dial out to Local and PSTN logic *********
*/ <br><br>
if(uri=~"^sip:001[0-9][0-9][1-9]*@(mydomain\.com\.pe)"){<br>
rewritehostport("IP_Gateway:5060");<br>
log(1,"digit expression match - pstn 001\n"); <br>
if(!t_relay()){<br>
sl_reply_error();<br>
};<br>
break;<br>
}; <br>
.<br>
.<br>
.<br>
.<br><br>
hope it helps, <br><br>
rafael<br><br>
<br><br>
<br><br>
<br><br>
<br>
On 5/10/05, <b>Edgardo O. Gonzales II</b>
<<a href="mailto:edgardo.g@pacific.net.ph">edgardo.g@pacific.net.ph</a>
> wrote: <br>
<dl><br>
<dd>Hi!<br><br>
<dd>How will I check if user is authenticated or not before I permit him
to<br>
<dd>make a call.<br><br>
<dd>thanks,<br>
<dd>ed<br><br>
<dd>_______________________________________________<br>
<dd>Serusers mailing list<br>
<dd><a href="mailto:serusers@lists.iptel.org">serusers@lists.iptel.org</a><br>
<dd>
<a href="http://lists.iptel.org/mailman/listinfo/serusers" eudora="autourl">
http://lists.iptel.org/mailman/listinfo/serusers</a><br><br>
</dl><br><br>
<br>
-- <br><br>
rrgv </blockquote></body>
</html>