Re: [SR-Users] Issue with and 0 when comparing vars

2019-09-13 Thread Daniel-Constantin Mierla
Hello, you can also convert the header value to integer using the transformation { s.int}, that's safer if you need to do other types of comparison such as > or <, because comparing string values might give the result you don't expect, Cheers, Daniel On Friday, September 13, 2019, Joel Serrano

Re: [SR-Users] Issue with and 0 when comparing vars

2019-09-12 Thread Joel Serrano
I think I found the solution to my problem: I'm comparing to 0 (number) when I should be comparing to "0" (string)? Using: ... if ($hdr(Expires)=="0" || $sel(contact.expires)=="0") { ... Is working as expected. Sorry for the noise! Joel. On Thu, Sep 12, 2019 at 5:50 PM Joel Serrano w

[SR-Users] Issue with and 0 when comparing vars

2019-09-12 Thread Joel Serrano
Hello, I'm running into what I believe a weird situation when comparing to 0. I have the following lines: xlog("L_NOTICE", "DEBUG: sel(contact.expires)=$sel(contact.expires) - hdr(Expires)=$hdr(Expires)\n"); if ($hdr(Expires)==0 || $sel(contact.expires)==0) { xlog("L