rr module has check_route_param(re) function that can be used to check if local route header has a param that matches re. however, there does not exist a function to find out what is the value of a given rr param. for example, if route header has param ;param=foo, how to extract value foo of param?
there is @rr.uri.params select that together with {param.value,name} transformation might be able to do the job?
-- juha
Hello,
On 10/03/14 06:18, Juha Heinanen wrote:
rr module has check_route_param(re) function that can be used to check if local route header has a param that matches re. however, there does not exist a function to find out what is the value of a given rr param. for example, if route header has param ;param=foo, how to extract value foo of param?
there is @rr.uri.params select that together with {param.value,name} transformation might be able to do the job?
this should work, provided you use $sel(rr.uri) -- iirc, transformations cannot be applied directly to @xyz
The alternative is to use the tobody transformation to get the parts of the route header, then param transformation.
Cheers, Daniel
On 10.03.2014 06:18, Juha Heinanen wrote:
rr module has check_route_param(re) function that can be used to check if local route header has a param that matches re. however, there does not exist a function to find out what is the value of a given rr param. for example, if route header has param ;param=foo, how to extract value foo of param?
there is @rr.uri.params select that together with {param.value,name} transformation might be able to do the job?
I do it this way:
$var(param) = @msg.header.Route[1].nameaddr.uri.params["param"];
--> $var(param) == "foo"
regards Klaus