[SR-Users] redirect implementation with dispatcher

alex pappas rebel.pappas at gmail.com
Wed May 18 09:50:07 CEST 2011


Daniel hi,

I noticed that I was not using the ds_next_domain(). I was looping inside
a ds_select_domain("$avp(s:disp_dstgrp)", "4").


I changed that to:

For every gw_group:

 The first gw_group the $rd is getting fed from
ds_select_domain("$avp(s:disp_dstgrp)", "4") and all the other times is
getting fed from ds_next_domain(). In this way everything works as expected.

Thank you very match for your replay

Regards
Alex


On Mon, May 16, 2011 at 10:38 AM, Daniel-Constantin Mierla <
miconda at gmail.com> wrote:

>  Hello,
>
> can you put some xlog messages with the uri after ds_select_domain()
> execution? Do several tests to see what destination address is selected.
>
> Also, put here the content of the records for the dispatcher groups in use.
>
> Cheers,
> Daniel
>
>
> On 5/11/11 11:12 AM, alex pappas wrote:
>
> Dear all,
>
> I'm trying to create a service which when a call reach Kamailio, this call
> get's a number of gateways in round robin mode and from them I create uri
> and append_branches.
>
> The all scenario works fine except that I don't get from Dispatcher the
> round robin mode. Is is the way I ask Dispatcher and i don't get the results
> I need.
> In other scenarios Dispatcher works fine. The other thing is that I tried
> the random alg of Dispatcher and that works.
> I'm trying to understand what I'm doing wrong and why random alg works but
> round robin not.
>
> I'm attaching my code if anyone has an idea of what I'm doing wrong.
>
> Thank you
> Alex
>
> *Scenario description:*
> *
> Call enter
>                     --> Dialplan (Here if has a match get the attributes
> which is a list of dispatcher gw group in the form of 100.101.#)
>
>                                --> Dispatcher (For every dispatcher gw
> group appnd the branch)
>
>                                             --> Redirect the call*
>
>
> route[TEST]
> {
>
>   if(dp_translate("$avp(s:lcr_id)", "$rU/$rU"))
>         {
>             $var(i) = 0;
>             while($(var(dpattrs){s.select,$var(i),.})!="#") *#attr example
> is gw group of disptcher in order 100.101.# or in my scenario is 200.# which
> in Dispatcher is 2 gw* *10.0.0.2 and 10.0.0.3*
>             {
>                 $avp(s:disp_dstgrp) = $(var(dpattrs){s.select,$var(i),.}{
> s.int});
>                 if(ds_select_domain("$avp(s:disp_dstgrp)", "4"))
>                 {
>
>                 append_branch();
>                 revert_uri();
>                 $avp(s:disp_dstgrp) = "null";
>                 }
>                 $var(i) = $var(i) + 1; # for the while loop
>            }
>                         ####################### REDIRECTION
> #####################
>                         sl_send_reply("300", "Multiple Choice");
>
> #########################################################
>                         exit;
>         } else {
>                 xlog(" ----- No routing found for this call -----");
>         }
> }
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing listsr-users at lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
> --
> Daniel-Constantin Mierlahttp://www.asipto.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20110518/e73a73db/attachment.htm>


More information about the sr-users mailing list