Bogdan-Andrei Iancu wrote:
Hi,
avp_db_load() will consider the psseudo variable as uuid, so both
calls should do the same. Could you just check on mysql level what are
the queries done in the two cases? (check the text log of mysql).
we can see that the query are the same, except of avp_db_load that
include the fields attribute,type.
maybe it aspect an integer value (i use unixtime ex: 1151579428). but i
have declared avp as string:
modparam("avpops","avp_aliases","setup_time=s:setup_time")
modparam("avpops","avp_aliases","connect_time=s:connect_time")
modparam("avpops","avp_aliases","disconnect_time=s:disconnect_time")
with avp_db_query() :
T 127.0.0.1:56842 -> 127.0.0.1:3306 [AP]
j....select value from usr_preferences where
uuid='cd24f1e60e6eb449(a)82.215.128.140' and
attribute='setup_time'
#
T 127.0.0.1:3306 -> 127.0.0.1:56842 [AP]
.....E....def.openser.usr_preferences.usr_preferences.value.value.........@.............1151579428.........
#
T 127.0.0.1:56842 -> 127.0.0.1:3306 [AP]
l....select value from usr_preferences where
uuid='cd24f1e60e6eb449(a)82.215.128.140' and
attribute='connect_time'
#
T 127.0.0.1:3306 -> 127.0.0.1:56842 [AP]
.....E....def.openser.usr_preferences.usr_preferences.value.value.........@.............1151579434.........
#
T 127.0.0.1:56842 -> 127.0.0.1:3306 [AP]
o....select value from usr_preferences where
uuid='cd24f1e60e6eb449(a)82.215.128.140' and
attribute='disconnect_time'
#
T 127.0.0.1:3306 -> 127.0.0.1:56842 [AP]
.....E....def.openser.usr_preferences.usr_preferences.value.value.........@.............1151579455.........
#
T 127.0.0.1:56842 -> 127.0.0.1:3306 [AP]
d....delete from usr_preferences where
uuid='cd24f1e60e6eb449(a)82.215.128.140' AND
attribute='setup_time'
with avp_db_load() :
#
T 127.0.0.1:50918 -> 127.0.0.1:3306 [AP]
y....select value,attribute,type from usr_preferences where
uuid='4c3cd5e6b08ea471(a)82.215.128.140' AND
attribute='setup_time'
#
T 127.0.0.1:3306 -> 127.0.0.1:50918 [AP]
.....E....def.openser.usr_preferences.usr_preferences.value.value.........@...M....def.openser.usr_preferences.usr_preferences.attribute.attribute...
.....@...C....
def.openser.usr_preferences.usr_preferences.type.type.?.......@.............1151579809.setup_time.1.........
#
T 127.0.0.1:50918 -> 127.0.0.1:3306 [AP]
{....select value,attribute,type from usr_preferences where
uuid='4c3cd5e6b08ea471(a)82.215.128.140' AND
attribute='connect_time'
#
T 127.0.0.1:3306 -> 127.0.0.1:50918 [AP]
.....E....def.openser.usr_preferences.usr_preferences.value.value.........@...M....def.openser.usr_preferences.usr_preferences.attribute.attribute...
.....@...C....
def.openser.usr_preferences.usr_preferences.type.type.?.......@.............1151579816.connect_time.1.........
#
T 127.0.0.1:50918 -> 127.0.0.1:3306 [AP]
~....select value,attribute,type from usr_preferences where
uuid='4c3cd5e6b08ea471(a)82.215.128.140' AND
attribute='disconnect_time'
#
T 127.0.0.1:3306 -> 127.0.0.1:50918 [AP]
.....E....def.openser.usr_preferences.usr_preferences.value.value.........@...M....def.openser.usr_preferences.usr_preferences.attribute.attribute...
.....@...C....
def.openser.usr_preferences.usr_preferences.type.type.?.......@.............1151579823.disconnect_time.1.........
#
tele wrote:
thanks!
Ok i'm using the call-id and with the avp_db_query it works but with
avp_db_load not.
this is what i have done:
working:
avp_db_query("select value from usr_preferences where uuid='$ci'
and attribute='setup_time'","$avp(setup_time)");
avp_db_query("select value from usr_preferences where uuid='$ci'
and attribute='connect_time'","$avp(connect_time)");
avp_db_query("select value from usr_preferences where uuid='$ci'
and attribute='disconnect_time'","$avp(disconnect_time)");
not working:
avp_db_load("$ci","$avp(setup_time)");
avp_db_load("$ci","$avp(connect_time)");
avp_db_load("$ci","$avp(disconnect_time)");