[OpenSIPS-Users] memcache -> avp -> drouting failure

Bogdan-Andrei Iancu bogdan at voice-system.ro
Fri May 22 18:20:56 CEST 2009


Hi Brett,

do_routing expects a simple AVP (without transformation), the first 
format will not help, but the second should

Regards,
Bogdan

Brett Nemeroff wrote:
> Bogdan,
> But I did:
> do_routing("$(avp(s:routegroup){s.int <http://s.int>})") 
>
> as well. Shouldn't that have worked?
>
> maybe I need to:
> $avp(s:routegroup) = $(avp(s:group_temp){s.int <http://s.int>});
> do_routing("$avp(s:routegroup)")
>
> What do you think?
> Thanks,
> -Brett
>
> On Fri, May 22, 2009 at 11:13 AM, Bogdan-Andrei Iancu 
> <bogdan at voice-system.ro <mailto:bogdan at voice-system.ro>> wrote:
>
>     Hi Brett,
>
>     A simple answer - the cache works only for strings, so it is not
>     able to store numerical values (only in string representation) .
>
>     Before do_routing(), try to do avp_print() to get the list with
>     AVPS., types and vals - just to double check.
>
>     Regards,
>     Bogdan
>
>     Brett Nemeroff wrote:
>
>         Hey All,
>         I've got this problem, that I imagine has something to do with
>         datatypes. So I pull from cache (cache_fetch) the group_id to
>         pass to drouting kinda like:
>         cache_fetch("local","trunk2group_$si",$avp(s:group_temp))
>
>         Then for scripting reasons (I promise, there is a good reason)
>         I do:
>         $avp(s:routegroup) = $avp(s:group_temp);
>
>         Then I pass it to do_routing like:
>         do_routing("$avp(s:routegroup)");
>
>         and then I get:
>         ERROR:drouting:do_routing: failed to get group id
>         I've printed out the value of $avp(s:routegroup) and it's
>         perfectly valid..
>         So I take my cache bits out, and instead I populate
>         $avp(s:group_temp) direct from  avp_db_query. The field comes
>         from MySQL and is an int(11). This works perfectly every time
>         (and returns the same value (which is the number 5).
>
>
>         So any idea what the problem might be? I've tried casting to
>         int ie:
>         do_routing("$(avp(s:routegroup){s.int <http://s.int>
>         <http://s.int>}))
>
>
>         but that doesn't seem to make anything better.
>
>         any ideas? Right now I'm having to bypass my cache or it just
>         won't work.
>
>         Thanks,
>         Brett
>
>         ------------------------------------------------------------------------
>
>         _______________________________________________
>         Users mailing list
>         Users at lists.opensips.org <mailto:Users at lists.opensips.org>
>         http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>          
>
>
>




More information about the Users mailing list