[SR-Users] Problem Re-writing RURI

Alex Balashov abalashov at evaristesys.com
Thu Jan 30 02:19:59 CET 2014


Hi Geoffrey,

On 01/29/2014 08:03 PM, Geoffrey Mina wrote:

> I am trying to manually rewrite the RURI for a certain scenario.
>
> The RURI is currently:
> sip:110219546496707 at 12.12.12.12
> <mailto:sip%3A110219546496707 at 12.12.12.12>;npdi;rate=0.000880
>
> I want to re-write so it's just:
> sip:110219546496707 at 12.12.12.12 <mailto:sip%3A110219546496707 at 12.12.12.12>
>
> I have the following snippet which isn't working:
> xlog("L_INFO","sip:$(ruri{uri.user})@$(ruri{uri.host})");
> $ru = "sip:$(ruri{uri.user})@$(ruri{uri.host})";
> t_relay();

PVs are not actually substituted inside string literals on assignment. 
You'll need to do this:

    $ru = "sip:" + $(ruri{uri.user}) + "@" + $(ruri{uri.host});

(I know, it's kind of counterintuitive, because you can xlog() that just 
fine.)

-- Alex

-- 
Alex Balashov - Principal
Evariste Systems LLC
235 E Ponce de Leon Ave
Suite 106
Decatur, GA 30030
United States
Tel: +1-678-954-0670
Web: http://www.evaristesys.com/, http://www.alexbalashov.com/



More information about the sr-users mailing list