[OpenSIPS-Users] Problem with dynamic routing

Bogdan-Andrei Iancu bogdan at voice-system.ro
Wed Jan 21 14:58:10 CET 2009


Hi Matteo ,

The route called by DR is not intended to to relay - this route is to be 
used only to do custom changes on the message .

So, do not do the t_relay() in the route triggered by DR - do it after 
the the do_routing() function.

Regards,
Bogdan

mmarzuola at interfree.it wrote:
> Hi.
> If in the table dr_rules I set the route ID to 0 and in the main route of the script I explicitly put the route 2:
>
> if (is_method("INVITE")) {
>                 xlog("L_INFO", "Method is an INVITE\n");
>                 #setflag(4);
>                 setflag(1); # do accounting
>                 if($rU=~"3.*") {
>                         xlog("L_INFO", "Call to PSTN\n");
>                         do_routing();
>                         route(2);
>                 }
>         }
>
> route[2] {
>         t_on_failure("2");
>
>         if (!t_relay()) {
>                 sl_reply_error();
>         };
>         exit;
> }
>
> failure_route[2] {
>         xlog("L_INFO","failure\n");
>         if (next_routing()) {
>                 append_branch();
>                 t_relay();
>                 exit;
>         }
> }
>
> the dynamic routing seems to work well and the destinations gateways are tried in the given order.
>
> Indeed, if I set the route ID of the dr_rules to 2, and change the script in this way:
>
> if (is_method("INVITE")) {
>                 xlog("L_INFO", "Method is an INVITE\n");
>                 #setflag(4);
>                 setflag(1); # do accounting
>                 if($rU=~"3.*") {
>                         xlog("L_INFO", "Call to PSTN\n");
>                         do_routing();
>                 }
>         }
>
> route[2] {
>         t_on_failure("2");
>
>         if (!t_relay()) {
>                 sl_reply_error();
>         };
>         exit;
> }
>
> failure_route[2] {
>         xlog("L_INFO","failure\n");
>         if (next_routing()) {
>                 append_branch();
>                 t_relay();
>                 exit;
>         }
> }
>
> I get the 500 error from the opensips.
> Why this happens?
> Do I have to change something in the script?
>
> Thanks in advance.
>
> Marzuola Matteo
>
>
> ----------------------------------------------------------------------------
> Vuoi essere presente online? 
> Vuoi dare voce alla tua attivita`? 
> Acquista un dominio su domini.interfree.it.
> A partire da 18,59 euro
> ----------------------------------------------------------------------------
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>   




More information about the Users mailing list