[Serusers] Accounting problem

Raymond Chen rchen at cityabove.net
Fri Apr 8 03:00:13 CEST 2005


Adding to your problem, I see radius accounting also missing about 30% of
the calls according to our pstn carrier's CDR log. Any idea?

Ray 

-----Original Message-----
From: serusers-bounces at iptel.org [mailto:serusers-bounces at lists.iptel.org] On
Behalf Of yy
Sent: Friday, April 08, 2005 8:36 AM
To: serusers at lists.iptel.org
Subject: [Serusers] Accounting problem

Hi,

I'm new to freeradius and SER, hence I'm having some problem in 
accounting calls from my sip phone. My configuration file (ser.cfg) for 
my SER is as follows, and currently the radius accounting module is used 
to keep track of start and stop times for VoIP calls made.

The accounting log details that I'm getting from freeradius is as 
follows - note that I do not get any start or stop auth-type!

Please help as this is quite urgent :-)

Regards,
YY

ACCOUNTING DETAILS
-----------------------------

Thu Apr  7 16:53:19 2005
       Acct-Status-Type = Failed  ----------Why ?
       Service-Type = Sip-Session
       Sip-Response-Code = 0
       Sip-Method = 1
       User-Name = "1001 at orion.lab.test.com.au"
       Calling-Station-Id = "sip:1001 at orion.lab.test.com.au"
       Called-Station-Id = "sip:998301816 at orion.lab.test.com.au"
       Sip-Translated-Req-ID = "sip:998301816 at orion.lab.test.com.au"
       Acct-Session-Id = "000ded22-eeb205c0-365a670c-525c3b7a at 192.168.4.2"
       Sip-To-Tag = "n/a"
       Sip-From-Tag = "000ded22eeb2008b35455873-1507a868"
       Sip-Cseq = "101"
       NAS-IP-Address = 192.168.1.2
       NAS-Port = 5060
       Acct-Delay-Time = 0
       Client-IP-Address = 127.0.0.1
       Acct-Unique-Session-Id = "1a95db24d20f72a1"
       Realm = "orion.lab.test.com.au"
       Timestamp = 1112863999

Thu Apr  7 17:39:44 2005
       Acct-Status-Type = Failed ------------- Why ?
       Service-Type = Sip-Session
       Sip-Response-Code = 0
       Sip-Method = 1
       User-Name = "1001 at orion.lab.test.com.au"
       Calling-Station-Id = "sip:1001 at orion.lab.test.com.au"
       Called-Station-Id = "sip:998301816 at orion.lab.test.com.au"
       Sip-Translated-Req-ID = "sip:998301816 at orion.lab.test.com.au"
       Acct-Session-Id = "000ded22-eeb205d1-3c4c2845-497b0e71 at 192.168.4.2"
       Sip-To-Tag = "n/a"
       Sip-From-Tag = "000ded22eeb2008c4a24089e-7fba04fa"
       Sip-Cseq = "101"
       NAS-IP-Address = 192.168.1.2
       NAS-Port = 5060
       Acct-Delay-Time = 0
       Client-IP-Address = 127.0.0.1
       Acct-Unique-Session-Id = "fa9197df9e254d17"
       Realm = "orion.lab.test.com.au"
       Timestamp = 1112866784


SER.CFG
-----------

#
# simple quick-start config script
#

# ----------- global configuration parameters ------------------------

# Uncomment these lines to enter debugging mode
debug=7
fork=yes
listen=192.168.1.2
# replies should include extensive warnings
sip_warning=yes
# locally generated messages should include server's signature
server_signature=yes
log_stderror=yes
check_via=no    # (cmd. line: -v)
dns=no           # (cmd. line: -r)
rev_dns=no      # (cmd. line: -R)
fifo="/tmp/ser_fifo"

# ------------------ module loading ----------------------------------

