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