too many hops error in opensips.cfg

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

too many hops error in opensips.cfg

bay2x1
I am trying to create my own opensips.cfg configuration.  My registration is working perfectly but my I am having problems in handling invite transactions.  Can anyone point out and/or explain what is wrong with my code?

# main request routing logic

route{




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

        #sequential request goes here
        if(has_totag()){
                if(loose_route()){
                        if(is_method("BYE")){
                                setflag(1);
                                setflag(3);
                        }
                        route(2);
                } else {

                        if(is_method("ACK")){
                                if(t_check_trans()){
                                        t_relay();
                                        exit;
                                }else{
                                        exit;
                                };
                        }
                        sl_send_reply("404", "Not here");

                };
                exit;
        };

        #initial request goes here

        if(is_method("CANCEL")){
                if(t_check_trans()){
                        t_relay();
                }
                exit;
        }


        t_check_trans();
       
        if(method=='REGISTER'){
                route(1);
        }else if (!is_method("REGISTER|MESSAGE")) {
                record_route();
                if((method=="INVITE" && !has_totag())){
                        route(2);
                };
               
        };
}

route[1] {  




        if(is_uri_host_local()) {
                if (!www_authorize("", "subscriber"))
                {
                        xlog("RQINC-INFO: WWW Registration Challenge by: $fu\n");
                        www_challenge("", "0");
                        exit;
                       
                }
               
                if (!check_to())
                {
                        sl_send_reply("403","Forbidden auth ID");
                        exit;
                }

               
                if (!save("location"))
                        sl_reply_error();

                exit;
        } else if {
                sl_send_reply("403", "Forbidden");
        };
}

route[2] {



       
        xlog("RQINC INFO:  Processing Outbound Request! \n");
        xlog("RQINC INFO:  Request Method=$rm! CSEQ=$cs \n");
        t_on_branch("2");
        t_on_reply("2");
        t_on_failure("1");
       

        if(!t_relay()){
                sl_reply_error();
                exit;
        };
       
        exit;
}




branch_route[2] {
        xlog("RQINC INFO: New Branch at $ru \n");
        xlog("RQINC INFO: $bR = branch CSEQ=$cs\n");
}

onreply_route[2] {
        xlog("RQINC INFO: Incoming Reply \n");
        xlog("RQINC INFO: Reply = $rr and Reply status = $rs  CSEQ=$cs\n");
}

failure_route[1] {

        xlog("RQINC INFO: Request Failure \n");
        if (t_was_cancelled()) {
                xlog("Transaction Cancelled --rqinc CSEQ=$cs\n");
                exit;
        }
        exit;
}
Reply | Threaded
Open this post in threaded view
|

Re: too many hops error in opensips.cfg

Bogdan-Andrei Iancu
Hi,

When asking for help, please specify your problem - what error you get,
what it's not working, etc - all these, as accurate as possible.

Generic "having problem with" statements give no info about your issue,
so nobody will be able to help you.

Regards,
Bogdan


bay2x1 wrote:

> I am trying to create my own opensips.cfg configuration.  My registration is
> working perfectly but my I am having problems in handling invite
> transactions.  Can anyone point out and/or explain what is wrong with my
> code?
>
> # main request routing logic
>
> route{
>
>
>
>
> if(!mf_process_maxfwd_header("10")){
> sl_send_reply("483", "Too Many Hops");
> exit;
> };
>
>         #sequential request goes here
> if(has_totag()){
> if(loose_route()){
> if(is_method("BYE")){
> setflag(1);
> setflag(3);
> }
> route(2);
> } else {
>
> if(is_method("ACK")){
> if(t_check_trans()){
> t_relay();
> exit;
> }else{
> exit;
> };
> }
> sl_send_reply("404", "Not here");
>
> };
> exit;
> };
>
> #initial request goes here
>
> if(is_method("CANCEL")){
> if(t_check_trans()){
> t_relay();
> }
> exit;
> }
>
>
> t_check_trans();
>
> if(method=='REGISTER'){
> route(1);
> }else if (!is_method("REGISTER|MESSAGE")) {
> record_route();
> if((method=="INVITE" && !has_totag())){
> route(2);
> };
>
> };
> }
>
> route[1] {  
>
>
>
>
> if(is_uri_host_local()) {
> if (!www_authorize("", "subscriber"))
> {
> xlog("RQINC-INFO: WWW Registration Challenge by: $fu\n");
> www_challenge("", "0");
> exit;
>
> }
>
> if (!check_to())
> {
> sl_send_reply("403","Forbidden auth ID");
> exit;
> }
>
>
> if (!save("location"))
> sl_reply_error();
>
> exit;
> } else if {
> sl_send_reply("403", "Forbidden");
> };
> }
>
> route[2] {
>
>
>
>
> xlog("RQINC INFO:  Processing Outbound Request! \n");
> xlog("RQINC INFO:  Request Method=$rm! CSEQ=$cs \n");
> t_on_branch("2");
> t_on_reply("2");
> t_on_failure("1");
>
>
> if(!t_relay()){
> sl_reply_error();
> exit;
> };
>
> exit;
> }
>
>
>
>
> branch_route[2] {
> xlog("RQINC INFO: New Branch at $ru \n");
> xlog("RQINC INFO: $bR = branch CSEQ=$cs\n");
> }
>
> onreply_route[2] {
> xlog("RQINC INFO: Incoming Reply \n");
> xlog("RQINC INFO: Reply = $rr and Reply status = $rs  CSEQ=$cs\n");
> }
>
> failure_route[1] {
>
> xlog("RQINC INFO: Request Failure \n");
> if (t_was_cancelled()) {
> xlog("Transaction Cancelled --rqinc CSEQ=$cs\n");
> exit;
> }
> exit;
> }
>
>  


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: too many hops error in opensips.cfg

Iñaki Baz Castillo
In reply to this post by bay2x1
El Viernes, 20 de Marzo de 2009, bay2x1 escribió:
> I am trying to create my own opensips.cfg configuration.  My registration
> is working perfectly but my I am having problems in handling invite
> transactions.  Can anyone point out and/or explain what is wrong with my
> code?

Debug your code for free and predict your problems by reading it? Sorry, not
possible.
You cannot ask for others to spend time solving your problems if you are not
able to spend some time to write a detailed and well explained mail.

--
Iñaki Baz Castillo

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users