Trixbox - Asterisk@Home v 2.7 with VarPhonex Trunk
This installation guide has been created using information from: http://asteriskathome.sourceforge.net/
We have included only the information considered necessary to perform a basic installation of Asterisk@Home with VarPhonex as the VoIP provider. You can always visit the above-mentioned link in order to learn about all the features provided, as well as additional information you may need. Just follow this installation guide step by step to install and configure your Asterisk@Home with our VarPhonex service in no time at all!
Who can use Asterisk@Home?
Asterisk@Home can be configured in several different ways according to the needs of your or your customer. Asterisk@Home can be used by:
- Call centers
- Cyber Cafes
- Call shops
- Home users
What is Asterisk?
Asterisk is an open source PBX that allows regular and SIP phones communicate with each other.
Each phone is configured as an extension in the PBX, but the greatest advantage of Asterisk is that the extension does not have to be in the same physical location. This means that you can have extensions all over the world as long as there are connected to the Internet and properly configured with your server's information.
Like any PBX system, Asterisk has features such as: voicemail, conferencing, and call distribution.
One of the greatest advantages of Asterisk is that it will let you customize its Dial Plan and Code according to your needs.
What is Asterisk@Home?
Asterisk@Home is an ISO image of a pre-configured Asterisk server, which makes installation and deployment easier. Asterisk@Home contains a full version of Asterisk and other pre-configured applications considered add-ons. After installing Asterisk@Home, you will have a fully functional PBX that can be customized according to your needs.
1 Pre-Installation Tasks
1.1 Meet the minimum or recommended hardware requirements
The faster the system being used to run Asterisk, the more simultaneous calls it will be able to handle. A 500MHz PIII with 128MB of RAM should easily meet the needs of average home use. 2Gb Hard Disk minimum.
Keep in mind that these are the minimum requirements. If you are planning to use Asterisk in an office environment where voicemail and call monitoring will be used, we suggest the following: PIV CPU, minimum 512MB of RAM, and minimum 40GB hard drive.
1.2 Download the ISO image
Download the latest ISO from http://asteriskathome.sourceforge.net/ and burn it to a CD. Note: this guide was written for Version 2.7.
Most burning utilities can burn ISO images onto a CD. One program we can recommend for this is Alcohol 120% located at: http://trial.alcohol-soft.com/en/index.php
1.3 Setup your Router/Firewall in order for A@H to communicate with VarPhonex via SIP through NAT
For Asterisk@Home to communicate successfully with VarPhonex using SIP through a NAT, be sure that your router/firewall will forward the ports listed below to your LAN/PrivateIP address assigned to the Asterisk@Home server. Also, verify that the LAN/Private address is statically assigned to the Asterisk@Home server and it is not assigned dynamically via DHCP.
In your firewall's configuration forward the following ports to your Asterisk@Home's IP address:
||UDP / TCP
||10000 – 20000
**Note.- We do not support IAX or IAX2. We included them in the table as a reference.
1.4 Setup for changing (dynamic) Internet IP address
Most ISP's do not provide a “private static IP address” which would be recommendable to run Asterisk@Home. The average ISP provides Dynamic (DHCP) addresses, which makes it a little more difficult for users to run Asterisk@Home. The work around for this problem is “Dynamic DNS”.
What is Dynamic DNS?
Dynamic DNS allows an Internet domain name to be assigned to a dynamic IP address.
This is solution can be used for servers connected to ADSL or dial-up connections where the address is changed periodically.
Some Dynamic DNS providers provide a piece of software that can be installed in the server. This software works in the background and it tracks any change in the IP address and sends it to their database. This way the domain name will be always updated with the correct IP address as soon as it changes. There are some routers in the market that have this feature built in which makes unnecessary to install any software in the server. All you have to do is get an account with the provider and configure it in the router.
How do I use Dynamic DNS with Asterisk@Home?
You need to edit the sip_nat.conf file. To do this you will need to access AMP, click Maintenance ----> Config Edit ----> sip_nat.conf. Inside sip_nat.conf add the following and click "Update":
|externip = home.mydomain.com
||(Enter your Dynamic DNS domain name. Obviously it's easier to get a static IP address and avoid using Dynamic DNS altogether.)
|localnet = internal.network.address.0/255.255.255.0
||(put your LAN/Private NETWORK address of your Asterisk@Home server, this is NOT the IP address of the server!!!!)
To determine your local NETWORK address (NOT the IP address!!) you have to know a little about your subnet mask (255.255.255.0 numbers).
If the IP address of the Asterisk@Home server is 192.168.1.5 255.255.255.0, then the NETWORK address is 192.168.1.0
If the IP address of the Asterisk@Home server is 192.168.7.2 255.255.255.0, then the NETWORK address is 192.168.7.0
If the IP address of the Asterisk@Home server is 192.168.100.84 255.255.255.0, then the NETWORK address is 192.168.100.0
2.1 Installing from an ISO
Insert the CD you created using the ISO image and be sure that your Bios is configured to boot from a CD-ROM or DVD-ROM. Boot the computer and press ENTER when prompted. This will erase all the information on the hard drive and install your Asterisk@Home .
Once your Asterisk@Home is installed, it will include all of the applications and the Operating System itself with default passwords; This is why we recommend that you unplug your server from the network in order to avoid any hacker problems.
After Linux has loaded, the CD will eject. Remove the CD from the system and wait for the system to reboot. Booting the system might take a while, depending on the speed of your computer. Once this process is complete, log in to your new Asterisk@Home system with the following:
2.2 Setting up your Time Zone and Keyboard Layout
At the CentOS command prompt, type in the following command: config
The script is calling two other applications:
redhat-config-date CentOS 3.x
system-config-date CentOS 4.x
redhat-config-keyboard CentOS 3.x
system-config-keyboard CentOS 4.x
3 Securing your Asterisk@Home server
3.1 Configure your Asterisk server with a Static IP address
In order to change the default passwords, we need to assign your Asterisk@Home a Static IP address.
At the CentOS command line type: netconfig
A semi-graphical screen will appear that can be explored by using the "tab" button. Enter all the requested information and tab to OK once you're done. After returning to the CentOS command prompt, type the follow command to reboot the server: reboot
3.2 Changing your default CentOS Password
The default login for your CentOS operating system is:
At the CentOS command prompt enter the following command to change your password for the root user: passwd (You'll be asked to enter the old password and then the new password twice)
3.3 Changing your default FOP password
The default password for the Flash Operator Panel is:
Password: passw0rd (Note that 0 is a “zero”)
To change this password, log in to your CentOS server using your user and password and enter the FOP directory:
Using nano as the editor, open the configuration file op_server.cfg:
Locate the line that says security code=passw0rd. Replace the “passw0rd” with the password of your choice. security_code=whateverpasswordyouwant
Then do a CTRL-X to exit and then a "Y" to save changes. Now restart the FOP server.
3.4 Changing your default meetme password
To change the default, enter the following into the CentOS command prompt:
passwd-meetme (It will prompt you for your new password twice)
3.5 Changing your default System Mail password
To change the default password, enter the following into the CentOS command prompt:
passwd admin (It will prompt you for your new password twice)
3.6 Changing your default Sugar CRM Password
Access SugarCRM from your web page by typing the following information into your web browser:
The default login and password:
To change this, select ‘My Account' in the upper right corner, and then select the Change Password button to change your CRM password.
3.7 Web Admin Interface
Instructions from the Linux command prompt on your Asterisk box:
- (login of course)
- cd /var/www/html
- wget http://www.kennonsoft.org/projects/asterisk/admin-ui-2.tar
- tar -xvf admin-ui-2.tar
- rm index.html
- rm admin-ui-2.tar
- chmod 777 index.dat
Note: For more documentation and the End-User Manual refer to:
3.8 Updating patches to CentOS
It is recommended that you install CentOS patches. From the CentOS command line, run the following command: yum -y update
4 Using AMP to configure your Asterisk@Home server
4.1 What is AMP?
Asterisk Management Portal makes Asterisk configuration easier by providing a graphical method (via a web browser). AMP allows you to configure the textual configuration files that Asterisk needs in order to function.
AMP can configure the following in Asterisk:
Incoming Calls — Specify where to send calls coming from the outside
Extensions — Add extensions and set voicemail properties
Ring Groups — Group extensions that should ring simultaneously
Queues — Place calls into queues and allow them to be answered in order
Digital Receptionist — Create voice menus to greet callers
Trunks — Set up trunks to connect to the outside world
Outbound Routing — Manage which trunks outbound calls go out
DID Routes — Specify the destination for calls if their trunk supports direct inward dial
On Hold Music — Upload MP3 files to be played while users are on hold
System Recordings — Record or upload messages for specific extensions
Backup and Restore — Create, back up, and restore profiles of your system
General Settings — Set basic dialing, company directory, and fax settings
4.2 Configuring an extension
- Open your web browser and type HTTP://YourAsteriskIPaddressHere
- Click on AMP, then click setup.
- Click Extensions, then Add Extension.
- Select the type of extension.
- Create extension 200 and type in a password for registration like "abc123". Then enter the name of the person using this extension.
- Select enable, and enter a voicemail password. Use something you can type on a phone keypad like '1234'. Enter an e-mail address where you would like your voice messages sent and click add extension. Then click on the red apply bar at the top of the screen.
- Configure your extension in a soft phone for testing. Xlite is the best choice for this test. Remember to use your extension number and password in Xlite. Use your Asterisk@Home private IP address as the sip proxy.
- Make a call from your phone. Try *43 this is an echo test.
NOTE: If the extension you are configuring does not connect remotely (outside the Local Area Network) you will need to change the NAT option to yes.
Just create the extension, submit the changes and go back to edit it. You will see NAT=never; change it to NAT=yes
Every time you make a configuration change and click “Submit” a RED bar will appear at the top of the screen “You have made changes – when finished, click here to apply them”. This bar will reload the .conf files. Click this bar in order for the changes to take effect.
4.3 Configuring trunk for inbound and outbound calls
- Connect to your Asterisk@Home using a PC in your network typing HTTP://YourAsteriskIpaddress In your web browser.
- Click on AMP (Asterisk Management Portal) and then click setup.
- Click Trunks then Add SIP Trunk.
- Only enter the following information:
Trunk Name = VarPhonex
User Context = sip.varphonex.com
Registration String = xxxxxxx :email@example.com
NOTE.- Replace “xxxxxxx” with your Virtual Number and “My-Password” with the sip password for that Virtual Number.
- Click “Submit Changes”
4.4 Configuring Outbound Routing
You will need to allow calls from your phone to go out on a specific trunk. When having more that one trunk, you will need to setup dialing rules (dialing patterns) in order to specify which calls should go out on which trunk.
Using AMP (user: admin, pass: password):
- Select setup
- Click on Outbound Routing.
- Assign a name for your route.
- Enter the following Information:
Change Zap/g0 to varphonex
4.5 Configuring Incoming Calls
Configuring incoming calls will allow calls from VarPhonex go someplace in your PBX.
Using AMP (user: maint, pass: password)
- Select setup
- Select Incoming Calls.
- Under the Send Incoming Calls from the PSTN to: section drop down the box next to Extension: and select the extension 200 you created earlier.
Click Submit Changes and then click on the red apply bar at the top of the screen.
Call the VarPhonex Virtual number or the DID associated to it. Your SIP phone extension should ring.
4.6 Configuring the digital receptionist
The digital receptionist works the same as any auto attendant in a PBX. You will be able to record your own voice prompts and create your own menu with your own options. To configure the digital receptionist follow these steps:
- Go to the setup-digital receptionist page and enter the extension number you are using to record your voice. In this case you can try extension 200.
- Name your menu (ex. Main Menu)
- Dial *77 and record your message. You can listed to your message by dialing *99.
- Enter the number of options you want in your menu and press continue.
- Associate the corresponding option with the corresponding action. For example: Option 1 can ring on a specific extension, other voice menu, a voicemail, etc. The option must be a number like 1, 2, 3, etc not extension numbers. Placing extension numbers as options is incorrect.
- Click continue and save your changes.
Now go to setup-incoming-call and associate this digital receptionist to wanted incoming calls.
Here is an example of a Digital Receptionist:
Thank your for calling VarPhonex. Dial the extension number if you know it or dial 1 for customer service, 2 for technical support, 3 for accounting or 0 for the operator. Thank You.
Up to this point we have performed a basic installation and configuration of Asterisk@Home.
In order to optimize its performance and utilize limited bandwidth when making and receiving calls, we need to make the following configurations:
- Install low bandwidth codecs such as G723 and G729.
- Restrict the VarPhonex trunk to use low bandwidth codecs.
- Restrict Asterisk to use low bandwidth codecs for remote extensions.
Install low bandwidth codecs
You can find the specific codes for your type of CPU in the following link:
DISCLAIMER: You might have to pay royalty fees to the G.729/723 patent holders for using their algorithm. To install the codec, move the .so file into the /usr/lib/asterisk/modules directory in your Asterisk server. It is very important that you choose the codec according to the CPU your server has. In case you choose the wrong type, Asterisk will not load and give you an error message. All you have to do is remove the file and restart your server.
Here is the command to remove files in CentOS (Linux):
rm filename (replace “filename” with the name of the codec file)
Once you determine the right file for your server, enter the following commands in your server's prompt and press enter
Assuming that the file I need is codec_g729-gcc-pentium4-no-sse.so
Enter the command:
wget http://kvin.lv/pub/Linux/Asterisk/codec -file-you -need
Replace “codec-file-you-need” with the actual file name
In order to determine if you downloaded the correct file, run the following commands:
asterisk –r [press enter]
restart now [press enter]
asterisk –r [press enter]
show translation [press enter]
If the file was loaded correctly, you will see the translations under G729.
Perform the same operation to install the G723 codec.
Restrict the VarPhonex trunk to the above mentioned codecs.
- Use a PC on your network that has a web browser and connect to your Asterisk@Home box using HTTP:// YourAsteriskIpaddress .
- Click on Asterisk Management Portal and then click setup.
- Click Trunks, then on the VarPhonex SIP Trunk.
- Change the following:
5.3 Restrict Asterisk to use low bandwidth codecs for remote extensions.
- Use a PC on your network that has a web browser and connect to your Asterisk@Home box using HTTP://PutYourAsterisk@HomeIpaddressHere
- Click on Asterisk Management Portal and then click setup.
- Click Maintenance.
- Config Edit
- Click on sip.conf
- If not present, add these lines shown in red
port = 5060 ; Port to bind to (SIP is 5060)
bindaddr = 0.0.0.0 ; Address to bind to (all addresses on machine)
context = from-sip-external ; Send unknown SIP callers to this context
callerid = Unknown
- Click UPDATE
- Click re-Read Configs located at the top of the screen
NOTE: VarPhonex does not provide phone technical support for Asterisk. We only provide LIMITED email support through our ticketing system from within our website.