# Uncomment this if you want to use SQL database
loadmodule "/usr/local/lib/ser/modules/mysql.so"
loadmodule "/usr/local/lib/ser/modules/sl.so"
loadmodule "/usr/local/lib/ser/modules/tm.so"
loadmodule "/usr/local/lib/ser/modules/rr.so"
loadmodule "/usr/local/lib/ser/modules/maxfwd.so"
loadmodule "/usr/local/lib/ser/modules/usrloc.so"
loadmodule "/usr/local/lib/ser/modules/registrar.so"
loadmodule "/usr/local/lib/ser/modules/exec.so"
loadmodule "/usr/local/lib/ser/modules/uri.so"
loadmodule "/usr/local/lib/ser/modules/textops.so"

# RADIUS support
loadmodule "/usr/local/lib/ser/modules/acc.so"

# Uncomment this if you want digest authentication
# mysql.so must be loaded !
loadmodule "/usr/local/lib/ser/modules/auth.so"
loadmodule "/usr/local/lib/ser/modules/auth_radius.so"

# ----------------- setting module-specific parameters ---------------

# -- usrloc params --

# Uncomment this if you want to use SQL database
# for persistent storage and comment the previous line
modparam("usrloc", "db_mode", 2)

# -- rr params --
# add value to ;lr param to make some broken UAs happy
modparam("rr", "enable_full_lr", 1)

# -- acc params --
modparam("acc", "radius_config", 
"/usr/local/etc/radiusclient/radiusclient.conf")
modparam("acc", "radius_missed_flag", 2)
modparam("acc", "radius_flag", 1)

# -- auth_radius params --
modparam("auth_radius", "radius_config", 
"/usr/local/etc/radiusclient/radiusclient.conf")

# -------------------------  request routing logic -------------------

# main routing logic

   route{

       # initial sanity checks -- messages with
       # max_forwards==0, or excessively long requests
       if (!mf_process_maxfwd_header("10")) {
           log(1,"LOG: Too many hops");
           sl_send_reply("483","Too Many Hops");
           break;
       };
       if ( msg:len > max_len ) {
           log(1,"LOG: Message too big");
           sl_send_reply("513", "Message too big");
           break;
       };

# loose-route processing
       if(loose_route()){
               t_relay();
               break;
       };

       if(uri==myself){

           # All REGISTER attempts are processed and must always be 
authenticated
           if (method=="REGISTER"){
               if (!radius_www_authorize("")) {
                   www_challenge("", "0");
                   break;
               };

               save("location");
                       break;
           };

           # destinations routed through gateway
           if(uri=~"^sip:[0-9]{5,20}@.*"){
               route(1);
               break;
           };

           setflag(3);
       route(2);
       };
   }

#########################################################################
#                       Route Processing                                #
#########################################################################

# leaving internet for PSTN
route[1]{

   ### PROBLEM WITH ACCOUNTING HERE ......
       setflag(1);
       if (method=="INVITE") {
                       acc_rad_request("Start");
                       record_route();
               };

               if (method=="BYE") {
                       acc_rad_request("Stop");
               };

               if (method=="REGISTER" || method=="INVITE" || 
method=="BYE" || method=="CANCEL") {
                       #Save messages in mysql for CDRTool
                       exec_msg("/usr/local/etc/sertrace.py; exit 1");
               };

               if (uri=~"^sip:9[0-9]*@orion.lab.test.com.au") {       
##  This assumes that the caller is
                       log(1, "Forwarding to PSTN");                   
##  registered in our realm
                       forward(192.168.1.1, 5060);                     
##  Our Cisco router
                       break;
               };

               # native SIP destinations are handled using our USRLOC DB
               if (!lookup("location")) {
                       sl_send_reply("404", "Not Found");
                       break;
               };

}

# process aliased outbound traffic
route[2]{
   if(!t_relay()){
       sl_reply_error();
       break;
   };
}


_______________________________________________
Serusers mailing list
serusers at lists.iptel.org
http://lists.iptel.org/mailman/listinfo/serusers






More information about the sr-users mailing list