Hi Dmitry,<br><br>your scenario could be problematic as you say. <br>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).<br>
<br>Cheers,<br>Dan<br><br><div class="gmail_quote">On Mon, Jun 2, 2008 at 8:36 PM, Dmitry Lyubimkov <<a href="mailto:loft@onego.ru">loft@onego.ru</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="RU">
<div>
<p><span lang="EN-US">Ok. It's work.</span></p>
<p><span lang="EN-US"> User-Name =
"<a href="mailto:sip%3Aloft@voapp.com" target="_blank">sip:loft@voapp.com</a>"</span></p>
<p><span lang="EN-US"> Called-Station-Id =
"<a href="mailto:sip%3A769101@voapp.com" target="_blank">sip:769101@voapp.com</a>"</span></p>
<p><span lang="EN-US"> Calling-Station-Id =
"<a href="mailto:sip%3Aloft@voapp.com" target="_blank">sip:loft@voapp.com</a>"</span></p>
<p><span lang="EN-US"> </span></p>
<p><span lang="EN-US">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</span></p>
<p><span lang="EN-US">modparam("acc",
"detect_direction", 1)</span></p>
<p><span lang="EN-US">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)",
"$<a href="mailto:au@voapp.com" target="_blank">au@voapp.com</a>");) exists only on Invite. When we receive BYE this
AVP will be empty because AVPs are persistent per SIP transaction only.</span></p>
<p><span lang="EN-US"> </span></p>
<p><span lang="EN-US">Can we somehow get initial (from INVITE) UserA
and UserB for Stop RADIUS messages in BYE processing stage?</span></p>
<p><span lang="EN-US"> </span></p>
<p><span lang="EN-US">Dmitry</span></p>
<p><span style="font-size: 10pt; color: rgb(31, 73, 125);" lang="EN-US"> </span><span style="color: rgb(31, 73, 125);" lang="EN-US"> </span><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US"></span></p>
<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0cm 0cm;">
<p><b><span style="font-size: 10pt;" lang="EN-US">From:</span></b><span style="font-size: 10pt;" lang="EN-US"> Dan-Cristian Bogos [mailto:<a href="mailto:danb.l" target="_blank">danb.l</a></span><span style="font-size: 10pt;"><a href="mailto:ists@googlemail.com" target="_blank">ists@googlemail.com</a>]
<br>
<b>Sent:</b> Monday, June 02, 2008 3:29 PM<br>
<b>To:</b> Dmitry Lyubimkov<br>
<b>Cc:</b> <a href="mailto:users@lists.openser.org" target="_blank">users@lists.openser.org</a><div><div></div><div class="Wj3C7c"><br>
<b>Subject:</b> Re: [OpenSER-Users] Trouble with RADIUS Accounting</div></div></span></p>
</div><div><div></div><div class="Wj3C7c">
<p> </p>
<p style="margin-bottom: 12pt;">Hi Dmitry,<br>
<br>
starting of 1.2 version OpenSER does not add anymore any attribute
automatically, you must instead add your wishlist manually with radius_extra
parameter:<br>
<a href="http://www.openser.org/docs/modules/1.3.x/acc.html#AEN319" target="_blank">http://www.openser.org/docs/modules/1.3.x/acc.html#AEN319</a><br>
<br>
An example of config:<br>
<br>
modparam("acc", "radius_extra", "<br>
Called-Station-Id=$tu;<br>
Calling-Station-Id=$fu;<br>
Canonical-URI=$(avp(s:canonical_uri));<br>
User-Name=$fu;<br>
Sip-User-Realm=$ar;<br>
Source-IP=$si;<br>
Source-Port=$sp;<br>
Acct-Authentic=$(avp(s:authentic));<br>
From-Header=$(hdr(from));<br>
User-Agent=$(hdr(user-agent));<br>
Contact=$(hdr(contact));<br>
Event=$(hdr(event))<br>
")<br>
<br>
Cheers,<br>
DanB</p>
<div>
<p>On Mon, Jun 2, 2008 at 12:39 PM, Dmitry Lyubimkov <<a href="mailto:loft@onego.ru" target="_blank">loft@onego.ru</a>> wrote:</p>
<p>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.<br>
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?<br>
<br>
Dmitry<br>
<br>
-----Original Message-----<br>
From: Mike O'Connor [mailto:<a href="mailto:mike@pineview.net" target="_blank">mike@pineview.net</a>]<br>
Sent: Monday, June 02, 2008 1:07 PM<br>
To: Dmitry Lyubimkov<br>
Subject: Re: [OpenSER-Users] Trouble with RADIUS Accounting<br>
<br>
Hi Dmitry<br>
<br>
You not can remove them from OpenSER with out adjusting the code,<br>
instead you need to put the radius packets thought something like a<br>
radius proxy which removes them.<br>
<br>
Mike</p>
<div>
<div>
<p><br>
<br>
Dmitry Lyubimkov wrote:<br>
> Hi.<br>
> We have new installation of OpenSER V.1.3.1 with new script. All work fine<br>
> except RADIUS accounting. Accounting Start and Stop records come to RADIUS<br>
> server, but there are no some attributes in them - User-Name,<br>
> Called-Station-Id, Calling-Station-Id,...<br>
> Example of Start and Stop records (FreeRADIUS log):<br>
> Acct-Status-Type = Start<br>
> Service-Type = IAPP-Register<br>
> Sip-Response-Code = 200<br>
> Sip-Method = 1<br>
> Event-Timestamp = "Jun 2 2008
10:34:05 MSD"<br>
> Sip-From-Tag = "5d12c92c"<br>
> Sip-To-Tag = "6845627C-1EF5"<br>
> Acct-Session-Id =
"ODhmMjE4MmUxNzc3ZmZjN2U3MjJlM2I4NzQ0MjMzNTU."<br>
> NAS-Port = 5060<br>
> Acct-Delay-Time = 0<br>
> NAS-IP-Address = <a href="http://172.16.2.10" target="_blank">172.16.2.10</a><br>
> Client-IP-Address = <a href="http://172.16.2.10" target="_blank">172.16.2.10</a><br>
> Timestamp = 1212388445<br>
><br>
> Acct-Status-Type = Stop<br>
> Service-Type = IAPP-Register<br>
> Sip-Response-Code = 200<br>
> Sip-Method = 8<br>
> Event-Timestamp = "Jun 2 2008
10:34:12 MSD"<br>
> Sip-From-Tag = "5d12c92c"<br>
> Sip-To-Tag = "6845627C-1EF5"<br>
> Acct-Session-Id =
"ODhmMjE4MmUxNzc3ZmZjN2U3MjJlM2I4NzQ0MjMzNTU."<br>
> NAS-Port = 5060<br>
> Acct-Delay-Time = 0<br>
> NAS-IP-Address = <a href="http://172.16.2.10" target="_blank">172.16.2.10</a><br>
> Client-IP-Address = <a href="http://172.16.2.10" target="_blank">172.16.2.10</a><br>
> Timestamp = 1212388452<br>
><br>
> Where is trouble? Required attributes are described in dictionary file. If
I<br>
> remove it then OpenSER says<br>
> Jun 2 11:02:23 [4064] ERROR:auth_radius:mod_init: auth_radius: can't
get<br>
> code for the User-Name attribute<br>
> Jun 2 11:02:23 [4064] ERROR:core:init_mod: failed to initialize
module<br>
> auth_radius<br>
> Jun 2 11:02:23 [4064] ERROR:core:main: error while initializing
modules<br>
><br>
> How and where in script we can prohibit send of some attributes?<br>
><br>
> Dmitry<br>
><br>
><br>
><br>
> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@lists.openser.org" target="_blank">Users@lists.openser.org</a><br>
> <a href="http://lists.openser.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser.org/cgi-bin/mailman/listinfo/users</a><br>
><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.openser.org" target="_blank">Users@lists.openser.org</a><br>
<a href="http://lists.openser.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser.org/cgi-bin/mailman/listinfo/users</a></p>
</div>
</div>
</div>
<p> </p>
</div></div></div>
</div>
</blockquote></div><br>