Hi Dmitry,

your scenario could be problematic as you say.
On my side I am doing SQL Update considering call-id + other call leg info, so I am not overwriting the original username, already in the database (this update works even with direction detection using alternative queries of the sql module in freeradius).

Cheers,
Dan

On Mon, Jun 2, 2008 at 8:36 PM, Dmitry Lyubimkov <loft@onego.ru> wrote:

Ok. It's work.

        User-Name = "sip:loft@voapp.com"

        Called-Station-Id = "sip:769101@voapp.com"

        Calling-Station-Id = "sip:loft@voapp.com"

 

But there is the same problem as in early version of OpenSER. Field User-Name depend on who hang-up the call. In case of A call B in Start record we receive right User-Name=A, Calling=A, Called=B. But if B hang up first then in Stop record we'll receive User-Name=B, Calling=B, Called=A. It is difficult to manipulate fields in some RADIUS servers. I think that

modparam("acc", "detect_direction", 1)

helps to resolve this problem now. But if we receive RADIUS field through modparam("acc", "radius_extra", "...   command we can use only pseudo variables and avp. And there is no variable for Invite username. And AVP (pv_printf("$avp(username)", "$au@voapp.com");) exists only on Invite. When we receive BYE this AVP will be empty because AVPs are persistent per SIP transaction only.

 

Can we somehow get initial (from INVITE) UserA and UserB for Stop RADIUS messages in BYE processing stage?

 

Dmitry

 

From: Dan-Cristian Bogos [mailto:danb.lists@googlemail.com]
Sent: Monday, June 02, 2008 3:29 PM
To: Dmitry Lyubimkov
Cc: users@lists.openser.org


Subject: Re: [OpenSER-Users] Trouble with RADIUS Accounting

 

Hi Dmitry,

starting of 1.2 version OpenSER does not add anymore any attribute automatically, you must instead add your wishlist manually with radius_extra parameter:
http://www.openser.org/docs/modules/1.3.x/acc.html#AEN319

An example of config:

modparam("acc", "radius_extra", "
                                        Called-Station-Id=$tu;
                                        Calling-Station-Id=$fu;
                                        Canonical-URI=$(avp(s:canonical_uri));
                                        User-Name=$fu;
                                        Sip-User-Realm=$ar;
                                        Source-IP=$si;
                                        Source-Port=$sp;
                                        Acct-Authentic=$(avp(s:authentic));
                                        From-Header=$(hdr(from));
                                        User-Agent=$(hdr(user-agent));
                                        Contact=$(hdr(contact));
                                        Event=$(hdr(event))
                                        ")

Cheers,
DanB

On Mon, Jun 2, 2008 at 12:39 PM, Dmitry Lyubimkov <loft@onego.ru> wrote:

But we did it!!! I don't need to remove this attributes. We need User-Name, Called-Station-Id, Calling-Station-Id, etc for billing purpose. But our RADIUS server does not receive them from OpenSER! Look at our Start/Stop messages. There are not such important attributes as User-Name, etc.
Is this bug of OpenSER or bug of our script? If it is bug of script, then what commands, what modules, what modparam can lead to such result?

Dmitry

-----Original Message-----
From: Mike O'Connor [mailto:mike@pineview.net]
Sent: Monday, June 02, 2008 1:07 PM
To: Dmitry Lyubimkov
Subject: Re: [OpenSER-Users] Trouble with RADIUS Accounting

Hi Dmitry

You not can remove them from OpenSER with out adjusting the code,
instead you need to put the radius packets thought something like a
radius proxy which removes them.

Mike



Dmitry Lyubimkov wrote:
> Hi.
> We have new installation of OpenSER V.1.3.1 with new script. All work fine
> except RADIUS accounting. Accounting Start and Stop records come to RADIUS
> server, but there are no some attributes in them - User-Name,
> Called-Station-Id, Calling-Station-Id,...
> Example of Start and Stop records (FreeRADIUS log):
>         Acct-Status-Type = Start
>         Service-Type = IAPP-Register
>         Sip-Response-Code = 200
>         Sip-Method = 1
>         Event-Timestamp = "Jun  2 2008 10:34:05 MSD"
>         Sip-From-Tag = "5d12c92c"
>         Sip-To-Tag = "6845627C-1EF5"
>         Acct-Session-Id = "ODhmMjE4MmUxNzc3ZmZjN2U3MjJlM2I4NzQ0MjMzNTU."
>         NAS-Port = 5060
>         Acct-Delay-Time = 0
>         NAS-IP-Address = 172.16.2.10
>         Client-IP-Address = 172.16.2.10
>         Timestamp = 1212388445
>
>         Acct-Status-Type = Stop
>         Service-Type = IAPP-Register
>         Sip-Response-Code = 200
>         Sip-Method = 8
>         Event-Timestamp = "Jun  2 2008 10:34:12 MSD"
>         Sip-From-Tag = "5d12c92c"
>         Sip-To-Tag = "6845627C-1EF5"
>         Acct-Session-Id = "ODhmMjE4MmUxNzc3ZmZjN2U3MjJlM2I4NzQ0MjMzNTU."
>         NAS-Port = 5060
>         Acct-Delay-Time = 0
>         NAS-IP-Address = 172.16.2.10
>         Client-IP-Address = 172.16.2.10
>         Timestamp = 1212388452
>
> Where is trouble? Required attributes are described in dictionary file. If I
> remove it then OpenSER says
> Jun  2 11:02:23 [4064] ERROR:auth_radius:mod_init: auth_radius: can't get
> code for the User-Name attribute
> Jun  2 11:02:23 [4064] ERROR:core:init_mod: failed to initialize module
> auth_radius
> Jun  2 11:02:23 [4064] ERROR:core:main: error while initializing modules
>
> How and where in script we can prohibit send of some attributes?
>
> Dmitry
>
>
>
> _______________________________________________
> Users mailing list
> Users@lists.openser.org
> http://lists.openser.org/cgi-bin/mailman/listinfo/users
>




_______________________________________________
Users mailing list
Users@lists.openser.org
http://lists.openser.org/cgi-bin/mailman/listinfo/users