<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>Hi Samuel,<br>
<br>
It is not clear from your script snapshots where you are supposed
to set the bflags 11 and 28.<br>
<br>
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.<br>
<br>
Regards,<br>
</tt>
<pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
<br>
On 12/05/2012 06:08 PM, Samuel Muller wrote:
<blockquote
cite="mid:CAEhWu_b8Y-+F5mDOf8OXvmO=1JQHE2Dy7wzBiwiWsDgvyUX8Bg@mail.gmail.com"
type="cite">Hello,<br>
<br>
I'm looking for explanations about parallel forking and branch
flags.<br>
I'm deeply annoyed by this feature ...<br>
<br>
I need to set up different parameters (like rtpproxy, from
display, accounting, ...) per contact.<br>
<br>
actually, I retrieve a list of contact using an AVP, in the format
that the core function "while" can use.<br>
<br>
It's working fine when there are no manipulation or no (new)
callee parameters to add :<br>
<br>
route[FORK] {<br>
xlog("L_NOTICE","parallel fork requested");<br>
$var(i) = 0;<br>
while ($var(i) < $(avp(callee_fork){param.count})) {<br>
$avp(callee_uri) =
$(avp(callee_fork){param.valueat,$var(i)});<br>
$ru = $avp(callee_uri);<br>
$avp(callee_username) = $rU;<br>
$avp(callee_realm) = $rd;<br>
setbflag(27);<br>
lookup("location","mb");<br>
setflag(9);<br>
$branch = $ru;<br>
append_branch();<br>
$var(i) = $var(i) + 1;<br>
}<br>
route(RTPPROXY); # rtp proxy set = bflag 11<br>
route(ACCOUNTING); # accounting using $rU. $ru, ...<br>
route(RELAY);<br>
exit;<br>
}<br>
route[RELAY] {<br>
t_on_branch("1");<br>
t_on_reply("1");<br>
t_on_failure("1");<br>
t_relay("0x01");<br>
exit;<br>
}<br>
<br>
At this point, I'm totally lost :<br>
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.<br>
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.<br>
<br>
branch_route[1] {<br>
xlog("L_NOTICE","br1: engage branch $T_branch_idx with R-URI:
$T_ruri ($ru)");<br>
xlog("L_NOTICE","br1: dest set: $ds / dest uri: $du");<br>
if (isbflagset(11)) {<br>
xlog("L_NOTICE","br1: rtp proxy set to \"cr\"");<br>
engage_rtp_proxy("cr");<br>
}<br>
if (isbflagset(28)) {<br>
uac_replace_from("$avp(caller_cli)","");<br>
}<br>
}<br>
}<br>
<br>
did I missed something ???<br>
<br>
Thanks to light my fire, I really need it ...<br>
<br>
.Sam.<br>
<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
</body>
</html>