Changeset 7347

Show
Ignore:
Timestamp:
01/06/09 17:05:28 (3 years ago)
Author:
p_lindheimer
Message:

add skip_astman option for ajax paths that won't require a manager connection to be opened to minimize overhead

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.5/amp_conf/htdocs/admin/config.php

    r6764 r7347  
    2323$action = isset($_REQUEST['action'])?$_REQUEST['action']:null; 
    2424$quietmode = isset($_REQUEST['quietmode'])?$_REQUEST['quietmode']:''; 
     25$skip_astman = isset($_REQUEST['skip_astman'])?$_REQUEST['skip_astman']:false; 
    2526if (isset($_REQUEST['restrictmods'])) { 
    2627  $restrict_mods = explode('/',$_REQUEST['restrictmods']); 
  • freepbx/branches/2.5/amp_conf/htdocs/admin/header.php

    r6525 r7347  
    115115$amp_conf = parse_amportal_conf("/etc/amportal.conf"); 
    116116$asterisk_conf  = parse_asterisk_conf($amp_conf["ASTETCDIR"]."/asterisk.conf"); 
    117 $astman   = new AGI_AsteriskManager(); 
     117if (!$skip_astman) { 
     118  require_once('common/php-asmanager.php'); 
     119  $astman   = new AGI_AsteriskManager(); 
    118120 
    119 // attempt to connect to asterisk manager proxy 
    120 if (!isset($amp_conf["ASTMANAGERPROXYPORT"]) || !$res = $astman->connect("127.0.0.1:".$amp_conf["ASTMANAGERPROXYPORT"], $amp_conf["AMPMGRUSER"] , $amp_conf["AMPMGRPASS"], 'off')) { 
    121   // attempt to connect directly to asterisk, if no proxy or if proxy failed 
    122   if (!$res = $astman->connect("127.0.0.1:".$amp_conf["ASTMANAGERPORT"], $amp_conf["AMPMGRUSER"] , $amp_conf["AMPMGRPASS"], 'off')) { 
    123     // couldn't connect at all 
    124     unset( $astman ); 
     121  // attempt to connect to asterisk manager proxy 
     122  if (!isset($amp_conf["ASTMANAGERPROXYPORT"]) || !$res = $astman->connect("127.0.0.1:".$amp_conf["ASTMANAGERPROXYPORT"], $amp_conf["AMPMGRUSER"] , $amp_conf["AMPMGRPASS"], 'off')) { 
     123    // attempt to connect directly to asterisk, if no proxy or if proxy failed 
     124    if (!$res = $astman->connect("127.0.0.1:".$amp_conf["ASTMANAGERPORT"], $amp_conf["AMPMGRUSER"] , $amp_conf["AMPMGRPASS"], 'off')) { 
     125      // couldn't connect at all 
     126      unset( $astman ); 
     127    } 
    125128  } 
    126129} 
     
    129132 
    130133// default password check 
    131 if (!$quietmode) { 
     134 
     135if (!$quietmode && !isset($_REQUEST['handler'])) { 
    132136  $nt = notifications::create($db); 
    133137  if ($amp_conf['AMPMGRPASS'] == $amp_conf_defaults['AMPMGRPASS'][1]) {