Hi all,
Just a sanity check, really. Does Kamailio consider negative response codes to be false? For example, should the following log execute?
if (!foo()) { # Returns -2
x_log(“Foo is false”);
}
The reason for asking here is that I’m implementing flood protection using pike, based off the kamailio.cfg that ships with v4.3. The logic is thus:
if (!pike_check_req()) {
# Do blocking
}
However pike_check_req only returns -1 or -2 in the case of failure, never 0. The blocking code is, thus, never executed. Changing to explicitly check for != 1 works correctly.
Am I missing something here or is the example kamailio.cfg incorrect?
Cheers