From Ajay.Sabat@panasonic.aero Thu Mar 14 22:16:40 2013 From: Ajay Sabat To: sr-users@lists.kamailio.org Subject: [SR-Users] search_hf returns always true Date: Thu, 14 Mar 2013 21:16:31 +0000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1051224199==" --===============1051224199== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi, I want to check whether a parameter exists in a header and I am using the sea= rch_hf() function defined in textops module. I am surprised that is always re= turning true whether the searched pattern exists or not. To be specific, I need to check if the "received" parameter exists in the top= most via header and this is how I do it. The statements inside the if block = get executed all the time irrespective of whether the received parameter exis= ts in the top most via or not. Any help what am I doing wrong here? if (search_hf("Via", "received=3D", "f")) { xdbg("received param $sel(via.received) in to= p most via header \n"); # perform necessary action } Case 1: no received parameter in via Via header in response message looks like: Via: SIP/2.0/UDP 192.168.1.5;branch=3Dz9hG4bK39bc.c1076d93.0 Via: SIP/2.0/UDP 192.168.1.3:5060;rport=3D5060;branch=3Dz9hG4bK56870034 And the corresponding debug message from Kamailio is: ./sbin/kamailio[22600]: DEBUG: