[Kamailio-Users] CDRTool 6.6.4 with freeradius-cdrtool

Graham Wooden graham at g-rock.net
Tue Oct 7 16:57:20 CEST 2008


Hi Craig, it's attached.
Thanks,

-graham

-------------- next part --------------


<?

#
# 1. Change all hostnames and passwords according to the installation
# 2. Copy this file to /etc/cdrtool/global.inc
#

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

$CDRTool['tld']    = "/cdr";
$CDRTool['Path']   = "/var/www/html/cdr";
$_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 example.com";
$CDRTool['provider']['toEmail']               = "support at example.com";
$CDRTool['provider']['sampleLoginSubscriber'] = "number at example.com";
$CDRTool['provider']['sampleLoginDomain']     = "example.com";

###########################################
# Rating engine settings
$RatingEngine=array("socketIP"               => "127.0.0.1",
                    "socketPort"             => "9024",
                    "CDRS_class"             => "ser_radius",
                    "prepaid_lock"           => true,
                    "log_delay"              => 0.05,
                    "split_rating_table"     => false,
                    "csv_delimiter"          => ",",
                    "priceDenominator"       => 10000, // e.g. 1 Eur = 10000 units
                    "priceDecimalDigits"     => 4,     // how many digits to round the prices to
                    "minimumDurationCharged" => 0,     // Only calls greater than this duration will be charged
                    "durationPeriodRated"    => 60,    // the prices from the rating table are calculated per this period
                    "trafficSizeRated"       => 1024,  // same as above but for data traffic
                    "reportMissingRates"     => 0,     // send email notifications if rates are missing from the ratingEngine
                    "minimumDuration"        => 0,     // minimum duration to rate, if call duration is shorter the price is zero
                    "allow"                  => array ('10.'),  // list with local network clients allowed to connect
                    "MaxSessionTime"         => 36000  // limit all prepaid calls to maximum 10 hours
                    );

###########################################
# Normalize engine settings
$CDRTool['normalize']['defaultCountryCode']      = "1";

###########################################
# Anti-fraud settings
# create group quota in OpenSER and deny calls to users in this group
$UserQuota["default"]["traffic"]  = 5000;            // MBytes
# $UserQuota["default"]["cost"]     = 1000;              // Euro

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

class DB_CDRTool extends DB_Sql {
  var $Host     = "localhost";
  var $Database = "cdrtool";
  var $User     = "cdradmin";
  var $Password = "xxxxxxx";
  var $Halt_On_Error ="yes";
}

class DB_Locker extends DB_Sql {
  var $Host     = "localhost";
  var $Database = "cdrtool";
  var $User     = "locker";
  var $Password = "xxxxxxx";
  var $Halt_On_Error ="yes";
}

class DB_radius extends DB_Sql {
  var $Host     = "localhost";
  var $Database = "radius";
  var $User     = "cdradmin";
  var $Password = "xxxxxx";
  var $Halt_On_Error ="yes";
}

class DB_radius2 extends DB_Sql {
  var $Host     = "localhost";
  var $Database = "radius";
  var $User     = "cdradmin";
  var $Password = "xxxxxx";
  var $Halt_On_Error ="no";
}

class DB_subscribers extends DB_Sql {
  var $Host     = "localhost";
  var $Database = "openser";
  var $User     = "openser";
  var $Password = "xxxxxxxx";
  var $Halt_On_Error ="yes";
}

class DB_openser extends DB_Sql {
  var $Host     = "localhost";
  var $Database = "openser";
  var $User     = "openser";
  var $Password = "xxxxxxx";
  var $Halt_On_Error ="yes";
}

class DB_siptrace extends DB_Sql {
  var $Host     = "localhost";
  var $Database = "cdrtool";
  var $User     = "cdradmin";
  var $Password = "xxxxxxxx";
  var $Halt_On_Error ="no";
}

class DB_mediaproxy extends DB_Sql {
  var $Host     = "sipdb";
  var $Database = "mediaproxy";
  var $User     = "mediaproxy";
  var $Password = "PASSWORD";
  var $Halt_On_Error ="no";
}

$replicated_databases=array('cluster1'=>array(
                                              "db1"=>array('ip'      =>'10.0.0.131',
                                                               'slave_of'=>'db-log2',
                                                               'user'    =>'process',
                                                               'password'=>'password',
                                                               'replication_user'    =>'replication',
                                                               'replication_password'=>'password',
                                                               'active_master' => true
                                                               ),
                                              "db2"=>array('ip'      =>'10.0.0.132',
                                                               'slave_of'=>'db-log1',
                                                               'user'    =>'process',
                                                               'password'=>'password',
                                                               'replication_user'    =>'replication',
                                                               'replication_password'=>'password'
                           )                                    )
                 );

class DomainAuthLocal extends DomainAuth {      // defined in phplib/local.inc
}

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

# To customize E164 normalization
class E164_custom extends E164 {      // defined in library/cdr_lib.phtml
}
# $CDRTool['normalize']['E164Class']           = "E164_custom";


$DATASOURCES=array(
"unknown"=>array(
                    "class"              => "CDRS_unknown" // leave it here
                    ),
"ser_radius"=>array(
                    "name"               => "OpenSER",
                    "class"              => "CDRS_ser_radius",
                    "table"              => "radacct".date("Ym"),
                    "db_class"           => array("DB_radius"),
                    "rating"             => "1",
                    "normalizedField"    => "Normalized",
                    "UserQuotaClass"     => "OpenSERQuota",
                    "AccountsDBClass"    => "DB_openser",
                    "UserQuotaNotify"    => "1",
                    "purgeCDRsAfter"     => 120, // how many days to keep the CDRs
                    "SIPProxies"         => array("10.0.0.1" => "node01",  // friendly names in sip trace table
                                                  "10.0.0.2" => "node02",
                                                ),
                    "db_class_siponline" => "DB_openser",
                    "mediaDispatcher"    => "10.0.0.1"  // where to get the active media sessions from MediaProxy 2.0
                    ),
"asterisk_vm"  =>array("name"            => "Voicemail server",
                    "class"              => "CDRS_asterisk",
                    "table"              => "asterisk_cdr",
                    "db_class"           => "DB_radius",
                    "rating"             => "1",
                    "normalizedField"    => "Normalized",
                    "contexts"           => array(
                                            "SIP"=>array("WEBName"=>"OpenSER"),
                                            ),
                    "traceInURL"         => array(
                                            "SIP"=>"ser_radius"
                                                        ),
                    "traceOutURL"        => array(),
                    "purgeCDRsAfter"    => 180 // how many days to keep the CDRs
                    ),
"sip_trace"   =>array(
                    "name"               => "SIP trace",
                    "db_class"           => "DB_siptrace",
                    "table"              => "sip_trace",
                    "enableThor"         => false,
                    "purgeRecordsAfter"  => "7",
                    "invisible"          => 1
                    ),
"media_trace"   =>array(
                    "name"               => "Media trace",
                    "db_class"           => "DB_mediaproxy",
                    "enableThor"         => false,
                    "invisible"          => 1
                    )

);

// load CDRTool libraries
$CDRToolModules=array("openser","asterisk");

if ($_SERVER['REMOTE_ADDR']=="10.0.0.1") {
    //$verbose=1;
} else {
    // prevent set of verbose via post/get
    unset($verbose);
}
?>


More information about the Users mailing list