24 ago 2011

Aumentando la capacidad de Elastix con Kamailio

Esto es una recopilacion de las notas "Elastix and Kamailio Part 1 – Installing" y "Elastix and Kamailio Part 2 – Integrating" que pueden ser encontradas en los link anteriores. No sustituye su lectura debido a que contiene importantes observaciones en los comentarios de cada uno. También se recomienda no realizar esto en una maquina que este en producción, es decir que una empresa dependa de ella para operar.
por favor colocar preguntas y dudas en el articulo original

Elastix and Kamailio Part 1 – Installing

WARNING: DO NOT INSTALL THIS ON A PRODUCTION MACHINE! Some of you may want be wanting to increase the capacity of your Elastix machine. Asterisk generally has issues when you start to put a lot of SIP peers on it. One of the best ways to get around this is to install a proper SIP server and join it with asterisk. This allows you to register all your SIP handsets to the SIP server and make calls through to your asterisk machine.

The Kamailio module for Elastix allows you to easily integrate Elastix with a enterprise SIP server. All SIP handsets register to Kamailio. All internal SIP calls stay within Kamailio however if a call is external then Kamailio will push the call out to asterisk to deal with it.

To install the Kamalio module you first need to create the directory for it to go in. It installs itself from the directory /var/kamailio

mkdir /var/kamailio

Now change to the directory

cd /var/kamailio

Download the kamailio integration file from the MBIT website

wget http://www.mbit.com.au/kamailio-v2.tgz

Untar the file into the directory

tar zxvf kamailio-integration.tgz

In the directory now will be a heap of files you want to execute the script that installs all the modules for you. To run the script execute install_kamailio.sh

./install_kamailio.sh

Soon as it is installed we will move to the next part for configuring Kamailio. The installation can take a while so please be patient. The installation can only be used with Elastix 2.0.

This entry was posted on Friday, November 5th, 2010 at 5:57 pm and is filed under Elastix.

La segunda Parte

Elastix and Kamailio Part 2 – Integrating

This article moves on from Part 1. I have updated the kamailio installation file so you will need to download this and run through Part 1 again. Make sure it all installs correctly.

The first step is to go into the /etc/kamailio.cfg file. In this file is the configuration for kamailio. When calls are between Kamailio extensions the call stays within Kamailio. If the call is to the PSTN then Kamailio sends it to asterisk. In the kamailio.cfg file we need to set a couple of parameters for your system. I have been building my test machine on the IP address 192.168.1.150. You will find 2 places where I have set this IP in the kamailio.cfg. Change these entries to the IP address of your machine using nano.

nano /etc/kamailio.cfg

Then restart Kamailio

service kamailio restart

Make sure kamailio is running

service kamailio status

The next step you need to do is go into freePBX. Under http://yourelastixip/admin is the freePBX interface. Go into module admin and you will find a new module called Kamailio integration. The Kamailio integration basically allows you to register handsets to Kamailio on port 5060. It also sends all external calls through asterisk when you make PSTN calls or voicemail calls. Once you have activated it go into the extensions tab in freePBX.

When adding a Kamailio extension you need to add a custom extension. If you add a SIP extension under freePBX this will simply be an asterisk extension. First add your extension number and display name. The last field required is the Kamailio password. You can scroll down and you will find an extra section called Kamailio services. Make sure it is enabled for the extension and you put in a password, click submit in the freePBX interface and reload freePBX.

The final step is to add a trunk in freePBX. Create a SIP trunk with the trunk name kamailio.

Under the peer details put

port=5060

allow=all

type=friend

context=from-internal

host=”yourelastixip”

canreinvite=nonat

This will allow calls to flow between kamailio and asterisk.

When you are done you should be able to register a phone to Kamailio with the details you put into freepbx.

Troubleshooting

If some of the packages dont install correctly try cleaning up yum

yum clean all

Then run the script again.

If everything installed correctly and you still cant make calls from Kamailio to asterisk try copying the kamailio.cfg from /var/kamailio again to /etc/kamailio. Then edit the IP address that I detailed above. Once this is done restart kamailio and try calling.

This entry was posted on Tuesday, January 25th, 2011 at 7:20 pm and is filed under Elastix.


Recuerden Revisen los comentarios en articulo original y NO lo prueben en producción.

No hay comentarios: