[SR-Users] Help with dispatcher module

Javi Gallart jgallart at systemonenoc.com
Tue Apr 9 07:27:56 CEST 2013


Hello

you may try to cast $var(y) to int using this transformation: 
http://www.kamailio.org/wiki/cookbooks/4.0.x/transformations#sint

Regards

Javi
On 04/09/2013 12:17 AM, julian arsanches wrote:
> thanks for all support from the forum before hand.
> i am having an issue with  my setup, i am trying to make the 
> dispatcher dynamic by asigning a value from a variable, that variable 
> is define on my dispatcher.lst but i am getting an error, if anyone 
> can help thanks.
>
> my config on the relay route
> first i strip the prefix from my dial string, and set variable y with 
> that code, then i strip it and dial it. but it does not work.
> again thanks if anyone can helpme.
>
>
>
> xlog(" anrtes de strip  >> el r-uri($ru)>($ru{s.substr,0,3})\n");
>
>
> $var(x) = $ru;  #>> set varx as an string
>
> $var(y)=$(var(x){s.substr,4,3}); #>>>>strip the first 3 digits to find 
> my route
>
>
>
> xlog("dsroute $var(y) my test ($ru)\n"); #check for variables loaded
>
> strip(3); # strip the prefix to  route to destinatio
>
> xlog("despues de strip time [$Tf] method ($rm) r-uri ($ru) 2nd via el 
> code ($var(y)\n"); #check for loaded variables after strip
>
>
> ds_select_dst("$var(y)", "4");#>>carrer dynamic don't  work variable 
> is load propperly but  i get the following error
> *
> *
> *##Apr  8 17:59:32 ip-10-0-1-206 /usr/sbin/kamailio[8975]: ERROR: 
> <script>: despues de strip time [Mon Apr  8 17:59:32 2013] method 
> (ACK) r-uri (sip:54.236.192.19) 2nd via el code (54). >>> i see a the 
> right code in the variable*
> *##Apr  8 17:59:32 ip-10-0-1-206 /usr/sbin/kamailio[8975]: ERROR: 
> <core> [sr_module.c:1726]: Could not convert PV to int *
>
>
> #ds_select_dst("097", "4");#statically define works
>
> xlog("print el destination y el $var(y) ($du)>>($td)>>> ($ru)\n");
>
>        if (!t_relay_to_udp()) {
>
> sl_reply_error();
> };
>
>
>         exit;
> }
>
>
>
> dispatcher.lst
>
> #lineformat
> #setit(integer)destination(sipuri)flags(integer,optional)
>
>
> #Asterisks
>
> 007 sip:1.1.1.1:5060 <http://1.1.1.1:5060>    ##route 1
> 024 sip:2.2.2.2:5060 <http://2.2.2.2:5060>  ##route 2
> 100 sip:1.1.1.100:5060 <http://1.1.1.100:5060>  ##route 100
> 103 sip:1.1.1.103:5060 <http://1.1.1.103:5060>  ###route 103
>
>
>
> _______________________________________________
> 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




More information about the sr-users mailing list