diff --git a/scripts/Cisco/importRadius.php b/scripts/Cisco/importRadius.php index 592ea99..0ed66e6 100644 --- a/scripts/Cisco/importRadius.php +++ b/scripts/Cisco/importRadius.php @@ -1,50 +1,51 @@ #!/usr/bin/php -import($argv[1],$argv[2]); + $CDRS->import($argv[1], $argv[2]); print "Normalizing cdrs: "; - $results=$CDRS->NormalizeCDRS(); + $results = $CDRS->NormalizeCDRS(); print "$results[total] not yet normalized calls,$results[success] normalized,$results[failure] skipped\n"; } -function checkArguments($argv) { - $PHP_SELF=$_SERVER['PHP_SELF']; - $c=count($argv); +function checkArguments($argv) +{ + $PHP_SELF = $_SERVER['PHP_SELF']; + $c = count($argv); if (!count($argv) || count($argv) < 2 || count($argv) > 3) { - print "Syntax: $PHP_SELF radacctFile [timezone]\n"; - print "Example: $PHP_SELF /tmp/detail-20040221 Europe/Amsterdam\n"; + print "Syntax: $PHP_SELF radacctFile [timezone]\n"; + print "Example: $PHP_SELF /tmp/detail-20040221 Europe/Amsterdam\n"; return 0; } if (!is_readable($argv[1])) { print "Error: cannot open file $argv[1]\n"; return 0; } if ($argv[2]) { - $TZfile=$path."../../timezones"; - $tzones=explode("\n",file_get_contents($TZfile)); - if (!in_array($argv[2],$tzones)) { - print "Error: unexisting timezone $argv[2]. See timezones file for available timezones.\n"; + $TZfile = $path."../../timezones"; + $tzones = explode("\n", file_get_contents($TZfile)); + if (!in_array($argv[2], $tzones)) { + print "Error: unexisting timezone $argv[2]. See timezones file for available timezones.\n"; return 0; } } return 1; } ?> diff --git a/scripts/ratingEngine.php b/scripts/ratingEngine.php index 7f8dbab..0453b22 100644 --- a/scripts/ratingEngine.php +++ b/scripts/ratingEngine.php @@ -1,36 +1,41 @@ #!/usr/bin/php -init_ok) { - syslog(LOG_NOTICE,'Error: Cannot start Rating Engine, fix the errors and try again'); + syslog(LOG_NOTICE, 'Error: Cannot start Rating Engine, fix the errors and try again'); exit; } -syslog(LOG_NOTICE,"Rating Engine started sucesfully, going to background..."); +syslog(LOG_NOTICE, "Rating Engine started sucesfully, going to background..."); // Go to the background $d = new Daemon('/var/run/ratingEngine.pid'); $d->start(); $daemon = new socketDaemon(); -$server = $daemon->create_server('ratingEngineServer', 'ratingEngineClient', $RatingEngine['socketIP'], $RatingEngine['socketPort']); - -syslog(LOG_NOTICE,"Rating Engine is now ready to serve network requests"); +$server = $daemon->create_server( + 'ratingEngineServer', + 'ratingEngineClient', + $RatingEngine['socketIP'], + $RatingEngine['socketPort'] +); + +syslog(LOG_NOTICE, "Rating Engine is now ready to serve network requests"); $daemon->process(); ?>