Hi there<br>
<br>
I'm using ser v 0.9.6 and Freeradius v 1.1.0 on Ubuntu 5.10. I've set
up SER and implemented the radius accounting and it is working, except
that it will record the start and stop for a call, and then 20 seconds
later will create duplicate entries for the call. The duration is
exactly the same, except the start and stop are offset by 20 secs. Does
anyone know why this is happening? I've spent hours trawling the list
and haven't found a solution for the problem.<br>
<br>
I'm pretty new to SER to apologies if there is anything obviously wrong.<br>
<br>
<br>
My ser.cfg is as follows:<br>
<br>
check_via=no&nbsp;&nbsp;&nbsp; # (cmd. line: -v)<br>
dns=no&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # (cmd. line: -r)<br>
rev_dns=no&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # (cmd. line: -R)<br>
port=5060<br>
#children=4<br>
fifo=&quot;/tmp/ser_fifo&quot;<br>
<br>
# ------------------ module loading ----------------------------------<br>
<br>
# Uncomment this if you want to use SQL database<br>
<br>
loadmodule &quot;/usr/lib/ser/modules/sl.so&quot;<br>
loadmodule &quot;/usr/lib/ser/modules/tm.so&quot;<br>
loadmodule &quot;/usr/lib/ser/modules/rr.so&quot;<br>
loadmodule &quot;/usr/lib/ser/modules/maxfwd.so&quot;<br>
loadmodule &quot;/usr/lib/ser/modules/usrloc.so&quot;<br>
loadmodule &quot;/usr/lib/ser/modules/registrar.so&quot;<br>
loadmodule &quot;/usr/lib/ser/modules/textops.so&quot;<br>
<br>
loadmodule &quot;/usr/lib/ser/modules/auth.so&quot;<br>
loadmodule &quot;/usr/lib/ser/modules/auth_radius.so&quot;<br>
loadmodule &quot;/usr/lib/ser/modules/acc_radius.so&quot;<br>
# ----------------- setting module-specific parameters ---------------<br>
<br>
# -- usrloc params --<br>
<br>
modparam(&quot;usrloc&quot;, &quot;db_mode&quot;,&nbsp;&nbsp; 0)<br>
<br>
#set auth_radius exported parameters<br>
modparam(&quot;auth_radius&quot;,&quot;radius_config&quot;,&quot;/usr/local/etc/radiusclient/radiusclient.conf&quot;)<br>
modparam(&quot;auth_radius&quot;,&quot;service_type&quot;,12)<br>
<br>
# Uncomment this if you want to use SQL database <br>
# for persistent storage and comment the previous line<br>
#modparam(&quot;usrloc&quot;, &quot;db_mode&quot;, 2)<br>
<br>
# accounting stuff<br>
modparam(&quot;acc&quot;, &quot;log_level&quot;, 1)<br>
modparam(&quot;acc&quot;, &quot;log_flag&quot;, 1)<br>
modparam(&quot;acc&quot;, &quot;log_fmt&quot;, &quot;cdfimorstup&quot;)<br>
modparam(&quot;acc&quot;, &quot;radius_config&quot;, &quot;/usr/local/etc/radiusclient/radiusclient.conf&quot;)<br>
modparam(&quot;acc&quot;, &quot;radius_flag&quot;, 1)<br>
modparam(&quot;acc&quot;, &quot;radius_missed_flag&quot;, 3)<br>
modparam(&quot;acc&quot;, &quot;service_type&quot;, 15)<br>
modparam(&quot;acc&quot;, &quot;report_ack&quot;, 0)<br>
<br>
<br>
#random string for authentication<br>
modparam(&quot;auth&quot;, &quot;secret&quot;, &quot;59t8eu4gnajdfg98qbuoarisdfhgjv-98iuQE[AFJV9M8CRWUPDXIN&quot;)<br>
<br>
# -- auth params --<br>
# Uncomment if you are using auth module<br>
#<br>
#modparam(&quot;auth_db&quot;, &quot;calculate_ha1&quot;, yes)<br>
#<br>
# If you set &quot;calculate_ha1&quot; parameter to yes (which true in this config), <br>
# uncomment also the following parameter)<br>
#<br>
#modparam(&quot;auth_db&quot;, &quot;password_column&quot;, &quot;password&quot;)<br>
<br>
# -- rr params --<br>
# add value to ;lr param to make some broken UAs happy<br>
modparam(&quot;rr&quot;, &quot;enable_full_lr&quot;, 1)<br>
<br>
<br>
# -------------------------&nbsp; request routing logic -------------------<br>
<br>
# main routing logic<br>
<br>
route{<br>
<br>
&nbsp;&nbsp;&nbsp; if (!search(&quot;^(f|From):.*<a href="http://192.168.0.36">192.168.0.36</a>&quot;)) <br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; break;<br>
&nbsp;&nbsp;&nbsp; };<br>
<br>
&nbsp;&nbsp;&nbsp; # initial sanity checks -- messages with<br>
&nbsp;&nbsp;&nbsp; # max_forwards==0, or excessively long requests<br>
&nbsp;&nbsp;&nbsp; if (!mf_process_maxfwd_header(&quot;10&quot;)) <br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sl_send_reply(&quot;483&quot;,&quot;Too Many Hops&quot;);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; break;<br>
&nbsp;&nbsp;&nbsp; };<br>
&nbsp;&nbsp;&nbsp; if (msg:len &gt;=&nbsp; 2048 ) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sl_send_reply(&quot;513&quot;, &quot;Message too big&quot;);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; break;<br>
&nbsp;&nbsp;&nbsp; };<br>
<br>
&nbsp;&nbsp;&nbsp; #if a UA is attempting a register or invite, authorize him<br>
&nbsp;&nbsp;&nbsp; if(method == &quot;REGISTER&quot; || method == &quot;INVITE&quot;)<br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; log(1, &quot;Attempting to authenticate user on domain <a href="http://192.168.0.36">192.168.0.36</a>&quot;);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(!radius_www_authorize(&quot;<a href="http://192.168.0.36">192.168.0.36</a>&quot;))<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; log(1, &quot;User authentication on domain <a href="http://192.168.0.36">192.168.0.36</a> failed&quot;);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; www_challenge(&quot;<a href="http://192.168.0.36">192.168.0.36</a>&quot;,&quot;1&quot;);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; break;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; };<br>
&nbsp;&nbsp;&nbsp; };<br>
<br>
&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; # we record-route all messages -- to make sure that<br>
&nbsp;&nbsp;&nbsp; # subsequent messages will go through our proxy; that's<br>
&nbsp;&nbsp;&nbsp; # particularly good if upstream and downstream entities<br>
&nbsp;&nbsp;&nbsp; # use different transport protocol<br>
&nbsp;&nbsp;&nbsp; if (!method==&quot;REGISTER&quot;) record_route();&nbsp;&nbsp;&nbsp; <br>
<br>
&nbsp;&nbsp;&nbsp; if (method == &quot;ACK&quot;)<br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; route(2);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; break;<br>
&nbsp;&nbsp;&nbsp; };<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; if (method==&quot;INVITE&quot;) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
log(1, &quot;INVITE MESSAGE RECEIVED - START ACCOUNTING\n&quot;);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setflag(1);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (method==&quot;BYE&quot; || method==&quot;CANCEL&quot;) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
log (1, &quot;BYE/CANCEL RECEIVED - STOP ACCOUNTING\n&quot;);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setflag(1);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; route(2);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; break;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<br>
<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; # subsequent messages withing a dialog should take the<br>
&nbsp;&nbsp;&nbsp; # path determined by record-routing<br>
&nbsp;&nbsp;&nbsp; if (loose_route()) <br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # mark routing logic in request<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; append_hf(&quot;P-hint: rr-enforced\r\n&quot;); <br>
&nbsp;&nbsp;&nbsp; };<br>
<br>
&nbsp;&nbsp;&nbsp; if (!uri==myself) &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # mark routing logic in request<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; append_hf(&quot;P-hint: outbound\r\n&quot;); <br>
&nbsp;&nbsp;&nbsp; };<br>
<br>
&nbsp;&nbsp;&nbsp; # if the request is for other domain use UsrLoc<br>
&nbsp;&nbsp;&nbsp; # (in case, it does not work, use the following command<br>
&nbsp;&nbsp;&nbsp; # with proper names and addresses in it)<br>
&nbsp;&nbsp;&nbsp; if (uri==myself) <br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (method==&quot;REGISTER&quot;) <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; log(1, &quot;User registered on domain <a href="http://192.168.0.36">192.168.0.36</a>&quot;);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; save(&quot;location&quot;);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sl_send_reply(&quot;200&quot;, &quot;ok&quot;);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; break;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
#&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; lookup(&quot;aliases&quot;);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # native SIP destinations are handled using our USRLOC DB<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (!lookup(&quot;location&quot;)) <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; log(1, &quot;Unknown user referenced for domain
<a href="http://192.168.0.36">192.168.0.36</a>, exiting (404)&quot;);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sl_send_reply(&quot;404&quot;, &quot;Not Found&quot;);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; break;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; };<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; };<br>
&nbsp;&nbsp;&nbsp; };<br>
&nbsp;&nbsp;&nbsp; append_hf(&quot;P-hint: usrloc applied\r\n&quot;); <br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; route(2);<br>
&nbsp;&nbsp;&nbsp; <br>
}<br>
<br>
route[2]<br>
{<br>
&nbsp;&nbsp;&nbsp; if (!t_relay()) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sl_reply_error();<br>
&nbsp;&nbsp;&nbsp; };<br>
&nbsp;&nbsp;&nbsp; <br>
}<br>
<br>
<br>
The accounting logs are as follows:<br>
<br>
Wed Apr 19 <span style="font-weight: bold;">12:20:43</span> 2006<br>
&nbsp;&nbsp;&nbsp; Acct-Status-Type = Start<br>
&nbsp;&nbsp;&nbsp; Service-Type = Sip-Session<br>
&nbsp;&nbsp;&nbsp; Sip-Response-Code = 200<br>
&nbsp;&nbsp;&nbsp; Sip-Method = 1<br>
&nbsp;&nbsp;&nbsp; User-Name = &quot;<a href="mailto:seb@192.168.0.36">seb@192.168.0.36</a>&quot;<br>
&nbsp;&nbsp;&nbsp; Calling-Station-Id = &quot;<a href="mailto:sip:Seb@192.168.0.36">sip:Seb@192.168.0.36</a>&quot;<br>
&nbsp;&nbsp;&nbsp; Called-Station-Id = &quot;<a href="mailto:sip:0824152727@192.168.0.36">sip:0824152727@192.168.0.36</a>&quot;<br>
&nbsp;&nbsp;&nbsp; Sip-Translated-Request-URI = &quot;sip:0824152727@192.168.0.37:5070&quot;<br>
&nbsp;&nbsp;&nbsp; Acct-Session-Id = &quot;<span style="font-weight: bold;"><a href="mailto:xzszxqjpwygwkky@192.168.0.36">xzszxqjpwygwkky@192.168.0.36</a></span>&quot;<br>
&nbsp;&nbsp;&nbsp; Sip-To-Tag = &quot;8004&quot;<br>
&nbsp;&nbsp;&nbsp; Sip-From-Tag = &quot;lazwk&quot;<br>
&nbsp;&nbsp;&nbsp; Sip-Cseq = &quot;778&quot;<br>
&nbsp;&nbsp;&nbsp; NAS-Port = 5060<br>
&nbsp;&nbsp;&nbsp; Acct-Delay-Time = 0<br>
&nbsp;&nbsp;&nbsp; NAS-IP-Address = <a href="http://127.0.0.1">127.0.0.1</a><br>
&nbsp;&nbsp;&nbsp; Client-IP-Address = <a href="http://127.0.0.1">127.0.0.1</a><br>
&nbsp;&nbsp;&nbsp; Acct-Unique-Session-Id = &quot;1877d2d9ca784853&quot;<br>
&nbsp;&nbsp;&nbsp; Stripped-User-Name = &quot;seb&quot;<br>
&nbsp;&nbsp;&nbsp; Realm = &quot;<a href="http://192.168.0.36">192.168.0.36</a>&quot;<br>
&nbsp;&nbsp;&nbsp; Freeradius-Proxied-To = <a href="http://192.168.0.36">192.168.0.36</a><br>
&nbsp;&nbsp;&nbsp; Timestamp = 1145442043<br>
<br>
Wed Apr 19 <span style="font-weight: bold;">12:20:51</span> 2006<br>
&nbsp;&nbsp;&nbsp; Acct-Status-Type = Stop<br>
&nbsp;&nbsp;&nbsp; Service-Type = Sip-Session<br>
&nbsp;&nbsp;&nbsp; Sip-Response-Code = 200<br>
&nbsp;&nbsp;&nbsp; Sip-Method = 8<br>
&nbsp;&nbsp;&nbsp; User-Name = &quot;<a href="mailto:0824152727@192.168.0.36">0824152727@192.168.0.36</a>&quot;<br>
&nbsp;&nbsp;&nbsp; Calling-Station-Id = &quot;<a href="mailto:sip:0824152727@192.168.0.36">sip:0824152727@192.168.0.36</a>&quot;<br>
&nbsp;&nbsp;&nbsp; Called-Station-Id = &quot;<a href="mailto:sip:Seb@192.168.0.36">sip:Seb@192.168.0.36</a>&quot;<br>
&nbsp;&nbsp;&nbsp; Sip-Translated-Request-URI = &quot;sip:Seb_192_168_0_36@192.168.0.36:5061&quot;<br>
&nbsp;&nbsp;&nbsp; Acct-Session-Id = &quot;<span style="font-weight: bold;"><a href="mailto:xzszxqjpwygwkky@192.168.0.36">xzszxqjpwygwkky@192.168.0.36</a></span>&quot;<br>
&nbsp;&nbsp;&nbsp; Sip-To-Tag = &quot;lazwk&quot;<br>
&nbsp;&nbsp;&nbsp; Sip-From-Tag = &quot;8004&quot;<br>
&nbsp;&nbsp;&nbsp; Sip-Cseq = &quot;391&quot;<br>
&nbsp;&nbsp;&nbsp; NAS-Port = 5060<br>
&nbsp;&nbsp;&nbsp; Acct-Delay-Time = 0<br>
&nbsp;&nbsp;&nbsp; NAS-IP-Address = <a href="http://127.0.0.1">127.0.0.1</a><br>
&nbsp;&nbsp;&nbsp; Client-IP-Address = <a href="http://127.0.0.1">127.0.0.1</a><br>
&nbsp;&nbsp;&nbsp; Acct-Unique-Session-Id = &quot;badf62373eccd795&quot;<br>
&nbsp;&nbsp;&nbsp; Stripped-User-Name = &quot;0824152727&quot;<br>
&nbsp;&nbsp;&nbsp; Realm = &quot;<a href="http://192.168.0.36">192.168.0.36</a>&quot;<br>
&nbsp;&nbsp;&nbsp; Freeradius-Proxied-To = <a href="http://192.168.0.36">192.168.0.36</a><br>
&nbsp;&nbsp;&nbsp; Timestamp = 1145442051<br>
<br>
As you can see, it seems to be generating another accounting report
corresponding to a call going the other way. The first entry is
correct. The second just seems to appear 20 secs after the call has
been disconnected. There are corresponding stops for both entries as
well as entries into the mysql database. Any ideas?<br>
<br>
Thanks in advance<br>
Sebastian<br>