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 &lt;<a href="mailto:loft@onego.ru">loft@onego.ru</a>&gt; 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&#39;s work.</span></p>

<p><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; User-Name =
&quot;<a href="mailto:sip%3Aloft@voapp.com" target="_blank">sip:loft@voapp.com</a>&quot;</span></p>

<p><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Called-Station-Id =
&quot;<a href="mailto:sip%3A769101@voapp.com" target="_blank">sip:769101@voapp.com</a>&quot;</span></p>

<p><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Calling-Station-Id =
&quot;<a href="mailto:sip%3Aloft@voapp.com" target="_blank">sip:loft@voapp.com</a>&quot;</span></p>

<p><span lang="EN-US">&nbsp;</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&#39;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(&quot;acc&quot;,
&quot;detect_direction&quot;, 1)</span></p>

<p><span lang="EN-US">helps to resolve this problem now. But if
we receive RADIUS field through modparam(&quot;acc&quot;,
&quot;radius_extra&quot;, &quot;...&nbsp; &nbsp;command we can use only pseudo variables
and avp. And there is no variable for Invite username. And AVP (pv_printf(&quot;$avp(username)&quot;,
&quot;$<a href="mailto:au@voapp.com" target="_blank">au@voapp.com</a>&quot;);) 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">&nbsp;</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">&nbsp;</span></p>

<p><span lang="EN-US">Dmitry</span></p>

<p><span style="font-size: 10pt; color: rgb(31, 73, 125);" lang="EN-US">&nbsp;</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>&nbsp;</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(&quot;acc&quot;, &quot;radius_extra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bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&quot;)<br>
<br>
Cheers,<br>
DanB</p>

<div>

<p>On Mon, Jun 2, 2008 at 12:39 PM, Dmitry Lyubimkov &lt;<a href="mailto:loft@onego.ru" target="_blank">loft@onego.ru</a>&gt; wrote:</p>

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

</div></div></div>

</div>


</blockquote></div><br>