[SR-Users] Get value from header and check value type

Karsten Horsmann khorsmann at gmail.com
Fri Oct 18 19:57:05 CEST 2019


Hi List,

I use Kamailio 5.2.x and I want to fetch an value from an X Header and do
some checks like "is not empty" and "should be an integer".

AFAIK per default all values are strings with the hdr function.

What are the best way for some validations within Kamailio script language?


if(is_present_hf("X-someheader")) {
                        $avp(routing_target) = $(hdr(X-someheader){s.int});

 if(!ds_list_exists("$avp(routing_target)"))
Cheers
Karsten Horsmann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20191018/2113c1e1/attachment.html>


More information about the sr-users mailing list