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>