コード例 #1
0
ファイル: a2billing.php プロジェクト: sayemk/a2billing
$agi_version = "Asterisk2Billing - Version v220/xrg - Alpha";
$conf_file = NULL;
if ($argc > 1 && ($argv[1] == '--version' || $argv[1] == '-V')) {
    echo "A2Billing - Version {$agi_version} - {$agi_date}\n";
    exit;
}
$verbose_mode = false;
if ($argc > 1 && ($argv[1] == '--verbose' || $argv[1] == '-v')) {
    AGI::verbose_s("Verbose mode!", 0);
    error_reporting(E_ALL);
    $verbose_mode = true;
    array_shift($argv);
    $argc--;
}
if ($argc > 1 && $argv[1] == '--test') {
    AGI::verbose_s("Testing mode!", 0);
    define('DEFAULT_CONFIG', "../a2billing.conf");
    array_shift($argv);
    $argc--;
} else {
    define('DEFAULT_CONFIG', '/etc/a2billing.conf');
}
require_once 'Class.A2Billing.inc.php';
// create the objects
$a2b = A2Billing::instance();
if (!$a2b->load_res_dbsettings('/etc/asterisk/res_pgsql.conf')) {
    @syslog(LOG_ERR, "Cannot fetch settings from res_pgsql.conf");
    exit(2);
}
$dynconf = DynConf::instance();
if ($argc > 1 && is_numeric($argv[1]) && $argv[1] >= 0) {