Hi Henning,
thank you for your e-mail.
I use the function sql_query() instead of avp_db_query now, works
perfectly...
Regarding the route specific AVPs the idea is to make it possible to
have something like "private" variables (compared with e.g. c-code).
If private variables would be available, they would be very useful for
recursive route calls. Otherwise (as you have stated) you need different
variables for every recursion. The same with iterations, because if you
convert the recursion to an iteration, you need a stack to save values
temporarily (of course the same happens with recursions, but then you do
not have to do it by yourself) and (that's the main problem) at this
point, you do not now, how many recursion levels will be there, so you
do not know also, how much avps/variables you need to save the stack.
With avp_pushto (as I understand the module doc) it is only possible to
push avps into sip-msg (r-uri/domain etc.). Or can you also use that
function to build something like a memory stack?
Cheers ;-)
Jasmin
On Tuesday 30 March 2010, Jasmin Schnatterbeck wrote:
while thinking about the idea to build a
recursive code block in
kamailio.cfg I noticed, that there are no route-specific avps available.
Of course you can convert a recursion to an iteration, but you need
something like a stack to save variables on it, which is not available
also.
Hi Jasmin,
i think you could load a few values into an AVP, and then use avp_pushto to
'push' the value from this stack.
Do you think it's reasonable to make route
specific avps available in
future releases?
If you want to use a route specific AVP, why its not possible for you to use
different AVPs for every route you have in the script?
I also noticed, that it does not seem to be
possible to get the number
of result rows of avp_db_query - may (in the case of an successful
query) can the function return the number of results for example?
The avp_db_query is a bit a deprecated function, take a look to the 'sqlops'
module, which provides a more advanced interface. I think it also export the
number of rows.
Cheers,
Henning