Hi, Thank you for your reponse. By using $hdr(HEADER-NAME), it returns "Private-Header:value". Now I have other problems. I would like to check if the header exist, then I want to get the value. How do I get the value from $hdr(HEADER-NAME) ?
Thanks.
Jeon
El Miércoles, 24 de Septiembre de 2008, Yoo Chan Jeon escribió:
- Hi,
*>* I have a client sip agent which sends a SUBSCRIBE msg with a private header *>* to the Kamailio presence server. *>* Hwo do I get the private header informtaion? I want to read it and send it *>* with a Notify message. * Read it with $hdr(HEADER-NAME).
El Jueves, 25 de Septiembre de 2008, Yoo Chan Jeon escribió:
Hi, Thank you for your reponse. By using $hdr(HEADER-NAME), it returns "Private-Header:value". Now I have other problems. I would like to check if the header exist, then I want to get the value. How do I get the value from $hdr(HEADER-NAME) ?
Well, let me explain:
Imagine the request contains a header like: Private-Header-1: aaabbbccc but not a header "Private-Header-2".
So if you do:
if $hdr(Private-Header-1) { # block }
it will return TRUE and the block executed.
If you want to read the header value you do it in the same way:
xlog("L_INFO","---private header 1 value = $hdr(Private-Header-1) ---\n");
If you want to check if Private-Header-2 then:
if $hdr(Private-Header-2) { # block }
This "if" return FALSE and the block is not runned since the header doesn't exist.
Hope it clarifies you a bit.