Yate Community Forum
Yate server => Other Yate server issues => Topic started by: billsimon on March 16, 2015, 08:56:02 PM
-
If I dispatch a database message from regexroute, e.g.
^1$=dispatch database;account=something;query=SELECT ...;results=true
how do I get the SELECT results out of the message answer?
-
Hi,
You can't do that from regexroute. Try using Javascript instead:
http://docs.yate.ro/wiki/How_to_access_a_database_from_Yate%27s_Javascript_module
-
Thank you Monica. I am doing everything else with register.conf and regexroute and hate to load Javascript just for this. Does Javascript perform better than register or regexroute? If so I may try to convert my logic.
-
It's not about what performs better it's about finding the right tool for a specific action :).
Getting results from a SELECT implies a very custom feature and this is usually implemented in javascript or from an external module.
If you can do this from register.conf then use it, otherwise you will need a piece of scripting. The power of Yate lies in the fact that you can mix existing modules and custom scripting.
-
Thanks for your advice. For this specific routing need I was not able to do it with the register module but accomplished it fine with Javascript.