Hello,

you can use:

if(is_present_hf("aaa")) ...

Also, it should work like:

if($hdr("aaa") != $null) ...

The is_present_hf() should be slightly faster as it just walks through the list of headers, not parsing the header body and not returning its value.

Cheers,
Daniel

On 26/06/14 06:35, Allen Zhang wrote:

Hi,

 

If I normally receive a INVITE that has a header ‘aaa’ with value ‘bbb’, but it’s possible that some INVITEs don’t have this header.

How do I determine in the config file if the header exists?

To check the value of the header I do if($hdr(aaa) == "bbb"). But what if the header doesn’t exist?

 

Cheer,

Allen

 

 



_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda