[OpenSIPS-Users] Basic dynamic routing question

Bogdan-Andrei Iancu bogdan at voice-system.ro
Sat Jun 20 01:05:02 CEST 2009


Hi James,

The logic is a bit different that the one for lcr - the do_routing() 
functions already pushes the initial destination, so no need to do the 
"use_next_gw" after it:

route {

...
        if (!do_routing("1")) {
          sl_send_reply("503", "No destination available");
          exit;
	}
        xlog("-----gw attr is $avp(s:dr_attrs)\n");

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

}


Regards,
Bogdan


James Wiegand wrote:
> Hi all,
>
> I am trying to get dynamic routing working and can't seem to get any
> traction on the problem
>
> when I do a do_routing() call in the request loop nothing seems to
> happen.  I am at a loss troubleshooting this problem.  How can you
> tell what possible matches there are?
>
> Routing setup I have includes the following items - OpenSIPS 1.5.1
>
> table dr_rules:
>
> ruleid 	groupid 	prefix 	timerec 	priority 	routeid 	gwlist 	description
> 1 	        1 	        870 	20040101T000000 	0 	0 	1 	Default route
>
> table dr_gateways:
>
> gwid 	type 	address 	         strip 	pri_prefix 	attrs 	description
> 1 	10 	XXX.XXX.XXX.XXX  0 	NULL 	NULL 	Provider
>
> route {
>
> ...
>         do_routing("1");
>         xlog("-----gw attr is $avp(s:dr_attrs)\n");
>
>         if(use_next_gw())
>         {
>           if (!t_relay())
>           {
>             sl_reply_error();
>           }
>           exit;
>
>
>         } else {
>           sl_send_reply("503", "No destination available");
>           exit;
>         }
>
> }
>
> >From the log:
>
> Jun 19 17:10:55 [9270] DBG:drouting:do_routing: using dr group 1
> Jun 19 17:10:55 [9270] DBG:drouting:internal_check_rt: found rgid 1
> (rule list 0xb60d4dc8)
> Jun 19 17:10:55 [9270] DBG:drouting:do_routing: setting attr [] as for ruri
> Jun 19 17:10:55 [9270] DBG:drouting:do_routing: setting the gw [0] as
> ruri "sip:8706569978 at XXX.XXX.XXX.XXX"
> -----gw attr is <null>
>
>
> Thanks,
>
> -jim
>   




More information about the Users mailing list