[SR-Users] pseudo variables in strings

Daniel-Constantin Mierla miconda at gmail.com
Mon Apr 4 07:35:38 CEST 2016



On 02/04/16 10:09, Juha Heinanen wrote:
> Alex Balashov writes:
>
>> Yes, either by separating the PV elements, e.g.
>>
>> $var(x) = $fU + "abc";
> Alex,
>
> I cannot do that, because the string that contains pvs is result of
> a dp_translate call.

Dialplan can evaluate variables, is it a special case you need to return
variables and then evaluate after dp_translate() again?

It might work by returning a lua script string that you can evaluate
with app_lua().

Cheers,
Daniel

>
>> ... or with the newer $_s() PV created for this purpose:
>>
>> $var(x) = $_s($fUabc);
> No luck with that either.  This test
>
>     $var(pv_string) = "foo$var(pv)bar";
>     $var(pv) = "car";
>     $var(res_string) = $_s($var(pv_string));
>     xlog("L_INFO", "res_string is '$var(res_string)'\n");
>
> produces to syslog:
>
> Apr  2 11:07:26 lohi /usr/bin/sip-proxy[24536]: INFO: res_string is 'foo$var(pv)bar'
>
> when I need to get 'foocarbar'.
>
> -- Juha
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference, Berlin, May 18-20, 2016 - http://www.kamailioworld.com




More information about the sr-users mailing list