Hi Ovidiu,

yes, for simplicity reasons, the extra acc converts everything as strings. Otherwise you need to deal with integers in a different way for each backend (DB, radius, log). String was something commonly easy to handle....

Regards,
Bogdan

Ovidiu Sas wrote:
Hi all,

I was trying to add an extra attribute to radius accounting packets,
specifically the "Acct-Session-Time" attribute.  The type for this
attribute is integer:

ATTRIBUTE       Acct-Session-Time       46      integer


By inspecting the radius accounting packets that are sent by openser
to the radius server, it looks like the value passed inside is a
string:

for a call duration of 813s the attribute looks like:
2e 06 00 33 31 38

2e -> 46:Acct-Session-Time
06 -> length
00
33 -> ascii: 3
31 -> ascii: 1
38 -> ascii: 8

Is it possible to insert integer attributes as an avp from the acc module?
Is this a bug (the module should be able to insert integer attributes)?
Or the design is to pass _only_ string attributes?


Snippets from the config file:

modparam("acc", "radius_config",
"/usr/local/etc/radiusclient-ng/radiusclient.conf")
modparam("acc", "radius_flag", 1)
modparam("acc", "radius_extra", "Acct-Session-Time=$avp(i:921)")


#the accounting section:

       if (is_method("BYE")) {
               xlog("L_INFO", "dialog_status:$DLG_status
duration=$DLG_lifetime\n");
               $avp(i:921) = $DLG_lifetime{s.int};
       } else {
               $avp(i:921) = 0;
       }
       setflag(1);



Regards,
Ovidiu Sas

_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://openser.org/cgi-bin/mailman/listinfo/devel



_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://openser.org/cgi-bin/mailman/listinfo/devel

Reply via email to