FreePBX assumes that manager runs on localhost, which might not be the case if you run multiple FreePBX's on the same host.
Index: functions.inc.php
===================================================================
--- functions.inc.php (revision 153)
+++ functions.inc.php (working copy)
@@ -25,6 +25,7 @@
'AMPDBNAME' => array('std' , 'asterisk'),
'AMPENGINE' => array('std' , 'asterisk'),
'ASTMANAGERPORT' => array('std' , '5038'),
+ 'ASTMANAGERHOST' => array('std' , 'localhost'),
'AMPDBHOST' => array('std' , 'localhost'),
'AMPDBUSER' => array('std' , 'asteriskuser'),
'AMPDBPASS' => array('std' , 'amp109'),
Index: header.php
===================================================================
--- header.php (revision 153)
+++ header.php (working copy)
@@ -128,7 +128,7 @@
$astman = new AGI_AsteriskManager();
// attempt to connect to asterisk manager proxy
-if (!isset($amp_conf["ASTMANAGERPROXYPORT"]) || !$res = $astman->connect("127.0.0.1:".$amp_conf["ASTMANAGERPROXYPORT"], $amp_conf["AMPMGRUSER"] , $amp_conf["AMPMGRPASS"])) {
+if (!isset($amp_conf["ASTMANAGERPROXYPORT"]) || !$res = $astman->connect($amp_conf["ASTMANAGERHOST"] . ":".$amp_conf["ASTMANAGERPROXYPORT"], $amp_conf["AMPMGRUSER"] , $amp_conf["AMPMGRPASS"])) {
// attempt to connect directly to asterisk, if no proxy or if proxy failed
if (!$res = $astman->connect("127.0.0.1:".$amp_conf["ASTMANAGERPORT"], $amp_conf["AMPMGRUSER"] , $amp_conf["AMPMGRPASS"])) {
// couldn't connect at all