[OpenSIPS-Users] Parallel forking and per branch AVPs explanations

Bogdan-Andrei Iancu bogdan at opensips.org
Thu Dec 6 18:40:25 CET 2012


Hi Samuel,

It is not clear from your script snapshots where you are supposed to set 
the bflags 11 and 28.

The idea is that you create all the additional branches (as normally you 
have the RURI - mandatory - plus some optional additional branches) in 
that "while" loop. In the request route you are doing changes only over 
the RURI (and not over the additional branches). Accessing the already 
created branches can be done via the $branch[] variables only.

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com


On 12/05/2012 06:08 PM, Samuel Muller wrote:
> Hello,
>
> I'm looking for explanations about parallel forking and branch flags.
> I'm deeply annoyed by this feature ...
>
> I need to set up different parameters (like rtpproxy, from display, 
> accounting, ...) per contact.
>
> actually, I retrieve a list of contact using an AVP, in the format 
> that the core function "while" can use.
>
> It's working fine when there are no manipulation or no (new) callee 
> parameters to add :
>
> route[FORK] {
>     xlog("L_NOTICE","parallel fork requested");
>     $var(i) = 0;
>     while ($var(i) < $(avp(callee_fork){param.count})) {
>             $avp(callee_uri) = $(avp(callee_fork){param.valueat,$var(i)});
>             $ru = $avp(callee_uri);
>             $avp(callee_username) = $rU;
>             $avp(callee_realm) = $rd;
>             setbflag(27);
>             lookup("location","mb");
>             setflag(9);
>             $branch = $ru;
>             append_branch();
>             $var(i) = $var(i) + 1;
>     }
>     route(RTPPROXY);   # rtp proxy set = bflag 11
>     route(ACCOUNTING); # accounting using $rU. $ru, ...
>     route(RELAY);
>     exit;
> }
> route[RELAY] {
>     t_on_branch("1");
>     t_on_reply("1");
>     t_on_failure("1");
>     t_relay("0x01");
>     exit;
> }
>
> At this point, I'm totally lost :
> I have to check if a callee need to use rtpproxy, set up the 
> accounting, change the "from" display based on the destination (PSTN 
> vs. local subscriber), and so on.
> Everything failed, the parameters are always global (based on the 
> branch("0")) even if I use branch flag, script flag, or do anything 
> into the branch route.
>
> branch_route[1] {
>     xlog("L_NOTICE","br1: engage branch $T_branch_idx with R-URI: 
> $T_ruri ($ru)");
>     xlog("L_NOTICE","br1: dest set: $ds / dest uri: $du");
>     if (isbflagset(11)) {
>         xlog("L_NOTICE","br1: rtp proxy set to \"cr\"");
>         engage_rtp_proxy("cr");
>     }
>     if (isbflagset(28)) {
>             uac_replace_from("$avp(caller_cli)","");
>         }
>     }
> }
>
> did I missed something ???
>
> Thanks to light my fire, I really need it ...
>
> .Sam.
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20121206/3fb32cb6/attachment.html>


More information about the Users mailing list