[OpenSIPS-Users] Branch Flags
Răzvan Crainea
razvan at opensips.org
Tue Oct 29 11:24:52 EDT 2019
Hi, Ben!
Unfortunately the `setbflag` function only accepts static indexes,
that's why it doesn't work no matter how you try.
Perhaps the only scenario where a static branch is useful is when you
"manually" add branches in your script (using append_branch), and you
know exactly the order those branches were added, and how to index them.
I believe I ran into this issue a while ago, and I was able to solve it
by using an AVP, and indexing it using the branch index. I know it's not
the best way to do it, but it worked for me back then :)
Best regards,
Răzvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com
On 10/29/19 3:20 PM, Ben Newlin wrote:
> Hey all,
>
> I am trying to use the branch flags functionality described here [1]. I
> am running into an issue when using the syntax with the branch_idx. The
> documentation does not provide any examples for this form.
>
> Basically, from my testing in 2.4.6 it appears that the branch_idx can
> only be a static number. I have tried numerous forms to try to get a
> variable to be accepted but all result in syntax errors. Is this
> expected? If so, is anyone successfully using this functionality? I am
> having trouble thinking of a scenario where the flags could be useful if
> the branch numbers must be hard-coded in the script.
>
> Works:
>
> setbflag(1, FLAG)
>
> Syntax Error:
>
> setbflag($T_branch_idx, FLAG)
>
> setbflag(“$T_branch_idx”, FLAG)
>
> setbflag($T_branch_idx, “FLAG”)
>
> setbflag(“$T_branch_idx”, “FLAG”)
>
> [1] - https://www.opensips.org/Documentation/Script-Flags-2-4#toc4
>
> Ben Newlin
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
More information about the Users
mailing list