From miconda@gmail.com Tue Aug 28 08:08:23 2012 From: Daniel-Constantin Mierla To: sr-users@lists.kamailio.org Subject: Re: [SR-Users] DROUTING nub question Date: Tue, 28 Aug 2012 08:08:10 +0200 Message-ID: <503C604A.2080209@gmail.com> In-Reply-To: <503C565D.2000206@systemonenoc.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0425998268==" --===============0425998268== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hello, this could be also an workaround for adding some prefix based on length. But also the length can be used, it should work like: $rU = "" + $(rU{s.len}) + $rU; (note the empty string) or pv_printf("$rU", "$(rU{s.len})$rU"); Cheers, Daniel On 8/28/12 7:25 AM, Javi Gallart wrote: > Hi > > maybe this would work. You have a mask like "111111111111" (you choose > the max length and the content). From the mask you extract as many > digits as the length of your number with {s.substr,offset,length}, > being length $(rU{s.len}}. Then you prepend the result to you $rU. > > Hope it helps > > > Javi > > On 08/28/2012 02:34 AM, Luis Fernando Urrea wrote: >> I see there is a transformation to return the string value of an >> integer but I can't seem to find the opposite one. >> >> {s.int } >> Return integer value of a string-represented number >> >> On Mon, Aug 27, 2012 at 6:22 PM, Luis Fernando Urrea >> > wrote: >> >> Thanks Daniel, >> >> That got me started, however, it seems that the return value >> from $(rU{s.len}) is actually an integer and therefore could not >> be concatenated to $rU string ? >> >> 4(18194) ERROR: pv [pv_core.c:1798]: str value required to set >> R-URI user >> 14(18194) ERROR: [lvalue.c:354]: setting pvar failed >> 14(18194) ERROR: [lvalue.c:407]: assignment failed at pos: >> (906,8-906,25) >> 14(18194) ERROR: *** cfgtrace: >> c=[/usr/local/etc/kamailio/kamailio.cfg] l=907 a=26 n=xlog >> 14(18194) ERROR: