[SR-Users] Variable substitution with Dispatcher

Daniel-Constantin Mierla miconda at gmail.com
Thu Nov 11 20:13:12 CET 2010


Hello,

On 11/11/10 5:35 PM, Lee Archer wrote:
>
> Hi, can anyone answer this?
>
> Regards
>
> Lee
>
> *From:*sr-users-bounces at lists.sip-router.org 
> [mailto:sr-users-bounces at lists.sip-router.org] *On Behalf Of *Lee Archer
> *Sent:* 10 November 2010 10:25
> *To:* sr-users at lists.sip-router.org
> *Subject:* [SR-Users] Variable substitution with Dispatcher
>
> Hi, I am trying to compare 3.0.4 and 3.1 and the following works in 
> 3.1 but not 3.0.4. Should this work in 3.0 or was it only fixed for 3.1?
>
> ds_select_dst($tU,"4");
>
$tU is normally a string (it is the pv returning To header URI username) 
- the set id has to be integer.

However, using pseudo-variables in the parameters of ds_select_dst() 
works at least for the last 3-4 stable versions, just that the 
parameters must me enclosed in double quotes:

$var(alg) = 4;
$var(grp) = 2;
ds_select_dst("$var(grp)", "$var(alg)");

if $tU holds a number (printed as string) that you want to use like 
group id, convert it to integer:
$var(grp) = $(tU{s.int});

Cheers,
Daniel

> Regards
>
> Lee
>
>
> _______________________________________________
> 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20101111/07dbdfcf/attachment.htm>


More information about the sr-users mailing list