[OpenSIPS-Users] too many hops error in opensips.cfg

Bogdan-Andrei Iancu bogdan at voice-system.ro
Fri Mar 20 12:17:27 CET 2009


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;
> }
>
>   




More information about the Users mailing list