Double Registration transaction

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Double Registration transaction

bay2x1
I tried creating my own registration configuration. Using the ngrep tool I was able to capture the header packets.  I am wondering why the route(1) is executed twice everytime that a client registers. This is the code I am using for registration.


route{

        if(!mf_process_maxfwd_header("10")){
                sl_send_reply("483", "Too Many Hops");
                exit;
        };

        if(method=='REGISTER'){
               
                route(1);
        }
}

route[1] {  
        if(is_uri_host_local()) {
        xlog("Registration Process starts here! \n");
                if(!www_authorize("", "subscriber"))
                {
                        www_challenge("","1");
                        xlog("Registration Process ends here! \n");
                        exit;
                };

                if(!check_to()) {
                        sl_send_reply("403", "Forbidden");
                };
                save("location");
                exit;
        } else if {
                sl_send_reply("403", "Forbidden");
        };
}