Hello,
I'm running into what I believe a weird situation when comparing <null> 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_NOTICE", "[end] removed user location\n"); } else { xlog("L_NOTICE", "[end] saved user location\n"); }
I registered with 3 devices, one sends expires as header, another as contact param, and the last uses both header AND contact param.
My surprise was this:
1- Both header and contact param:
Sep 12 19:37:48 csbc01 csbc[8036]: NOTICE: {1 4 REGISTER 02c3ea6ee623916d37532188031017c9@0:0:0:0:0:0:0:0} <script>: DEBUG: sel(contact.expires)=600 - hdr(Expires)=600 Sep 12 19:37:48 csbc01 csbc[8036]: NOTICE: {1 4 REGISTER 02c3ea6ee623916d37532188031017c9@0:0:0:0:0:0:0:0} <script>: [end] saved user location
2- Only contact param:
Sep 12 19:36:15 csbc01 csbc[8035]: NOTICE: {1 40629 REGISTER f2cbaa53-eabfd633@84.121.150.224} <script>: DEBUG: sel(contact.expires)=600 - hdr(Expires)=<null> Sep 12 19:36:15 csbc01 csbc[8035]: NOTICE: {1 40629 REGISTER f2cbaa53-eabfd633@84.121.150.224} <script>: [end] removed user location
2- Only header:
Sep 12 19:29:33 csbc01 csbc[8033]: NOTICE: {1 402 REGISTER 2_1804628355@192.168.30.31} <script>: DEBUG: sel(contact.expires)=<null> - hdr(Expires)=3600 Sep 12 19:29:33 csbc01 csbc[8033]: NOTICE: {1 402 REGISTER 2_1804628355@192.168.30.31} <script>: [end] removed user location
I can workaround the header by using is_present_hf() before comparing, I can also probably parse the $ct to see if it has some Expires in it, but I really want to know if my understanding is incorrect and I'm doing something wrong or if this is a bug?
Thanks! Joel.