[OpenSIPS-Users] Branch Flags

Răzvan Crainea razvan at opensips.org
Tue Oct 29 11:49:38 EDT 2019


Yes, the entire core functions interface has been reworked in 3.1, so 
this should have been solved now.

Best regards,

Răzvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com

On 10/29/19 5:32 PM, Ben Newlin wrote:
> Razvan,
> 
> Thanks for the quick response. I'm testing a workaround using the $bavp variable type exported by the TM module.
> 
> I think there was some work planned in 3.x to make the acceptance of variables more uniform in the scripting language. Do you think this could have been resolved already by that effort? If not, do you think it might be a reasonable feature request?
> 
> Ben Newlin
> 
> On 10/29/19, 11:24 AM, "Users on behalf of Răzvan Crainea" <users-bounces at lists.opensips.org on behalf of razvan at opensips.org> wrote:
> 
>      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
>      >
>      
>      _______________________________________________
>      Users mailing list
>      Users at lists.opensips.org
>      http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>      
>      
> 
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> 



More information about the Users mailing list