[OpenSIPS-Users] acc-Module DB-Accounting

Bogdan-Andrei Iancu bogdan at voice-system.ro
Tue Jan 27 10:24:36 CET 2009


Hi Robert,

yes , by setting the "detect_direction" to 1, you are guarantee that the 
STOP event will have the same "called-station-id" and 
"calling-station-id" as the start, disregarding which party hung up.

what kind of queries are you looking for?

Regards,
Bogdan

Robert Borz wrote:
> Hi Bogdan,
>
> I'm not sure if I can completely follow you. Now I skipped the db-accounting part and continued with radius accounting (finally the freeradius will also have a postgres database backend when finished configuration).
>
> But the Start and Stop Records in the acct-log also have Called-Station-Id and Calling-Station-Id wrong when the callee hangs up the call. I assume that this is why here also the values of the pseudo variables are not changed because the uri is not touched as you say.
>
> modparam("acc", "radius_config", "/etc/radiusclient-ng/radiusclient.conf")
> modparam("acc", "radius_flag", 1)
> modparam("acc", "radius_extra", "Called-Station-Id=$tu;Calling-Station-Id=$fu")
>
> The Sip-From-Tag and Sip-To-Tag only match when detect_direction is set to 1. Here's my detail record:
>
> Mon Jan 26 16:41:13 2009
>         Acct-Status-Type = Start
>         Service-Type = Sip-Session
>         Sip-Response-Code = 200
>         Sip-Method = INVITE
>         Event-Timestamp = "Jan 26 2009 16:41:13 CET"
>         Sip-From-Tag = "9558cf66"
>         Sip-To-Tag = "as2f28bff5"
>         Acct-Session-Id = "YmZmY2E5YTZhMjA3NTU0NDMxNzE4NGI2MWUwNjE2YTk."
>         Called-Station-Id = "sip:10000 at domain.de"
>         Calling-Station-Id = "sip:20000 at domain.de"
>         NAS-Port = 5060
>         Acct-Delay-Time = 0
>         NAS-IP-Address = 10.1.0.11
>         Timestamp = 1232984473
>         Request-Authenticator = Verified
>
> Mon Jan 26 16:41:16 2009
>         Acct-Status-Type = Stop
>         Service-Type = Sip-Session
>         Sip-Response-Code = 200
>         Sip-Method = BYE
>         Event-Timestamp = "Jan 26 2009 16:41:16 CET"
>         Sip-From-Tag = "9558cf66"
>         Sip-To-Tag = "as2f28bff5"
>         Acct-Session-Id = "YmZmY2E5YTZhMjA3NTU0NDMxNzE4NGI2MWUwNjE2YTk."
>         Called-Station-Id = "sip:20000 at domain.de"
>         Calling-Station-Id = "sip: 10000 at domain.de"
>         NAS-Port = 5060
>         Acct-Delay-Time = 0
>         NAS-IP-Address = 10.1.0.11
>         Timestamp = 1232984476
>         Request-Authenticator = Verified
>
> So everything seems to be right here, doesn't it?
>
> Is there some sample configuration for the database query with the sql module for freeradius?
>
> Thanks a lot!
>
>
> Regards,
> Robert.
>
> -----Original Message-----
> From: bogdan at voice-system.ro [mailto:bogdan at voice-system.ro] 
> Sent: Monday, January 26, 2009 4:22 PM
> To: Robert Borz
> Cc: users at lists.opensips.org
> Subject: Re: [OpenSIPS-Users] acc-Module DB-Accounting
>
> Hi Robert,
>
> the  "detect_direction"  feature affects only information like caller 
> and callee (from the radius package) and not the ruri.
>
> Regards,
> Bogdan
>
>
>
> Robert Borz wrote:
>   
>> After solving my first issues, I'm now trying to setup db-accounting in SER. If this works I will upgrade my configuration to work with FreeRADIUS.
>>
>> So I added the acc module like this:
>>
>> loadmodule "acc.so"
>> modparam("acc", "detect_direction", 1)
>> modparam("acc", "db_url", "postgres://openser:password@10.1.0.16/openser")
>> modparam("acc", "db_flag", 1)
>> modparam("acc", "db_missed_flag", 2)
>> modparam("acc", "db_extra", "from_uri=$fu; to_uri=$tu")
>> modparam("acc", "radius_config", "/etc/radiusclient-ng/radiusclient.conf")
>> modparam("acc", "log_flag", 1)
>> modparam("acc", "log_missed_flag", 2)
>>
>> It doesn't matter if I set the detect_direction parameter to 0 or 1, the STOP record always will have the uri of the guy hanging up the call.
>>
>> Does the detect_direction only affect radius accounting or should I use other pseudo variables for my db_extra configuration? Although... $fu and $tu are looking very appropriate to me.
>>
>> Thanks a lot!
>>
>>
>> Robert.
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>     



More information about the Users mailing list