[SR-Users] How to check a bit (1/0) of a pseudo-variable?

Iñaki Baz Castillo ibc at aliax.net
Thu Jun 16 13:15:39 CEST 2011


2011/6/16 Iñaki Baz Castillo <ibc at aliax.net>:
> I've found isavpflagset() right now:
>
>  http://sip-router.org/wiki/cookbooks/core-cookbook/devel#isavpflagset
>
> But it has no description. How is it supposed to work?

The Changelog file says:

-----------------------------------
          Every AVP may by flaged from script via setavpflag(avpid, flag)
          (it's similar like message flags setflags,resetflags,isflagset).
          AVP flags must be declared using avpflags statement. Flags may be
          tested via isavpflagset(avpid, flag). Both the setting and
          testing may also be processed in a module. It's currently used in
          the "rr" module for dialog_cookies. Such module should register
          flag using register_avpflag(flag_id).

          Example: avpflags myflag, dialog_cookie;

          $a = 123; setavpflag($a, "myflag");

          if (isavpflagset($a, "myflag")) { ....

          $dlg_foo = "foo"; $dlg_bar = "bar"; setavpflag("$f./^dlg_",
          "dialog_cookie");
----------------------------------------------

But is says that I must use setavpflag() to set flags in the AVP. In
my case, I retrieve the AVP value from a database (an integer field).
Could it work?


-- 
Iñaki Baz Castillo
<ibc at aliax.net>



More information about the sr-users mailing list