<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Call Recording unable to connect to DB on FreePBX 15]]></title><description><![CDATA[<p dir="auto">FreePBX moved the DB credentials out of <code>etc/amportal.conf</code> quite some time ago now.<br />
But they left the file in place with other information still. Because of that, the logic in <code>config.php</code> is no longer valid.</p>
<pre><code>    if(!$db-&gt;is_connected()) {
        // Database connection details from amportal
=begin comment
This logic is invalid on FreePBX 15 as /etc/amportal.conf still exists.

        if (is_readable("/etc/amportal.conf")) {
            $amp_conf = parse_amportal_conf("/etc/amportal.conf");
            $DBHOST = $amp_conf['AMPDBHOST'];
            $DBNAME = $amp_conf['AMPDBNAME'];
            $DBUSER = $amp_conf['AMPDBUSER'];
            $DBPASS = $amp_conf['AMPDBPASS'];

            if(!isset($amp_conf['AMPDBENGINE'])) {
                if(is_file("/etc/freepbx/freepbx.conf")) {
                    $amp_conf = parse_amportal_conf("/etc/freepbx/freepbx.conf");
                } else if(is_file("/etc/freepbx.conf")) {
                    $amp_conf = parse_amportal_conf("/etc/freepbx.conf");
                }
                $DBHOST = $amp_conf['AMPDBHOST'];
                $DBNAME = $amp_conf['AMPDBNAME'];
                $DBUSER = $amp_conf['AMPDBUSER'];
                $DBPASS = $amp_conf['AMPDBPASS'];
            }

	} else if (is_readable("/etc/freepbx/freepbx.conf")) {
            $amp_conf = parse_amportal_conf("/etc/freepbx/freepbx.conf");
            $DBHOST = $amp_conf['AMPDBHOST'];
            $DBNAME = $amp_conf['AMPDBNAME'];
            $DBUSER = $amp_conf['AMPDBUSER'];
            $DBPASS = $amp_conf['AMPDBPASS'];
        } else if (is_readable("/etc/freepbx.conf")) {
=end comment
=cut
    	if (is_readable("/etc/freepbx.conf")) {
            $amp_conf = parse_amportal_conf("/etc/freepbx.conf");
            $DBHOST = $amp_conf['AMPDBHOST'];
            $DBNAME = $amp_conf['AMPDBNAME'];
            $DBUSER = $amp_conf['AMPDBUSER'];
            $DBPASS = $amp_conf['AMPDBPASS'];
        } else if (is_readable("/etc/asterisk/snep/snep-features.conf")) {
            $DBHOST = 'localhost';
            $DBNAME = 'snep';
            $DBUSER = 'snep';
            $DBPASS = 'sneppass';
            $CDRDBTABLE = "snep.cdr";
        }
	$db = new dbcon($DBHOST, $DBUSER, $DBPASS, $DBNAME, true, true, $FORCE_UTF8);
</code></pre>
]]></description><link>http://localhost:4567/topic/2969/call-recording-unable-to-connect-to-db-on-freepbx-15</link><generator>RSS for Node</generator><lastBuildDate>Tue, 27 Oct 2026 16:36:33 GMT</lastBuildDate><atom:link href="http://localhost:4567/topic/2969.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 04 Mar 2021 15:51:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Call Recording unable to connect to DB on FreePBX 15 on Thu, 04 Mar 2021 15:53:38 GMT]]></title><description><![CDATA[<p dir="auto">It seems something about the subsequent if logic to after the amportal check is not working. Going only to the <code>/etc/freepbx.conf</code> does work as I simply commented out the block and added the <code>if</code> because it does not apply to the install. but obviously, you need to actually fix the logic so it works for various systems.<br />
This is the error I was getting<br />
<img src="http://forum.fop2.com/uploads/editor/4w/yhgeuxchxohz.png" alt="" class="img-markdown  img-fluid" /></p>
]]></description><link>http://localhost:4567/post/12229</link><guid isPermaLink="true">http://localhost:4567/post/12229</guid><dc:creator><![CDATA[JaredBusch]]></dc:creator><pubDate>Thu, 04 Mar 2021 15:53:38 GMT</pubDate></item></channel></rss>