if i remember correctly, k told the config file line number where an error occurred and also the name of the function that issued it. sr doesn't do so. see previous message about deprecated pv syntax warnings and now also this:
Jun 1 20:24:49 localhost /usr/sbin/sip-router[14871]: ERROR: utils [utils.c:244]: result pvar is not writeble
in general, how can i know where the problem occurred?
in this particular case, i know where the error comes from:
http_query("some_query", "$ru");
the same statement works fine in k. why is $ru not writeble? can i replace it with some other form of request-uri variable?
-- juha
On 06/01/2009 08:35 PM, Juha Heinanen wrote:
if i remember correctly, k told the config file line number where an error occurred and also the name of the function that issued it. sr doesn't do so. see previous message about deprecated pv syntax warnings and now also this:
Jun 1 20:24:49 localhost /usr/sbin/sip-router[14871]: ERROR: utils [utils.c:244]: result pvar is not writeble
in general, how can i know where the problem occurred?
in this particular case, i know where the error comes from:
http_query("some_query", "$ru");
the same statement works fine in k. why is $ru not writeble? can i replace it with some other form of request-uri variable?
there is a problem with the common fixup system -- I think Andrei implemented it.
K functions expect a pointer to pv_spec_t and now a pv_spec_t** is returned when fixup_pvar() is used. fparam_t.v.pvs is a pv_spec_t* and the *param (from fixup call) is filled with &fparam_t.v.
A solution would be to add a void *fixed_param to fparam_t that is either set to &fparam_t.v or to a filed insind 'u' union, and this one is used to fill the 'param'.
Cheers, Daniel
Daniel-Constantin Mierla writes:
K functions expect a pointer to pv_spec_t and now a pv_spec_t** is returned when fixup_pvar() is used. fparam_t.v.pvs is a pv_spec_t* and the *param (from fixup call) is filled with &fparam_t.v.
A solution would be to add a void *fixed_param to fparam_t that is either set to &fparam_t.v or to a filed insind 'u' union, and this one is used to fill the 'param'.
i hope that not all modules that accept pv arguments would need to be updated. let me know when this works and i'll resume my tests.
-- juha
On 06/01/2009 10:35 PM, Juha Heinanen wrote:
Daniel-Constantin Mierla writes:
K functions expect a pointer to pv_spec_t and now a pv_spec_t** is returned when fixup_pvar() is used. fparam_t.v.pvs is a pv_spec_t* and the *param (from fixup call) is filled with &fparam_t.v.
A solution would be to add a void *fixed_param to fparam_t that is either set to &fparam_t.v or to a filed insind 'u' union, and this one is used to fill the 'param'.
i hope that not all modules that accept pv arguments would need to be updated. let me know when this works and i'll resume my tests.
Here is a patch that should fix, if you want to test.
Cheers, Daniel
Daniel-Constantin Mierla writes:
Here is a patch that should fix, if you want to test.
daniel,
thanks for the patch. after i applied it, sr didn't anymore complain about unwriteable pv. my sip-router is now running, but i have not tested yet if it does something useful.
-- juha
Hello,
On 06/01/2009 08:35 PM, Juha Heinanen wrote:
if i remember correctly, k told the config file line number where an error occurred and also the name of the function that issued it.
yes, it printed the line number - the action structure in K has a field 'line' -- I couldn't find it.
That is very useful for fixup or runtime errors, I would add it in SR if no one has something against or a better option.
Cheers, Daniel
On Jun 02, 2009 at 11:29, Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
On 06/01/2009 08:35 PM, Juha Heinanen wrote:
if i remember correctly, k told the config file line number where an error occurred and also the name of the function that issued it.
yes, it printed the line number - the action structure in K has a field 'line' -- I couldn't find it.
Well kamailio did have the line number for actions, sip-router has complete position information for expressions :-)
That is very useful for fixup or runtime errors, I would add it in SR if no one has something against or a better option.
We should add it, but it's not so simple. We should have complete position information, like we have for expressions (start line, start column, end line and end column -- struct cfg_pos in route_struct.h). To add this we need to propagate this information through all the parsing rules and add it somehow to the basic tokens, which would be very time consuming.
So feel free to add it if you add full position info.
Andrei
Andrei Pelinescu-Onciul writes:
Well kamailio did have the line number for actions, sip-router has complete position information for expressions :-)
in order to find where the errors come from, line numbers are more useful than line positions. if you don't know the line, position info is not very valuable.
and in this concrete case there was no position info either:
Jun 1 20:11:42 localhost /usr/sbin/sip-router[14204]: WARNING: <core> [usr_avp.c:882]: i: and s: avp name syntax is deprecated!
-- juha