[OpenSIPS-Users] CDRtool freeradius mysql error

osiris123d duane.larson at gmail.com
Sun Dec 20 22:45:11 CET 2009


Here is the global.inc
<?

# Copy this file to /etc/cdrtool/global.inc

###########################################
# System and web paths

$CDRTool['tld']    = "/CDRTool";
$CDRTool['Path']   = "/var/www/CDRTool";
$_PHPLIB['libdir'] = $CDRTool['Path']. "/phplib/";
include($_PHPLIB["libdir"] . "prepend.php3");

###########################################
# PHP Error reporting
$errorReporting = (E_ALL & ~E_NOTICE);
$errorReporting = 1;    // comment this out to enable PHP warnings
error_reporting($errorReporting);

###########################################
# Service provider information 
$CDRTool['provider']['name']                  = "Provider name";
$CDRTool['provider']['service']               = "SIP service";
$CDRTool['provider']['timezone']              = "America/Chicago";
$CDRTool['provider']['fromEmail']             = "support at ae.com";
$CDRTool['provider']['toEmail']               = "support at ae.com";
$CDRTool['provider']['sampleLoginSubscriber'] = "number at ae.com";
$CDRTool['provider']['sampleLoginDomain']     = "ae.com";

###########################################
# Rating engine settings
$RatingEngine=array("socketIP"               => "12.*.*.*",
                    "socketPort"             => "9024",
                    "cdr_source"             => "opensips_radius",
                    "allow"                  => array ('12.*.*.*')
                    );
###########################################
# Normalize engine settings
$CDRTool['normalize']['defaultCountryCode']      = "1";

###########################################
# Build graphical statistics for these domains:
$CDRTool['statistics']['domains']=array("example.com");

###########################################
# Anti-fraud settings
$UserQuota["default"]["cost"]     = 1000;

###########################################
# CDRTool databases

class DB_CDRTool extends DB_Sql {
  var $Host     = "12.*.*.*";
  var $Database = "cdrtool";
  var $User     = "cdradmin";
  var $Password = "cdr";
  var $Halt_On_Error ="yes";
}

class DB_Locker extends DB_Sql {
  var $Host     = "12.*.*.*";
  var $Database = "cdrtool";
  var $User     = "locker";
  var $Password = "lockadm18";
  var $Halt_On_Error ="yes";
}

class DB_radius extends DB_Sql {
  var $Host     = "12.*.*.*";
  var $Database = "radius";
  var $User     = "radius";
  var $Password = "cdr";
  var $Halt_On_Error ="yes";
}

class DB_opensips extends DB_Sql {
  var $Host     = "66.*.*.*";
  var $Database = "opensips";
  var $User     = "opensips";
  var $Password = "op";
  var $Halt_On_Error ="yes";
}

class DB_mediaproxy extends DB_Sql {
  var $Host     = "12.*.*.*";
  var $Database = "mediaproxy";
  var $User     = "mediaproxy";
  var $Password = "cdr";
  var $Halt_On_Error ="yes";
}

// Subscriber login
class DomainAuthLocal extends OpenSIPS_DomainAuth {     // defined in
phplib/local.inc
}

class PageLayoutLocal extends PageLayout {      // defined in
phplib/local.inc
}

###########################################
# CDRTool datasources

$DATASOURCES=array(
"unknown"        => array("class"              => "CDRS_unknown"),
"opensips_radius"=> array(
                    "name"               => "OpenSIPS Proxy/Registrar",
                    "class"              => "CDRS_opensips",
                    "db_class"           => "DB_radius",
                    "table"              => "radacct".date("Ym"),
                    "normalizedField"    => "Normalized",
                    "rating"             => "1",
                    "db_subscribers"     => "DB_opensips",
                    "db_registrar"       => "DB_opensips",
                    "UserQuotaClass"     => "OpenSIPSQuota",
                    "UserQuotaNotify"    => "1",
                    "sipTrace"           => "sip_trace",
                    "mediaTrace"         => "media_trace",
                    "mediaDispatcher"    => "tls:66.*.*.*:25061"
                    ),
"asterisk_vm"  => array("name"            => "Voicemail server",
                    "class"              => "CDRS_asterisk",
                    "table"              => "asterisk_cdr",
                    "db_class"           => "DB_radius",
                    "rating"             => "0",
                    "normalizedField"    => "Normalized",
                    "purgeCDRsAfter"    => 180 // how many days to keep the
CDRs
                    ),
"sip_trace"   => array(
                    "name"               => "SIP trace",
                    "db_class"           => "DB_opensips",
                    "table"              => "sip_trace",
                    "mediaTrace"         => "media_trace",
                    "purgeRecordsAfter"  => "7",
                    "invisible"          => 1 
                    ),
"media_trace"   =>array(
                    "name"               => "Media trace",
                    "db_class"           => "DB_mediaproxy",
                    "invisible"          => 1 
                    )

);

