case 'campaign-callback': $mode = 'campaign-callback'; break; case 'conference-moderator': $mode = 'conference-moderator'; break; case 'conference-member': $mode = 'conference-member'; break; case 'auto-did-callback-cid': $mode = 'auto'; break; case 'auto': $mode = 'auto'; break; default: $mode = 'standard'; break; } } else $mode = 'standard'; $A2B = new A2Billing(); $A2B -> load_conf($agi, NULL, 0, $idconfig, $optconfig); $A2B -> mode = $mode; $A2B -> G_startime = $G_startime; $A2B -> debug( INFO, $agi, __FILE__, __LINE__, "IDCONFIG : $idconfig"); $A2B -> debug( INFO, $agi, __FILE__, __LINE__, "MODE : $mode"); // get the area code for the cid-callback, all-callback and cid-prompt-callback if ($argc > 3 && strlen($argv[3]) > 0) { $caller_areacode = $argv[3]; } else $caller_areacode = ""; if ($argc > 4 && strlen($argv[4]) > 0) { $groupid = $argv[4]; $A2B -> group_mode = true; $A2B -> group_id = $groupid; } if ($argc > 5 && strlen($argv[5]) > 0) {
} else { $idconfig = 1; } if ($dynamic_idconfig = intval($agi->get_variable("IDCONF", true))) { $idconfig = $dynamic_idconfig; } if ($argc > 2 && strlen($argv[2]) > 0 && $argv[2] == 'saydid') { $mode = 'saydid'; } else { $mode = 'standard'; } $A2B = new A2Billing(); $A2B->load_conf($agi, NULL, 0, $idconfig); $A2B->agiconfig['verbosity_level'] = 4; $A2B->agiconfig['logging_level'] = 0; $A2B->debug(INFO, $agi, __FILE__, __LINE__, "START MORNITORING"); define("DB_TYPE", isset($A2B->config["database"]['dbtype']) ? $A2B->config["database"]['dbtype'] : null); define("SMTP_SERVER", isset($A2B->config['global']['smtp_server']) ? $A2B->config['global']['smtp_server'] : null); define("SMTP_HOST", isset($A2B->config['global']['smtp_host']) ? $A2B->config['global']['smtp_host'] : null); define("SMTP_USERNAME", isset($A2B->config['global']['smtp_username']) ? $A2B->config['global']['smtp_username'] : null); define("SMTP_PASSWORD", isset($A2B->config['global']['smtp_password']) ? $A2B->config['global']['smtp_password'] : null); // Print header $A2B->debug(DEBUG, $agi, __FILE__, __LINE__, "AGI Request:\n" . print_r($agi->request, true)); /* GET THE AGI PARAMETER */ $A2B->get_agi_request_parameter($agi); if (!$A2B->DbConnect()) { $agi->stream_file('prepaid-final', '#'); exit; } define("WRITELOG_QUERY", false); $instance_table = new Table();
if ($argc > 3 && strlen($argv[3]) > 0) { $caller_areacode = $argv[3]; } if ($argc > 4 && strlen($argv[4]) > 0) { $groupid = $argv[4]; $A2B->group_mode = true; $A2B->group_id = $groupid; } if ($argc > 5 && strlen($argv[5]) > 0) { $cid_1st_leg_tariff_id = $argv[5]; } $A2B = new A2Billing(); $A2B->load_conf($agi, NULL, 0, $idconfig, $optconfig); $A2B->mode = $mode; $A2B->G_startime = $G_startime; $A2B->debug(INFO, $agi, __FILE__, __LINE__, "IDCONFIG : {$idconfig}"); $A2B->debug(INFO, $agi, __FILE__, __LINE__, "MODE : {$mode}"); $A2B->CC_TESTING = isset($A2B->agiconfig['debugshell']) && $A2B->agiconfig['debugshell']; //$A2B->CC_TESTING = true; define("DB_TYPE", isset($A2B->config["database"]['dbtype']) ? $A2B->config["database"]['dbtype'] : null); define("SMTP_SERVER", isset($A2B->config['global']['smtp_server']) ? $A2B->config['global']['smtp_server'] : null); define("SMTP_HOST", isset($A2B->config['global']['smtp_host']) ? $A2B->config['global']['smtp_host'] : null); define("SMTP_USERNAME", isset($A2B->config['global']['smtp_username']) ? $A2B->config['global']['smtp_username'] : null); define("SMTP_PASSWORD", isset($A2B->config['global']['smtp_password']) ? $A2B->config['global']['smtp_password'] : null); // Print header $A2B->debug(DEBUG, $agi, __FILE__, __LINE__, "AGI Request:\n" . print_r($agi->request, true)); $A2B->debug(DEBUG, $agi, __FILE__, __LINE__, "[INFO : {$agi_version}]"); /* GET THE AGI PARAMETER */ $A2B->get_agi_request_parameter($agi); if (!$A2B->DbConnect()) { $agi->stream_file('prepaid-final', '#');
$mode = 'all-callback'; } elseif ($argc > 2 && strlen($argv[2]) > 0 && $argv[2] == 'predictivedialer') { $mode = 'predictivedialer'; } elseif ($argc > 2 && strlen($argv[2]) > 0 && $argv[2] == 'voucher') { $mode = 'voucher'; } else { $mode = 'standard'; } // get the area code for the cid-callback & all-callback if ($argc > 3 && strlen($argv[3]) > 0) { $caller_areacode = $argv[3]; } $A2B = new A2Billing(); $A2B->load_conf($agi, NULL, 0, $idconfig); $A2B->mode = $mode; $A2B->debug(VERBOSE | WRITELOG, $agi, __FILE__, __LINE__, "IDCONFIG : {$idconfig}"); $A2B->debug(VERBOSE | WRITELOG, $agi, __FILE__, __LINE__, "MODE : {$mode}"); $A2B->CC_TESTING = isset($A2B->agiconfig['debugshell']) && $A2B->agiconfig['debugshell']; //$A2B -> CC_TESTING = true; define("DB_TYPE", isset($A2B->config["database"]['dbtype']) ? $A2B->config["database"]['dbtype'] : null); define("SMTP_SERVER", isset($A2B->config['global']['smtp_server']) ? $A2B->config['global']['smtp_server'] : null); define("SMTP_HOST", isset($A2B->config['global']['smtp_host']) ? $A2B->config['global']['smtp_host'] : null); define("SMTP_USERNAME", isset($A2B->config['global']['smtp_username']) ? $A2B->config['global']['smtp_username'] : null); define("SMTP_PASSWORD", isset($A2B->config['global']['smtp_password']) ? $A2B->config['global']['smtp_password'] : null); // TEST DID // if ($A2B -> CC_TESTING) $mode = 'did'; //-- Print header $A2B->debug(VERBOSE | WRITELOG, $agi, __FILE__, __LINE__, "AGI Request:\n" . print_r($agi->request, true)); /* GET THE AGI PARAMETER */ $A2B->get_agi_request_parameter($agi); //$A2B -> accountcode = '2222222222';