[SR-Users] How to define variable as string explicitly

Alex Balashov abalashov at evaristesys.com
Wed Jun 12 15:55:26 CEST 2013


On 06/12/2013 09:53 AM, Alex Balashov wrote:

> Also, note that request routes are not functions per se, and do not have
> return values, or local variable scope, or other things that functions
> have.  So, you can't do this:
>
>     $var(matched_prefix) = route(INCOMING_AUTH);

Well, allow me to correct myself.  You sort of can return values from a 
route block (who knew!):

    http://www.kamailio.org/wiki/cookbooks/4.0.x/core#return

But, you still can't assign the route() call itself like that.  You have 
to use $? or $retcode to access the returned value.

-- 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