Hi, I've experienced some puzzling behavior with the is_present_hf function of the sipmsgops module, version 1.11. When checking for the presence of a custom header the function sometimes returns true and sometimes false for the same header in the same INVITE message.
Here is the relevant code (debug xlog statements added, production code is sparser): case 3: xlog("L_INFO","TRACE[$ci]:route[conditions]:condition has header existence operator(3) where header $var(field) should exist"); if (is_present_hf("$var(field)") || $hdr($var(field)) != NULL) { xlog("L_DEBUG","TRACE[$ci]:route[conditions]:we've got a $var(field) header with value $hdr($var(field))"); if (is_present_hf("$var(field)")) { xlog("L_INFO","TRACE[$ci]:route[conditions]:111111111111111111111111111111111111111111111111we've got a $var(field) header with value $hdr($var(field))"); } else { xlog("L_INFO","TRACE[$ci]:route[conditions]:111111111111111111111111111111111111111111111111header $var(field) not found"); } } else { xlog("L_DEBUG","TRACE[$ci]:route[conditions]:header $var(field) not found"); $var(conditions_failed) = $var(conditions_failed) + 1; } if (is_present_hf("$var(field)")) { xlog("L_INFO","TRACE[$ci]:route[conditions]:222222222222222222222222222222222222222222222222we've got a $var(field) header with value $hdr($var(field))"); } else { xlog("L_INFO","TRACE[$ci]:route[conditions]:222222222222222222222222222222222222222222222222header $var(field) not found"); } break; which produces the following log: Mar 13 16:40:48 sipdr400 /usr/local/sbin/opensips[22721]: TRACE[1426279248727-2aab0be445b0-c8166130-00d14...@xxx.xxx.xxx.xxx]:route[conditions]:condition has header existence operator(3) where header x-livevox-correlation-id should exist Mar 13 16:40:48 sipdr400 /usr/local/sbin/opensips[22721]: INFO:sipmsgops:parse_pvs_header: using hdr type name <x-livevox-correlation-id> Mar 13 16:40:48 sipdr400 /usr/local/sbin/opensips[22721]: TRACE[1426279248727-2aab0be445b0-c8166130-00d14...@xxx.xxx.xxx.xxx]:route[conditions]:111111111111111111111111111111111111111111111111we've got a x-livevox-correlation-id header with value xlvcorid Mar 13 16:40:48 sipdr400 /usr/local/sbin/opensips[22721]: TRACE[1426279248727-2aab0be445b0-c8166130-00d14...@xxx.xxx.xxx.xxx]:route[conditions]:222222222222222222222222222222222222222222222222header x-livevox-correlation-id not found when handling this message: From: <sip:14075551...@xxx.xxx.xxx.xxx:5060>;tag=2aaaf56b2208-0-13c4-6009-b6e9b3-2dc5137e-b6e9b3 To: <sip:+14153739...@xxx.xxx.xxx.xxx> Call-ID: 1426286197921-2aab3cfb22e0-c813f990-00d00...@xxx.xxx.xxx.xxx CSeq: 1 INVITE Via: SIP/2.0/UDP XXX.XXX.XXX.XXX:5060;rport;branch=z9hG4bK-b6e9b3-ca80e5c0-3b30eff8-2aaaf4694408 x-accountid: 2 x-appid: 24601 x-joinsid: f652ceb9f649ceb50a1d44d2507891cc x-livevox-correlation-id: xlvcorid x-sid: 6ae1bd9e681f8da0c51809a87c345c86 x-vdirect: true Max-Forwards: 69 User-Agent: VCS11.6.67950.0 Contact: <sip:14075551...@xxx.xxx.xxx.xxx:5060> Content-Type: application/sdp Content-Length: 229 v=0 o=- 1 1 IN IP4 XXX.XXX.XXX.XXX s=XXX.XXX.XXX.XXX c=IN IP4 XXX.XXX.XXX.XXX t=0 0 m=audio 12334 RTP/AVP 101 0 8 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=ptime:20 This looks like a bug to me, or am I missing something? Anyone has an idea how this behavior is possible? thanks, Eric Werkhoven dev-voip, livevox.com?
_______________________________________________ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users