is there a means to test method of sip request against a pseudo variable, which would contain an integer bitmap of methods corresponding to enum request_method values?
-- juha
On 12/16/10 12:55 PM, Juha Heinanen wrote:
is there a means to test method of sip request against a pseudo variable, which would contain an integer bitmap of methods corresponding to enum request_method values?
I remember some similar topic in the past, so for easiness, I just committed a new PV $rmid that returns the integer id of request method type.
For released 3.x, try to see if next piece of cfg works:
$var(m) = 0 + $rm;
if($var(m) & $var(yourmethodbitmask)) { ... }
$rm stores internally the integer id, but its definition sets its type to string which returns the string representation.
Cheers, Daniel
Daniel-Constantin Mierla writes:
For released 3.x, try to see if next piece of cfg works:
$var(m) = 0 + $rm;
daniel,
the above assignment works, but i need to make a shift before actual test and that does not work:
$var(m) = 0 + $rm; $var(m) = $var(m) >> 16;
produces error regarding the second line:
0(17007) : <core> [cfg.y:3437]: parse error in config file /etc/trunk-proxy/trunk-proxy.cfg, line 871, column 24: syntax error 0(17007) : <core> [cfg.y:3437]: parse error in config file /etc/trunk-proxy/trunk-proxy.cfg, line 871, column 24: bad expression
any idea why, because according to core cookbook, operator >> does exist? column 24 refers to second of the >> chars.
http://sip-router.org/wiki/cookbooks/core-cookbook/devel#arithmetic_operatio...
-- juha
Hello,
On 12/16/10 5:53 PM, Juha Heinanen wrote:
Daniel-Constantin Mierla writes:
For released 3.x, try to see if next piece of cfg works:
$var(m) = 0 + $rm;
daniel,
the above assignment works, but i need to make a shift before actual test and that does not work:
$var(m) = 0 + $rm; $var(m) = $var(m)>> 16;
produces error regarding the second line:
0(17007) :<core> [cfg.y:3437]: parse error in config file /etc/trunk-proxy/trunk-proxy.cfg, line 871, column 24: syntax error 0(17007) :<core> [cfg.y:3437]: parse error in config file /etc/trunk-proxy/trunk-proxy.cfg, line 871, column 24: bad expression
any idea why, because according to core cookbook, operator>> does exist? column 24 refers to second of the>> chars.
http://sip-router.org/wiki/cookbooks/core-cookbook/devel#arithmetic_operatio...
seems they were lost in integration process - they were indeed in kamailio 1.x. I will take care of re-adding them, meanwhile you can multiply/divide by the power of two to emulate left/right bitwise shifts.
Cheers, Daniel
daniel,
$rm seems to work fine and when testing it i was able to produce acc related uri parsing crash that i reported in another message.
thanks,
-- juha