Asterisk and FreePBX on Vserver

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

net-misc/dahdi
You could just emerge. The problem with that though is that to do so you would not obtain the benefits of OSLEC, which is quite simply the best soft echo canceller.

could be easily patched for OSLEC, but that ebuild is history now.

What follows is a manual install roughly following these notes

Change only the following line from:

to

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

The following file means that user and group asterisk are needed:

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:

Asterisk
Done

Devices
In times gone by you needed to fill. Check that the following devices are on the guest, and if not, create them accordingly.

And then for Asterisk:

Run as user asterisk
Don't edit as setting the user and group to run asterisk is done in.

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
to where FreePBX was unpacked.

Apache
Now might be a good time to setup Apache.

The default FreePBX install location is. That's good enough, don't you think. Accordingly, establish a reasonable hostfile in.

In change  to.

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

and test with a browser.

install_amp
always complains. If its not Unable to connect to manager 127.0.0.1:5038 (111): Connection refused it might be Strict Standards: Non-static method modulelist::create should not be called statically in /var/www/html/admin/functions.inc.php on line The errors could be bad, but maybe not.

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 update and 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.

The following are examples:

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

The following values are a possibility.

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 Routes are simple too.

Note the In use. Without this, Asterisk probably hasn't been built with the correct hardware driver, eg DAHDI, and FreePBX nor asterisk*CLI> will not tell you of the error.