Hi,
The quotes in the example are there because of the string format :).
Anyhow, using the s.select may be a bit dangerous (versus simply
stripping out the first and last char) as " char may be present (quoted)
inside a display name -> it will generate a false match for you.
Regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 27.03.2014 14:21, Alexander Mustafin wrote:
Tnanks, Bogdan.
I was confused by explanation in official document about transformations:
1.2 {s.int}
Return integer value of a string-represented number
$var(x) = "1234";
if($(var(x){s.int})==1234) {
...
}
I solved this problem this way: {s.select,1,"}
Best regards,
Alexander Mustafin
[email protected] <mailto:[email protected]>
27 марта 2014 г., в 14:25, Bogdan-Andrei Iancu <[email protected]
<mailto:[email protected]>> написал(а):
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:[email protected]>
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
[email protected] <mailto:[email protected]>
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users