Hello Daniel,
I added a debug statement in mysql/dbase.c/db_mysql_submit_query() and here is the output.
1(1950) Checking pkt for caller sip:demo2@altecnet.gr 1(2318) submit_query(): select value,attribute,type from usr_preferences where username='demo2' AND domain='altecnet.gr' AND attribute='111' 1(1950) close avp query 1(1950) DEBUG:avpops:load_avps: loaded avps = 0
My config looks like avp_aliases="pkt=i:111" ... xlog("L_ERR","Checking pkt for caller $avp(caller)\n"); if (is_avp_set("$avp(caller)") && avp_db_load("$avp(caller)/uri", "$avp(pkt)")) { xlog("L_ERR", "Use large pkt=$avp(pkt) for caller $avp(caller)\n"); ... }
I see now what is happening. So I am guessing that avp_db_load() cannot be used this way unless I rename my records in DB from 'pkt' to '111' which does not make much sense. Second alternative would be to use some custom db_scheme.
best regards
George
-----Original Message----- From: Daniel-Constantin Mierla [mailto:daniel@voice-system.ro] Sent: Tuesday, October 02, 2007 12:14 PM To: Papadopoulos Georgios Cc: users@openser.org Subject: Re: [OpenSER-Users] avp_db_load() with avp aliases
Hello,
can you get the debug messages with debug=7 and the sql query sent to the mysql server?
Cheers, Daniel
On 10/01/07 10:09, Papadopoulos Georgios wrote:
Hello all,
Recently I changed all my avps from string names to
aliases. I noticed
that all my avp_db_load() calls are failing. From the tests that I did, I conclude that it fails when the 2nd argument to the
function is
an avp with an alias:
avp_aliases="caller = i:100; pkt = i:111" avp_db_load("$avp(s:caller)/uri", "$avp(s:pkt)") works ok avp_db_load("$avp(caller)/uri", "$avp(s:pkt)") works ok avp_db_load("$avp(caller)/uri", "$avp(pkt)") fails What am I doing wrong? My version is 1.2 from svn (rev. 2826)
thank you for any help
George
Disclaimer
The information in this e-mail and any attachments is
confidential. It
is intended solely for the attention and use of the named addressee(s). If you are not the intended recipient, or person responsible for delivering this information to the intended
recipient,
please notify the sender immediately. Unless you are the intended recipient or his/her representative you are not authorized to, and must not, read, copy, distribute, use or retain this message or any part of it. E-mail transmission cannot be guaranteed to be
secure or
error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses.
--
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users
Hello George,
just to give more details, before closing the thread, so that new readers can get to final conclusion quickly.
Even if you use aliases in the script, in database must be used the names of avps. The avp aliases are used in openser script only.
Cheers, Daniel
On 10/02/07 13:30, Papadopoulos Georgios wrote:
Hello Daniel,
I added a debug statement in mysql/dbase.c/db_mysql_submit_query() and here is the output.
1(1950) Checking pkt for caller sip:demo2@altecnet.gr 1(2318) submit_query(): select value,attribute,type from usr_preferences where username='demo2' AND domain='altecnet.gr' AND attribute='111' 1(1950) close avp query 1(1950) DEBUG:avpops:load_avps: loaded avps = 0
My config looks like avp_aliases="pkt=i:111" ... xlog("L_ERR","Checking pkt for caller $avp(caller)\n"); if (is_avp_set("$avp(caller)") && avp_db_load("$avp(caller)/uri", "$avp(pkt)")) { xlog("L_ERR", "Use large pkt=$avp(pkt) for caller $avp(caller)\n"); ... }
I see now what is happening. So I am guessing that avp_db_load() cannot be used this way unless I rename my records in DB from 'pkt' to '111' which does not make much sense. Second alternative would be to use some custom db_scheme.
best regards
George
-----Original Message----- From: Daniel-Constantin Mierla [mailto:daniel@voice-system.ro] Sent: Tuesday, October 02, 2007 12:14 PM To: Papadopoulos Georgios Cc: users@openser.org Subject: Re: [OpenSER-Users] avp_db_load() with avp aliases
Hello,
can you get the debug messages with debug=7 and the sql query sent to the mysql server?
Cheers, Daniel
On 10/01/07 10:09, Papadopoulos Georgios wrote:
Hello all,
Recently I changed all my avps from string names to
aliases. I noticed
that all my avp_db_load() calls are failing. From the tests that I did, I conclude that it fails when the 2nd argument to the
function is
an avp with an alias:
avp_aliases="caller = i:100; pkt = i:111" avp_db_load("$avp(s:caller)/uri", "$avp(s:pkt)") works ok avp_db_load("$avp(caller)/uri", "$avp(s:pkt)") works ok avp_db_load("$avp(caller)/uri", "$avp(pkt)") fails What am I doing wrong? My version is 1.2 from svn (rev. 2826)
thank you for any help
George
Disclaimer
The information in this e-mail and any attachments is
confidential. It
is intended solely for the attention and use of the named addressee(s). If you are not the intended recipient, or person responsible for delivering this information to the intended
recipient,
please notify the sender immediately. Unless you are the intended recipient or his/her representative you are not authorized to, and must not, read, copy, distribute, use or retain this message or any part of it. E-mail transmission cannot be guaranteed to be
secure or
error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses.
--
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users