###########################################
# Load libraries from library/cdr_* 
$CDRToolModules=array("opensips","asterisk");

?>




Here is sql.conf
#
#  Configuration for the Freeradius SQL module, when using MySQL stored
procedures 
#  that rotate automatically tables in the format radacctYYYYMM
#
#  It requires:
#
#      1. mediaproxy >=1.8.0 available from
http://mediaproxy.ag-projects.com
#
#      2. patch to freeradius to support stored procedures available in
#         setup/radius/freeradius/freeradius.patch
#
#      3. MySQL server >= 5.0.13
#
#      4. MySQL stored procedures created by Andrei Magureanu available in
#         setup/radius/OpenSIPS/radius_accounting.proc
#
#
sql {
    driver                      = "rlm_sql_mysql"
    server                      = "12.*.*.*"
    login                       = "radius"
    password                    = "cdr"
    radius_db                   = "radius"
    sqltrace                    = no
    sqltracefile                = ${logdir}/sqltrace-%Y%m%d.log
    num_sql_socks               = 25
    connect_failure_retry_delay = 60

    accounting_start_query      = "\
          CALL insert_radacct_record( \
                'radius', \
                '%{Acct-Session-Id}', \
                '%{Acct-Unique-Session-Id}', \
                '%{Billing-Party}', \
                '%{Billing-Party}', \
                '%{SIP-Proxy-IP}', \
                '%{NAS-Port}', \
                '%S', \
                '0', \
                '0', \
                '0', \
                '0', \
                '%{Called-Station-Id}', \
                '%{Calling-Station-Id}', \
                '%{Sip-Response-Code}', \
                '%{Service-Type}', \
                '%{ENUM-TLD}', \
                '%{Framed-IP-Address}', \
                '%{Acct-Delay-Time}', \
                '0', \
                '%{Sip-Response-Code}', \
                '%{Sip-Method}', \
                '%{Sip-Translated-Request-URI}', \
                '%{Sip-To-Tag}', \
                '%{Sip-From-Tag}', \
                '%{Sip-RPId}', \
                '%{Source-IP}', \
                '%{Source-Port}', \
                '%{Canonical-URI}', \
                '', \
                '' \
                )"

    accounting_stop_query       = "\
          CALL update_radacct_record( \
                'radius', \
                '%S', \
                '%{Acct-Delay-Time}', \
                '%{Connect-Info}', \
                '%{X-RTP-Stat}', \
                 '%{Acct-Session-Id}', \
                '%{Sip-To-Tag}', \
                '%{Sip-From-Tag}' \
                )"

    accounting_update_query       = "\
          CALL update_raddact_record_mediaproxy( \
                'radius', \
                '%{Acct-Session-Time}', \
                '%{Acct-Input-Octets}', \
                '%{Acct-Output-Octets}', \
                '%{Sip-User-Agents}', \
                '%{Media-Codecs}', \
                '%{Sip-Applications}', \
                '%{Media-Info}', \
                '0', \
                '%{Acct-Session-Id}', \
                '%{Sip-To-Tag}', \
                '%{Sip-From-Tag}' \
                )"

    accounting_failed_query     = "\
          CALL insert_radacct_record( \
                'radius', \
                '%{Acct-Session-Id}', \
                '%{Acct-Unique-Session-Id}', \
                '%{Billing-Party}', \
                '%{Billing-Party}', \
                '%{SIP-Proxy-IP}', \
                '%{NAS-Port}', \
                '%S', \
                '%S', \
                '0', \
                '0', \
                '0', \
                '%{Called-Station-Id}', \
                '%{Calling-Station-Id}', \
                '%{Sip-Response-Code}', \
                '%{Service-Type}', \
                '%{ENUM-TLD}', \
                '%{Framed-IP-Address}', \
                '%{Acct-Delay-Time}', \
                '0', \
                '%{Sip-Response-Code}', \
                '%{Sip-Method}', \
                '%{Sip-Translated-Request-URI}', \
                MD5(RAND()), \
                '%{Sip-From-Tag}', \
                '%{Sip-RPId}', \
                '%{Source-IP}', \
                '%{Source-Port}', \
                '%{Canonical-URI}', \
                '', \
                '' \
                )"
}


Adrian Georgescu wrote:
> 
> I did install and test all components that you mentioned on a test  
> machine and I could get everything working without any problem.
> 
> Can you provide a copy of your CDRTool global.inc and FreeRadius  
> sql.conf configuration files?
> 
> --
> Adrian
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> 
> 

-- 
View this message in context: http://n2.nabble.com/CDRtool-freeradius-mysql-error-tp4192209p4196071.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.



More information about the Users mailing list