User:Fog Watch/Installing Asterisk and FreePBX on Vserver

Introduction
These are notes about installing Asterisk and FreePBX on a Vserver. Some parts go on the Vserver host, most on the guest.

OSLEC
OSLEC is the best: you need it.

Follow the howto to update. Obtain the patch from bugs. Patch the ebuild with something like

Finish off
Test if OSLEC is being used with something like the following:

Portage
Establish the following files.

The FreePBX INSTALL
Obtain and. screams

is, however, about the best of a bad lot of documentation. What follows here are descriptions that loosely follow the structure of.

FreePBX requirements
Possibly:

In change  to.

Change the and  in  from  to. Failure to do this will result in a 403 error when accessing something like http://hostname/admin/.

Establish a reasonable hostfile in. Test the web server after Asterisk has been installed.

Asterisk
Start of with: and the add the asterisk user to it. ie

If you don't:

1.6 has better sound quality than 1.2, so use that.

Devices
In case the devices aren't there (from Telephreak) perform the following on the host (eg /vservers/, not the guest.

And then for Asterisk:

Run as user asterisk
You might have to owing to a bug. Don't edit as setting the user and group to run asterisk is done in. Inside the guest:

Run asterisk with a bossy nice
It's reasonable to put voip ahead of the other guests. in should be changed to something bossy. < 0 will not work with out a commensurate nice value in the host's.

MySQL
somewhere sensible:

Apache
Now might be a good time to setup Apache. Arrange the files for the FreePBX web site to be put into. and test with a browser.

install_amp
The default location for the files installs is. Flash Operator Panel, however, requires. If the installation is in then the panel.php component of FreePBX returns a 404 error. Most of the other parameters will be defaults.

will return an horrific screed of errors that include Unable to connect to manager 127.0.0.1:5038 (111): Connection refused This is a portent of terrible things to come unless remediation is undertaken. After running, edit. Change to. Otherwise will not list localhost, which spells disaster. Next

creates. This includes the setting. For FreePBX this needs to be.

magic_quotes_gpc
http:// /admin/config.php might start with the following error. You have magic_quotes_gpc enabled in your php.ini, http or .htaccess file which will cause errors in some modules. FreePBX expects this to be off and runs under that assumption

You don't want that. In, change the following to Off:

amportal start
You might want to:

This might then produce the following error: SETTING FILE PERMISSIONS chown: cannot access `/dev/tty9': No such file or directory Permissions OK

STARTING ASTERISK Cannot find specified TTY (9) safe_asterisk: no process found mpg123: no process found

- Asterisk could not start! Use 'tail /var/log/asterisk/full' to find out why. - This can be remedied by, on the host:

amportal stop
You might want to but there's a problem.

This can be remedied by commenting out in.

Module Admin
Use Module Admin of FreePBX to load more modules.

Getting Started
Adequate getting started documentation is available here.

fxotune
If you have compatible hardware consider running. On a four channel card run (on the host):

The this creates will then be picked up by.

/etc/modprobe.d/dahdi.conf
Your country needs to be specified. For example:

/etc/dahdi/genconf_parameters
On the host, make sure the parameteres in look correct. A possibility is this:

system.conf and dahdi-channels.conf
uses to create  and. But before that:

uses and. needs to be copied over:

/etc/asterisk/chan_dahdi.conf
On the guest, the copied in needs to be included in :

The additional inclusion is created by FreePBX. For the record:

rxgain and txgain
On the host the following can be useful when adjust the gains:

The following values are a possibility.

Start DAHDI
Then start it up:

FreePBX
To get this all working you need to browse to your FreePBX and install Extensions, Trunks and Inbound Routes. When creating a zap extension, make sure you select the correct channel. For example, on my host I get:

The correct channel for the zap extension here is 2, because that's the FXS channel.

The settings for a SIP trunk should be described by your provider. Zap trunks don't have special settings. Inbound Roots are simple too.