Re: [SR-Users] transformations {s.rm,match}

2015-12-11 Thread Daniel-Constantin Mierla
Hello, iirc, there is a transformation for regexp replacing, but not sure it does again for all recurences or accepts the typical subst flags. Other solutions: - avp_subst() - subst_user() (backup r-uri username in a var, set username to the value you want to change, do the subst, then get the

[SR-Users] transformations {s.rm,match}

2015-12-10 Thread Jonathan Hunter
Hi Guys, I have been using {s.rm,match} to remove occurrences of numbers, however I am aware it removes all occurrences. Is it possible to make it only remove the first occurrence and not all? For example If I am looking to modify 639157407639 I want to remove only the first 63, not both. So I

Re: [SR-Users] Transformations

2013-04-19 Thread Victor V. Kustov
В Thu, 18 Apr 2013 13:56:18 +0200 Daniel-Constantin Mierla пишет: > Anyhow, I would recommend to use s.select transformation to get the > ip bytes: > > $var(i1) = $(si{s.select,0,.}); > ... > $var(i4) = $(si{s.select,4,.}); > > Then use this variables to compute the big int value. Thanks for t

Re: [SR-Users] Transformations

2013-04-18 Thread Daniel-Constantin Mierla
Hello, the transformation for avp has to be after the parenthesis around the name: $(avp(x){...}) Anyhow, I would recommend to use s.select transformation to get the ip bytes: $var(i1) = $(si{s.select,0,.}); ... $var(i4) = $(si{s.select,4,.}); Then use this variables to compute the big int

[SR-Users] Transformations

2013-04-18 Thread Victor V. Kustov
Hi! According "Transformations cookbook" exist string, uri, name transformations. I think need ip transformations, simulary atoi()/aton() and split for stings with divider. By the way: avp_subst("$avp(s:sipa)/$avp(s:abc)/g", "/(.*)\.(.*)\.(.*)\.(.*)/\1/"); avp_subst("$avp(s:sipa)/$avp(s:def)/g",