[Asterisk-bsd] FreePBX on FreeBSD

Kurt Lidl lidl at pix.net
Thu Sep 22 11:52:28 CDT 2011


On Wed, Sep 21, 2011 at 11:59:50PM -0700, Doug Barton wrote:
> I'm working on a FreeBSD port of FreePBX. I've seen the posts from Kurt
> and Ian about their success in getting it running, so I'm hopeful, but
> I've run into a lot of problems.
> 
> My approach so far has been massive amounts of sed to try and get the
> paths in the various scripts to match what FreeBSD ports usually do.

Offhand, I'd think this is the wrong approach to try.
See my comments below about a different way to fix the code.

> I've been partially successful in getting install_amp to run, and I've
> gotten to the point that it's starting to run the update scripts in
> freepbx-2.9.0/upgrades/ and I've hit a snag. It wants to connect to
> something like this:
> 
> $astman = new AGI_AsteriskManager();
> if ($res = $astman->connect("127.0.0.1", $amp_conf["AMPMGRUSER"] ,
> $amp_conf["AMPMGRPASS"])) {
> 
> Is this something I need, or can it be safely ignored?

You probably need this.  That's going to be the hook by which the
version-to-version upgrade process injects changes into the
running asterisk server.  If you're doing a new install, well then,
yes, you can ignore it.  But realistically, if you're going to
support upgrading from a previous version of FreePBX to the current
version, this is going to need to run.  Of course, that ought to
be something other than a hardcoded "127.0.0.1", but there isn't
a amp_conf setting for the machine that is running asterisk, only
the externally known website name and the machine that is running
the database server.

I'd probably change the "127.0.0.1" to be "localhost", but that's
just me.

> I'm also curious if anyone who has this running sees serious flaws in
> the approach described above, and/or would be willing to share the
> approach they used to get it installed. I started off trying to go with
> the defaults as much as possible, but given the large number of odd
> paths and internal consistencies trying to make things consistent seemed
> to be the lesser of various evils. However I'm curious if I'm going to
> run into unexpected problems with this method down the road.
> 
> Any help on this will be greatly appreciated.

Generically, the various FreePBX scripts just "source" or "." the
/etc/amportal.conf file, which setups a bunch of environmental
variables for binaries, libraries, spool files (e.g. voicemail),
and the like.

Anyplace you're busy sed'ing the contents of the files, you probably
should be making sure that the configuration file is read in,
and then just change the file to do something like the following:
	
	Original, hardcoded reference to /etc/asterisk/foo.conf :
	Change to ${ASTETCDIR}/foo.conf .

Nobody will argue that your change is incorrect, and it will "just work"
on any platform, regardless of where the user has configured their
asterisk installation.  It's important to get those fixes back to
the FreePBX maintainers -- obvious fixes like this they will probably
just include without too much effort.  Almost all the changes I
fed to them just before 2.8 was released got into the 2.8 release.

Now, I looked briefly at the FreePBX 2.9 code, and they've changed
how it operates/bootstraps the various shell scripts a bit.  They
augmented the /etc/amportal.conf file with an additional /etc/freepbx.conf
file.  They've got a post about that here:
	http://www.freepbx.org/news/2011-02-28/version-2-9-amportal-conf-advanced-settings-im-confused

I haven't attempted to upgrade my 2.8.1 FreePBX running on one of
my 32bit FreeBSD 8.2-RELEASE machines.  It works, and it's in production,
so I'm probably not going to fool with it, but rather port the
FreePBX 2.9 / FreePBX svn-trunk code to run on a different FreeBSD machine.

-Kurt




More information about the Asterisk-BSD mailing list