<div dir="ltr">Hi,<div>I am trying to extract out the expires value from the incoming REGISTER request. It might be present in the Contact header or as a separate Expires header and hence I planned to use the $expires(max) PV to get this. But kamailio just crashes as soon as I use the variable. Here's when it crashes:</div><div><br></div><div>if(is_method("REGISTER")) {</div><div>     xlog("L_INFO", "Expires is $expires(max)");</div><div>     if(!save("location", "0x01")) {</div><div><span class="Apple-tab-span" style="white-space:pre">    </span>t_reply("500", "Error while saving AOR");</div><div>     }</div><div>}</div><div><br></div><div>It crashes at the xlog point. Here's the backtrace for reference:</div><div><div>Reading symbols from /usr/local/kamailio/sbin/kamailio...done.</div><div>[New LWP 16609]</div><div>[Thread debugging using libthread_db enabled]</div><div>Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".</div><div>Core was generated by `/usr/local/kamailio/sbin/kamailio -P /var/run/kamailio.pid -f /usr/local/kamail'.</div><div>Program terminated with signal SIGSEGV, Segmentation fault.</div><div>#0  0x00007f34b658b311 in pv_get_expires (msg=0x7f34bd879e58, param=0x7f34bd7e9220, res=0x7ffcf67af530) at pv_core.c:3060</div><div>3060<span class="Apple-tab-span" style="white-space:pre">                                            </span>if(c->expires && c->expires->body.len) {</div><div>(gdb) backtrace</div><div>#0  0x00007f34b658b311 in pv_get_expires (msg=0x7f34bd879e58, param=0x7f34bd7e9220, res=0x7ffcf67af530) at pv_core.c:3060</div><div>#1  0x00000000004fb6e1 in pv_get_spec_value (msg=0x7f34bd879e58, sp=0x7f34bd7e9208, value=0x7ffcf67af530) at pvapi.c:1304</div><div>#2  0x00000000004fbb46 in pv_printf (msg=0x7f34bd879e58, list=0x7f34bd80ef38, buf=0x7f34bd8735a0 "Expires is ", len=0x7ffcf67af618) at pvapi.c:1363</div><div>#3  0x00007f34b67ea745 in xl_print_log (msg=0x7f34bd879e58, list=0x7f34bd80ef38, buf=0x7f34bd8735a0 "Expires is ", len=0x7ffcf67af618) at xl_lib.c:37</div><div>#4  0x00007f34b67eb0f9 in xlog_helper (msg=0x7f34bd879e58, xm=0x7f34bd808648, level=2, line=0, facility=-1) at xlog.c:215</div><div>#5  0x00007f34b67ec160 in xlog_2_helper (msg=0x7f34bd879e58, lev=0x7f34bd7e9130 "", frm=0x7f34bd808648 "84\177", mode=0, facility=-1) at xlog.c:284</div><div>#6  0x00007f34b67ec19c in xlog_2 (msg=0x7f34bd879e58, lev=0x7f34bd7e9130 "", frm=0x7f34bd808648 "84\177") at xlog.c:292</div><div>#7  0x000000000041e23b in do_action (h=0x7ffcf67b0b40, a=0x7f34bd817cd0, msg=0x7f34bd879e58) at action.c:1065</div><div>#8  0x000000000042a8e7 in run_actions (h=0x7ffcf67b0b40, a=0x7f34bd813e18, msg=0x7f34bd879e58) at action.c:1548</div><div>#9  0x000000000041ab16 in do_action (h=0x7ffcf67b0b40, a=0x7f34bd7e8738, msg=0x7f34bd879e58) at action.c:677</div><div>#10 0x000000000042a8e7 in run_actions (h=0x7ffcf67b0b40, a=0x7f34bd7e8738, msg=0x7f34bd879e58) at action.c:1548</div><div>#11 0x000000000041e094 in do_action (h=0x7ffcf67b0b40, a=0x7f34bd7e89c8, msg=0x7f34bd879e58) at action.c:1044</div><div>#12 0x000000000042a8e7 in run_actions (h=0x7ffcf67b0b40, a=0x7f34bd7e19d8, msg=0x7f34bd879e58) at action.c:1548</div><div>#13 0x000000000042b04d in run_top_route (a=0x7f34bd7e19d8, msg=0x7f34bd879e58, c=0x0) at action.c:1634</div><div>#14 0x000000000050f3d4 in receive_msg (</div><div>    buf=0xa80c00 <buf> "REGISTER sip:<a href="http://devsip.tlkn.com">devsip.tlkn.com</a> SIP/2.0\r\nVia: SIP/2.0/UDP 203.153.53.145:8300;branch=z9hG4bK119a.e23ed10b856f38b41c93d1d259d8869f.0;i=b1\r\nVia: SIP/2.0/TCP 172.16.16.32:52358;rport=52359;received=203.153."..., len=712, rcv_info=0x7ffcf67b0e60) at receive.c:196</div><div>#15 0x0000000000613b9e in udp_rcv_loop () at udp_server.c:495</div><div>#16 0x00000000004aa119 in main_loop () at main.c:1577</div><div>#17 0x00000000004b0e1e in main (argc=5, argv=0x7ffcf67b1318) at main.c:2553</div></div><div><br></div><div>Thanks,</div><div><br></div><div>- Jayesh</div></div>