Hi,
My billing system doesn't correlate START/STOP accounting packets and
use Cisco-VSA like attributes.
I need to do an accounting compatible with my billing system from
OpenSER so i've done a dirty method like that:
i know it's not really performance but it's the only way i can do that.
The problem is with OpenSER 1.1.x that generate accounting with the
attribute filled with the same value of "disconnect_time". example:
h323-setup-time = '1151511700'
h323-connect-time = '1151511700'
h323-disconnect-time = '1151511700'
the xlog debug output of openser1.1.x i have added is with correct
attribute values.
with OpenSER 1.0.1 everything works fine.
CONFIGS:
with OpenSER 1.1.x:
modparam("acc", "radius_extra",
"h323-setup-time=$avp(setup_time);
h323-connect-time=$avp(connect_time);
h323-disconnect-time=$avp(disconnect_time)")
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")
if (is_method("INVITE"))
{
avp_write("$Ts","$avp(setup_time)");
avp_db_store("$from","$avp(setup_time)");
} else if (is_method("ACK")) {
avp_write("$Ts","$avp(connect_time)");
avp_db_store("$from","$avp(connect_time)");
} else if (is_method("BYE")) {
avp_write("$Ts","$avp(disconnect_time)");
avp_db_store("$from","$avp(disconnect_time)");
};
if (is_method("BYE")) {
avp_db_load("$from","$avp(setup_time)");
avp_db_load("$from","$avp(connect_time)");
avp_db_load("$from","$avp(disconnect_time)");
xlog("L_INFO","Before accounting
SETUP_TIME[$avp(setup_time)] CONNECT_TIME[$avp(connect_time)]
DISCONNECT_TIME[$avp(disconnect_time)]");
setflag(3);
setflag(5);
avp_db_delete("$from","$avp(setup_time)");
avp_db_delete("$from","$avp(connect_time)");
avp_db_delete("$from","$avp(disconnect_time)");
};
With OpenSER 1.0.1:
modparam("acc", "radius_extra",
"h323-setup-time=$avp($setup_time);
h323-connect-time=$avp($connect_time)
; h323-disconnect-time=$avp($disconnect_time)")
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")
if (is_method("INVITE"))
{
avp_write("0","i:1");
avp_printf("i:1", "$Ts");
avp_copy("i:1","$setup_time");
avp_db_store("$from","$setup_time");
avp_delete("i:1");
} else if (is_method("ACK")) {
avp_write("0","i:1");
avp_printf("i:1", "$Ts");
avp_copy("i:1","$connect_time");
avp_db_store("$from","$connect_time");
avp_delete("i:1");
} else if (is_method("BYE")) {
avp_write("0","i:1");
avp_printf("i:1", "$Ts");
avp_copy("i:1","$disconnect_time");
avp_db_store("$from","$disconnect_time");
avp_delete("i:1");
};
if (is_method("BYE")) {
avp_db_load("$from","$setup_time");
avp_db_load("$from","$connect_time");
avp_db_load("$from","$disconnect_time");
xlog("L_INFO","Before accounting
SETUP_TIME[$avp($setup_time)] CONNECT_TIME[$avp($connect_time)]
DISCONNECT_TIME[$avp($disconnect_time)]");
setflag(3);
setflag(5);
avp_db_delete("$from","$setup_time");
avp_db_delete("$from","$connect_time");
avp_db_delete("$from","$disconnect_time");
};