Changeset 10635
- Timestamp:
- 11/29/10 17:21:23 (2 years ago)
- Files:
-
- freepbx/trunk (modified) (1 prop)
- freepbx/trunk/amp_conf/bin/archive_recordings (modified) (5 diffs)
- freepbx/trunk/amp_conf/bin/generate_hints.php (modified) (1 diff)
- freepbx/trunk/amp_conf/htdocs/admin/functions.inc.php (modified) (1 diff)
- freepbx/trunk/amp_conf/htdocs/admin/page.modules.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/trunk
- Property svnmerge-integrated changed from /freepbx/branches/2.8:1-10415 to /freepbx/branches/2.8:1-10634
freepbx/trunk/amp_conf/bin/archive_recordings
r10122 r10635 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.."); freepbx/trunk/amp_conf/bin/generate_hints.php
r10381 r10635 92 92 93 93 $device_array = explode( '&', $devices ); 94 $dialstring = ''; 94 95 foreach ($device_array as $adevice) { 95 96 $dds = $astman->database_get('DEVICE',$adevice.'/dial'); freepbx/trunk/amp_conf/htdocs/admin/functions.inc.php
r10578 r10635 155 155 return array('engine'=>'asterisk', 'version' => $matches[1].'.'.$matches[4], 'additional' => $matches[4], 'raw' => $verinfo); 156 156 } elseif (preg_match('/Asterisk SVN-trunk-r(-?(\S*))/', $verinfo, $matches)) { 157 return array('engine'=>'asterisk', 'version' => '1. 6', 'additional' => $matches[1], 'raw' => $verinfo);157 return array('engine'=>'asterisk', 'version' => '1.8', 'additional' => $matches[1], 'raw' => $verinfo); 158 158 } elseif (preg_match('/Asterisk SVN-.+-(\d+(\.\d+)*)-r(-?(\S*))-(.+)/', $verinfo, $matches)) { 159 159 return array('engine'=>'asterisk', 'version' => $matches[1], 'additional' => $matches[3], 'raw' => $verinfo); freepbx/trunk/amp_conf/htdocs/admin/page.modules.php
r10442 r10635 14 14 15 15 $extdisplay = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:''; 16 $module_repo = isset($_REQUEST['module_repo'])? $_REQUEST['module_repo']:'supported';16 $module_repo = isset($_REQUEST['module_repo'])?htmlentities($_REQUEST['module_repo']):'supported'; 17 17 $repo = "http://mirror.freepbx.org/"; 18 18 if ($module_repo == "extended") { … … 21 21 22 22 // can't go online if external management is on 23 $online = (isset($_REQUEST['online']) && !EXTERNAL_PACKAGE_MANAGEMENT) ? $_REQUEST['online'] : false;23 $online = (isset($_REQUEST['online']) && !EXTERNAL_PACKAGE_MANAGEMENT) ? 1 : 0; 24 24 25 25 // fix php errors from undefined variable. Not sure if we can just change the reference below to use 26 26 // online since it changes values so just setting to what we decided it is here. 27 $_REQUEST['online'] = $online ? 1 : 0;28 27 29 28 $moduleaction = isset($_REQUEST['moduleaction'])?$_REQUEST['moduleaction']:false; … … 126 125 freepbx_modal_hide('moduleBox'); 127 126 if (goback) { 128 location.href = 'config.php?display=modules&type=<?php echo $type ?>&online=<?php echo ($_REQUEST['online']?1:0); ?>';127 location.href = 'config.php?display=modules&type=<?php echo $type ?>&online=<?php echo $online; ?>'; 129 128 } 130 129 } … … 153 152 if ($module_getonlinexml_error) { 154 153 echo "<div class=\"warning\"><p>".sprintf(_("Warning: Cannot connect to online repository (%s). Online modules are not available."), "mirror.freepbx.org")."</p></div><br />"; 155 $online = false;154 $online = 0; 156 155 unset($modules_online); 157 156 } else if (!is_array($modules_online)) { 158 157 echo "<div class=\"warning\"><p>".sprintf(_("Warning: Error retrieving updates from online repository (%s). Online modules are not available."), "mirror.freepbx.org")."</p></div><br />"; 159 $online = false;158 $online = 0; 160 159 unset($modules_online); 161 160 } else { … … 280 279 echo "\t<a href=\"#\" onclick=\"parent.close_module_actions(true);\" />"._("Return")."</a>"; 281 280 } else { 282 echo "\t<input type=\"button\" value=\""._("Return")."\" onclick=\"location.href = 'config.php?display=modules&type=$type&online=". ($_REQUEST['online']?1:0)."';\" />";281 echo "\t<input type=\"button\" value=\""._("Return")."\" onclick=\"location.href = 'config.php?display=modules&type=$type&online=".$online."';\" />"; 283 282 echo "</div>"; 284 283 } … … 447 446 echo "<p>"._("Please select at least one action to perform by clicking on the module, and selecting an action on the \"Action\" tab.")."</p>"; 448 447 } 449 echo "\t<input type=\"button\" value=\""._("Cancel")."\" onclick=\"location.href = 'config.php?display=modules&type=$type&online= ".($_REQUEST['online']?1:0)."';\" />";448 echo "\t<input type=\"button\" value=\""._("Cancel")."\" onclick=\"location.href = 'config.php?display=modules&type=$type&online=$online';\" />"; 450 449 echo "</form>"; 451 450
