Changeset 10443 for freepbx/branches
- Timestamp:
- 10/24/10 13:49:06 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/branches/2.8/amp_conf/bin/archive_recordings
r9750 r10443 3 3 4 4 define("AMP_CONF", "/etc/amportal.conf"); 5 define("PHP_ASMANAGER", "php-asmanager.php");6 5 define("MONITOR_DIR", "/var/spool/asterisk/monitor"); 7 6 … … 47 46 'USECATEGORIES' => true, 48 47 'ASTETCDIR' => '/etc/asterisk', 49 'ASTMANAGERPORT' => '5038',50 48 'CDRDBNAME' => 'asteriskcdrdb', 51 49 ); … … 242 240 $cdrRecord['extension']=substr($cdrRecord['dstchannel'],strpos($cdrRecord['dstchannel'],"/")+1,(strpos($cdrRecord['dstchannel'],"-")-strpos($cdrRecord['dstchannel'],"/")-1)); //cut out the channel number 243 241 outn("Checking if ".$cdrRecord['extension']." has recordings enabled.."); 244 $extrecord = check_recording_option($cdrRecord['extension']);245 242 $cdrRecord['direction']="in"; 246 if ($extrecord == "ENABLED") {247 out("YES");248 } else {249 out("NO");250 unset($cdrRecord['extension']);251 }252 243 } else if (strpos($calltype,"queue") === 0) { 253 244 if($debug) debug("Getting queue destination from dst: ".$cdrRecord['dst']); … … 262 253 return($cdrRecord); 263 254 } 264 265 266 function check_recording_option($extension) {267 global $amp_conf;268 global $astman;269 270 if ($astman) {271 return $astman->database_get("RECORD-IN",$extension);272 } else {273 fatal("Cannot connect to Asterisk Manager with ".$amp_conf["AMPMGRUSER"]."/".$amp_conf["AMPMGRPASS"]);274 }275 276 }277 278 255 279 256 // Create list of all files … … 412 389 out("OK"); 413 390 414 // **** Make sure we have php-asmanager.php, and include it415 416 outn("Checking for PHP_ASMANAGER..");417 $myfile = $amp_conf['AMPWEBROOT'] . "/admin/common/" . PHP_ASMANAGER ;418 if (! @ include( $myfile ) ) {419 out("FAILED");420 fatal("Cannot include $myfile");421 }422 out("OK");423 424 // **** now make the global manager connection425 $astman = new AGI_AsteriskManager();426 $res = $astman->connect("127.0.0.1", $amp_conf["AMPMGRUSER"] , $amp_conf["AMPMGRPASS"] );427 if (!$res) {428 fatal("Cannot connect to Asterisk Manager with ".$amp_conf["AMPMGRUSER"]."/".$amp_conf["AMPMGRPASS"]);429 }430 431 432 391 // **** Connect to database 433 392 outn("Connecting to database..");
