Hi,
I'm running Kamailio 5.3.5
I have following header "X-myheader: 0"
Nevertheless it seems this is not working for me:
if ($hdr(X-myheader)==0) { ..... };
What I'm doing wrong?
Jurijs
Hi,
This seems to work for me:
if ($(hdr(X-myheader){s.trim})==0) { ...... };
Seems in the body I got "0 " and maybe because of this automatic string to int conversion didn't work.
Jurijs
On Thu, Mar 11, 2021 at 1:33 PM Jurijs Ivolga jurijs.ivolga@gmail.com wrote:
Hi,
I'm running Kamailio 5.3.5
I have following header "X-myheader: 0"
Nevertheless it seems this is not working for me:
if ($hdr(X-myheader)==0) { ..... };
What I'm doing wrong?
Jurijs
You should also add {s.int} if you want to compare with an integer value -- there is some auto-conversion, but it is better to be explicit.
Cheers, Daniel
On 11.03.21 12:53, Jurijs Ivolga wrote:
Hi,
This seems to work for me:
if ($(hdr(X-myheader){s.trim})==0) { ...... };
Seems in the body I got "0 " and maybe because of this automatic string to int conversion didn't work.
Jurijs
On Thu, Mar 11, 2021 at 1:33 PM Jurijs Ivolga <jurijs.ivolga@gmail.com mailto:jurijs.ivolga@gmail.com> wrote:
Hi, I'm running Kamailio 5.3.5 I have following header "X-myheader: 0" Nevertheless it seems this is not working for me: if ($hdr(X-myheader)==0) { ..... }; What I'm doing wrong? Jurijs
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hi Daniel,
Thank you, good tip.
Jurijs
On Thu, Mar 11, 2021 at 2:54 PM Daniel-Constantin Mierla miconda@gmail.com wrote:
You should also add {s.int} if you want to compare with an integer value -- there is some auto-conversion, but it is better to be explicit.
Cheers, Daniel On 11.03.21 12:53, Jurijs Ivolga wrote:
Hi,
This seems to work for me:
if ($(hdr(X-myheader){s.trim})==0) { ...... };
Seems in the body I got "0 " and maybe because of this automatic string to int conversion didn't work.
Jurijs
On Thu, Mar 11, 2021 at 1:33 PM Jurijs Ivolga jurijs.ivolga@gmail.com wrote:
Hi,
I'm running Kamailio 5.3.5
I have following header "X-myheader: 0"
Nevertheless it seems this is not working for me:
if ($hdr(X-myheader)==0) { ..... };
What I'm doing wrong?
Jurijs
Kamailio (SER) - Users Mailing Listsr-users@lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda Funding: https://www.paypal.me/dcmierla
Hi,
Have you tried
if ($hdr(X-myheader)=="0")
?
Regards, Igor
On 11.03.2021 12:33, Jurijs Ivolga wrote:
Hi,
I'm running Kamailio 5.3.5
I have following header "X-myheader: 0"
Nevertheless it seems this is not working for me:
if ($hdr(X-myheader)==0) { ..... };
What I'm doing wrong?
Jurijs
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users