[Kamailio-Users] nested redirect

kentp at globalpops.com kentp at globalpops.com
Sat Sep 13 03:11:52 CEST 2008


i have a simple redirect server working:

Call comes from switch (A) to kamailio redirect server (B)..
(B) runs perl script to determine route
(B) sends Stateless 300 redirect reply to (A). 
(A) sends ACK to (B). 

Now, I need to add a nested redirect... 

call comes from sitch (A) to kamailio redirect server (B)..
(B) then needs to send the call to third party proxy (C).. 
(C) will return 302 redirect..
(B) sends ACK to (C)
(B) needs to read the contact header, then run perl script to determine route (using the contact value 
returned from (c))
(B) then sends 300 redirect back to (A).
(A) sends ACK back to (B)


so far i have been trying something like this, but the final (A) ACK gets ignored and (B) keeps sending 
multiple 300's to (A):

route {
	route(1);
}

route[1] {
		t_on_reply("1");
		t_on_failure("2");
		if (!t_relay("proxy.server.c:5060","0x02")) {
		                sl_reply_error();
        	}
onreply_route[1] {
        if(t_check_status("302")){
                $var(lrn_from_bv) = $ct;
        }
}
failure_route[2] {
        
        if (t_check_status("3[0-9][0-9]")) {
                route(2);
                exit;
        }
route[2] {
	        if(perl_exec("callcheck")){
	                avp_pushto("$ru", "$avp(s:routes)/g");
	                t_reply("300","Go Here");
	                exit;
        	}
        }
        
  





More information about the Users mailing list