| 95 | | global $STANDALONE; |
|---|
| 96 | | |
|---|
| 97 | | global $ASTERISKMGR_DBHOST; |
|---|
| 98 | | |
|---|
| 99 | | global $AMP_FUNCTIONS_FILES; |
|---|
| 100 | | global $AMPORTAL_CONF_FILE; |
|---|
| 101 | | |
|---|
| 102 | | global $LEGACY_AMP_DBENGINE; |
|---|
| 103 | | global $LEGACY_AMP_DBFILE; |
|---|
| 104 | | global $LEGACY_AMP_DBHOST; |
|---|
| 105 | | global $LEGACY_AMP_DBNAME; |
|---|
| 106 | | |
|---|
| 107 | | global $ASTERISKCDR_DBENGINE; |
|---|
| 108 | | global $ASTERISKCDR_DBFILE; |
|---|
| 109 | | global $ASTERISKCDR_DBHOST; |
|---|
| 110 | | global $ASTERISKCDR_DBNAME; |
|---|
| 111 | | |
|---|
| 112 | | global $ARI_DISABLED_MODULES; |
|---|
| 113 | | |
|---|
| 114 | | global $ARI_ADMIN_USERNAME; |
|---|
| 115 | | global $ARI_ADMIN_PASSWORD; |
|---|
| 116 | | global $ariadminusername; |
|---|
| 117 | | global $ariadminpassword; |
|---|
| 118 | | |
|---|
| 119 | | global $loaded_modules; |
|---|
| 120 | | |
|---|
| 121 | | // This variable is a global in the FreePBX function.inc.php but needs to be |
|---|
| 122 | | // declared here or the is not seen when parse_amprotaconf() is eventually called |
|---|
| 123 | | // ?php bug? |
|---|
| 124 | | // |
|---|
| 125 | | global $amp_conf_defaults; |
|---|
| | 95 | global $AMPORTAL_CONF_FILE, |
|---|
| | 96 | $AMP_FUNCTIONS_FILES, |
|---|
| | 97 | $ARI_ADMIN_PASSWORD, |
|---|
| | 98 | $ARI_ADMIN_USERNAME, |
|---|
| | 99 | $ARI_DISABLED_MODULES, |
|---|
| | 100 | $ASTERISKMGR_DBHOST, |
|---|
| | 101 | $LEGACY_AMP_DBENGINE, |
|---|
| | 102 | $LEGACY_AMP_DBFILE, |
|---|
| | 103 | $LEGACY_AMP_DBHOST, |
|---|
| | 104 | $LEGACY_AMP_DBNAME, |
|---|
| | 105 | $amp_conf, |
|---|
| | 106 | $amp_conf_defaults, |
|---|
| | 107 | $amp_usedevstate, |
|---|
| | 108 | $ariadminpassword, |
|---|
| | 109 | $ariadminusername, |
|---|
| | 110 | $asterisk_manager_interface, |
|---|
| | 111 | $astman, |
|---|
| | 112 | $cdrdb, |
|---|
| | 113 | $db, |
|---|
| | 114 | $loaded_modules, |
|---|
| | 115 | $STANDALONE; |
|---|
| | 116 | |
|---|
| 146 | | |
|---|
| 147 | | $amp_dbengine = isset($amp_conf["AMPDBENGINE"]) ? $amp_conf["AMPDBENGINE"] : $LEGACY_AMP_DBENGINE; |
|---|
| 148 | | $amp_dbfile = isset($amp_conf["AMPDBFILE"]) ? $amp_conf["AMPDBFILE"] : $LEGACY_AMP_DBFILE; |
|---|
| 149 | | $amp_dbuser = $amp_conf["AMPDBUSER"]; |
|---|
| 150 | | $amp_dbpass = $amp_conf["AMPDBPASS"]; |
|---|
| 151 | | $amp_dbhost = isset($amp_conf["AMPDBHOST"]) ? $amp_conf["AMPDBHOST"] : $LEGACY_AMP_DBHOST; |
|---|
| 152 | | $amp_dbname = isset($amp_conf["AMPDBNAME"]) ? $amp_conf["AMPDBNAME"] : $LEGACY_AMP_DBNAME; |
|---|
| 153 | | |
|---|
| 154 | | $asteriskcdr_dbengine = $ASTERISKCDR_DBENGINE; |
|---|
| 155 | | $asteriskcdr_dbfile = $ASTERISKCDR_DBFILE; |
|---|
| 156 | | $asteriskcdr_dbuser = $amp_conf["AMPDBUSER"]; |
|---|
| 157 | | $asteriskcdr_dbpass = $amp_conf["AMPDBPASS"]; |
|---|
| 158 | | $asteriskcdr_dbhost = isset($amp_conf["AMPDBHOST"]) ? $amp_conf["AMPDBHOST"] : $ASTERISKCDR_DBHOST; |
|---|
| 159 | | $asteriskcdr_dbname = $ASTERISKCDR_DBNAME; |
|---|
| 176 | | $_SESSION['ari_error'] = |
|---|
| 177 | | _("ARI does not appear to have access to the Asterisk Manager.") . " ($errno)<br>" . |
|---|
| 178 | | _("Check the ARI 'main.conf.php' configuration file to set the Asterisk Manager Account.") . "<br>" . |
|---|
| 179 | | _("Check /etc/asterisk/manager.conf for a proper Asterisk Manager Account") . "<br>" . |
|---|
| 180 | | _("make sure [general] enabled = yes and a 'permit=' line for localhost or the webserver."); |
|---|
| 181 | | return FALSE; |
|---|
| 182 | | } |
|---|
| 183 | | |
|---|
| 184 | | |
|---|
| 185 | | global $astman; |
|---|
| | 144 | $_SESSION['ari_error'] = |
|---|
| | 145 | _("ARI does not appear to have access to the Asterisk Manager.") . " ($errno)<br>" . |
|---|
| | 146 | _("Check the ARI 'main.conf.php' configuration file to set the Asterisk Manager Account.") . "<br>" . |
|---|
| | 147 | _("Check /etc/asterisk/manager.conf for a proper Asterisk Manager Account") . "<br>" . |
|---|
| | 148 | _("make sure [general] enabled = yes and a 'permit=' line for localhost or the webserver."); |
|---|
| | 149 | return FALSE; |
|---|
| | 150 | } |
|---|
| | 151 | |
|---|
| 188 | | $_SESSION['ari_error'] = |
|---|
| 189 | | _("ARI does not appear to have access to the Asterisk Manager.") . " ($errno)<br>" . |
|---|
| 190 | | _("Check the ARI 'main.conf.php' configuration file to set the Asterisk Manager Account.") . "<br>" . |
|---|
| 191 | | _("Check /etc/asterisk/manager.conf for a proper Asterisk Manager Account") . "<br>" . |
|---|
| 192 | | _("make sure [general] enabled = yes and a 'permit=' line for localhost or the webserver."); |
|---|
| 193 | | } |
|---|
| 194 | | |
|---|
| 195 | | |
|---|
| 196 | | global $db; |
|---|
| | 154 | $_SESSION['ari_error'] = |
|---|
| | 155 | _("ARI does not appear to have access to the Asterisk Manager.") . " ($errno)<br>" . |
|---|
| | 156 | _("Check the ARI 'main.conf.php' configuration file to set the Asterisk Manager Account.") . "<br>" . |
|---|
| | 157 | _("Check /etc/asterisk/manager.conf for a proper Asterisk Manager Account") . "<br>" . |
|---|
| | 158 | _("make sure [general] enabled = yes and a 'permit=' line for localhost or the webserver."); |
|---|
| | 159 | } |
|---|
| | 160 | |
|---|
| 206 | | if (in_array('callmonitor',array_keys($loaded_modules))) { |
|---|
| 207 | | $cdrdb = new Database(); |
|---|
| 208 | | $_SESSION['dbh_cdr'] = $cdrdb->logon($asteriskcdr_dbengine, |
|---|
| 209 | | $asteriskcdr_dbfile, |
|---|
| 210 | | $asteriskcdr_dbuser, |
|---|
| 211 | | $asteriskcdr_dbpass, |
|---|
| 212 | | $asteriskcdr_dbhost, |
|---|
| 213 | | $asteriskcdr_dbname); |
|---|
| 214 | | if (!isset($_SESSION['dbh_cdr'])) { |
|---|
| 215 | | $_SESSION['ari_error'] .= sprintf(_("Cannot connect to the $asteriskcdr_dbname database"),$asteriskcdr_dbname) . "<br>" . |
|---|
| 216 | | _("Check AMP installation, asterisk, and ARI main.conf"); |
|---|
| 217 | | return FALSE; |
|---|
| 218 | | } |
|---|
| 219 | | } |
|---|
| 220 | | |
|---|
| 221 | | return TRUE; |
|---|
| | 166 | if (isset($cdrdb) && $cdrdb) { |
|---|
| | 167 | $_SESSION['dbh_cdr'] = $cdrdb; |
|---|
| | 168 | } |
|---|
| | 169 | |
|---|
| | 170 | return TRUE; |
|---|