On 05.08.2009 12:00 Uhr, Alex Balashov wrote:
Daniel-Constantin Mierla wrote:
IIRC, the mi command takes a bitmask as value
while the config
function takes the index in bitmask. So, if you want to test flag 2:
if(is_gflag("2"))
kamctl fifo set_gflag 4
4 = 2^2
For flag ten you have to set it via mi to 2^10 which is 1024.
Try and see if works.
This seems inconsistent and needlessly complicated and does not follow
from the documentation at all. I would recommend changing the
set_gflag MI function to take the bit offset as an argument rather
than the bitmask if is_gflag() checks the offset.
I kind of agree. Maybe the best
is to add new mi commands:
set_gflag_ny_bitmask - which actually replicates the current command
set_gflag_by_index - which sets a bit at a position
keep the old for compatibility, or remove if people agree.
Cheers,
Daniel
--
Daniel-Constantin Mierla
* SIP Router Bootcamp
* Kamailio (OpenSER) and Asterisk Training
* Berlin, Germany, Sep 1-4, 2009
*
http://www.asipto.com/index.php/sip-router-bootcamp/