Hi,
Am trying to extract a custom parameter from the contact header. Below it the example of contact header,
Eg: Contact: sip:fayazat@XXX.XXX.XXX.XXX:5060;tgrp=tg_0615_prsw1 I want to extract the parameter value of "tgrp"
Tried using @hf_value.contact.p.tgrp . But it is giving me complete contact header. I want only "tgrp" paramter value "tg_0615_prsw1". Anyone , any sugeestions?
Thanks, Vivek.
vivek@advaitamtech.com writes:
Tried using @hf_value.contact.p.tgrp . But it is giving me complete contact header. I want only "tgrp" paramter value "tg_0615_prsw1". Anyone , any sugeestions?
Try {uri.param,name} transformation.
-- Juha
I used " $(ct{param.value,tgrp});". It worked. Thanks for the input.
- Vivek.
-----Original Message----- From: "Juha Heinanen" jh@tutpro.com Sent: Monday, 1 May, 2017 6:15pm To: "Kamailio (SER) - Users Mailing List" sr-users@lists.kamailio.org Subject: [SR-Users] Retrieving the custom header parameter value from contact header
vivek@advaitamtech.com writes:
Tried using @hf_value.contact.p.tgrp . But it is giving me complete contact header. I want only "tgrp" paramter value "tg_0615_prsw1". Anyone , any sugeestions?
Try {uri.param,name} transformation.
-- Juha
_______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hello,
be careful with using param transformation directly not to have a conflict of parameter name between URI parameters and header parameters.
It may be safer to chain the tobody and param transformations to be sure you access the right part of the header.
Cheers, Daniel
On 02.05.17 09:02, vivek@advaitamtech.com wrote:
I used " $(ct{param.value,tgrp});". It worked. Thanks for the input.
- Vivek.
-----Original Message----- From: "Juha Heinanen" jh@tutpro.com Sent: Monday, 1 May, 2017 6:15pm To: "Kamailio (SER) - Users Mailing List" sr-users@lists.kamailio.org Subject: [SR-Users] Retrieving the custom header parameter value from contact header
vivek@advaitamtech.com writes:
Tried using @hf_value.contact.p.tgrp . But it is giving me complete contact header. I want only "tgrp" paramter value "tg_0615_prsw1". Anyone , any sugeestions?
Try {uri.param,name} transformation.
-- Juha
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users