[OpenSIPS-Users] Two questions

Bogdan-Andrei Iancu bogdan at voice-system.ro
Mon Oct 25 12:08:04 CEST 2010

Hello Jayesh,

Jayesh Nambiar wrote:
> Hello All,
> I got only two questions:
> 1) Is there a way to remove multiple headers by matching a pattern in 
> an incoming INVITE message?
>      For eg: remove_hf("X-*") #---This removes any header starting X-. 
> Is there a way to achieve this?
unfortunately the header manipulation functions do not use regexps as 
parameters.  So, solutions, both requiring some devel are:
    1) add support for regexp in remove_hf
    2) add a new type of var to get the hdr name by index - like return 
the name of the second, third, etc header -> you can can cycle and 
remove the ones you want.
> 2) Why does AVP does not support storing float values in it? I had a 
> requirement where I need to fetch values from DB which is of datatype 
> decimal and do some comparisons. I could have fetched it using the 
> cast function and converting it to char in the mysql but I need to use 
> the value to do some comparison in the script.
> Is there a reason why AVPs does not support it?
AVPs were historically built for strings and integers as float numbers 
are not so used in SIP and opensips..

A small trick you can do is to convert the float to integer when 
loading....like "select my_float_column*1000 from table where ....."  
Just an idea....

> Your inputs are highly appreciated.
> Thanks in advance,
> --- Jayesh
> ------------------------------------------------------------------------
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Bogdan-Andrei Iancu
OpenSIPS Bootcamp
15 - 19 November 2010, Edison, New Jersey, USA

More information about the Users mailing list