On 3/25/10 4:14 PM, Juha Heinanen wrote:
Daniel-Constantin Mierla writes:
it gets the content of parameter as static string, so if you would have
route[$var(test)] { ... }
the above does not make sense, because it would mean that the name of the same route block would change on the fly.
as it is now, does not change, the name of the variable is the name of the route, not the value of the variable.
At this moment, there is no support to call a route taking the name from a variable. It would be easy to add though.
Daniel
what i try to achieve is that i make some kind of query on the request (for example, using a db operation, dp_translate, etc), the result of which then would determine which route block is executed:
$var(block) = some_function_on_the_request(); route("$var(block)");
if that is not possible, then i would need to use a switch statement on $var(block), which is not a nice solution especially if i would need to make it in several places of the script adding tens of extra lines to to the script.
-- juha
sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users