Maxim Malygin <maxim.malygin@gmail.com>

17:08 (5 минут назад)
кому: sr-users
Hello,

I need to form list of Contact headers with "q" parameters for "302 Moved Temporary".

I do something like this:

...
# $xavp(contacts) - contains list of contact URIs (uri) and Q values (q)
$var(i) = 0;
$var(num) = $cnt($xavp(contacts));
while($var(i) < $var(num)) {
    if($var(i) == 0) {
        # How to add q value to this branch?
        $ru = $xavp(contacts[$var(i)]=>uri);
    } else {
        append_branch("$xavp(contacts[$var(i)]=>uri)", "$xavp(contacts[$var(i)]=>q)");
    }
}
send_reply("302", "Moved Temporarily");
...

Is it possible to set "q" value for the main branch?
For additional branches I do it via append_branch("uri", q_value) but I didn't find any way to do it for the main branch pointed via $ru/$du. The pseudo-variable "$branch" also doesn't allow me to access the main branch.

Thanks,
Maxim