[OpenSIPS-Users] Problem with {s.int] transformation

Bogdan-Andrei Iancu bogdan at opensips.org
Thu Mar 27 09:25:31 CET 2014


Hello,

The nameaddr.name transformation will return the "77777" string along 
the quotes. The s.int is to transform a number from string 
representation to integer - so it is a missusage of this transformation 
here. You just want to get rid of the quotes, right ?

You could do something simple like:

$avp(name) = $(hdr(P-Asserted-Identity){nameaddr.name})
# if string starts with '"", get rid of the first and last char from the 
string.
if ( $(avp(name){s,substr,0,1})=='"' )
$avp(name) := $(avp(name){s.substr,1,-1});

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

On 25.03.2014 15:15, Alexander Mustafin wrote:
> Hello.
>
> I’ve got the header in message:  P-Asserted-Identity: «777777" 
> <sip:777777 at 5.5.5.5>
>
> And I need to parse «name» part for future used, but without quotes.
>
> I’m trying:
>
> $avp(name) = $(hdr(P-Asserted-Identity){nameaddr.name}{s.int});
>
> but $avp(name) is null after this transformation.
>
> How to delete quotes from this field?
>
>
> Best regards,
> Alexander Mustafin
> mustafin.aleksandr at gmail.com <mailto:mustafin.aleksandr at gmail.com>
>
>
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20140327/54f4f8cb/attachment.htm>


More information about the Users mailing list