Wednesday, May 25, 2016

Small Business Set-up for a Vo-ip solution with freepbx

I have never considered myself as a Linux guy and I have always went with what is really-easy to implement and configure, and by the best-practices, especially when it comes to implementing IT solutions to enable businesses.

Lately, my boss has been toying with the idea of setting up and venturing into the possibility of setting up our own VOIP phone system PBX with handsfree sets, SIP trunk, etc-etc-etc.

My first response was - where can I find the time to figure this out??

Thankfully, the steps aren't that difficult!

The process, well, summary of it anyway, would be:

  1. you need a PABX server. 
  2. you need a SIP Trunk from an ISP
  3. you need soft-phones - apps basically
  4. you need a good head-set

I am not talking about pulling ISDN line in, and getting 30 voice direct lines frm Singtel.
What we're hoping to achieve is to ride on the existing stable Singtel Evolve/ELITE, any other ISP Fiber broadband plans that we can utilize for voice, since voice call uses significantly lower bandwidth than... say- youtube!


As such, we decided to go with the easiest to set-up, and most cost effective. Here is our plan.

  1. Set-up a new hyper-v host (Windows server 2012r2), we use trial version first... on a spare-old-server, with 1-TB of RAID-1 Storage array.
  2. Download and set-up FreePBX virtual machine (we used freePbx server with the CentOS 5.2 core, but in a virtual box vdi format.
  3. We set-up the virtual machine in VirtualBox 5.2, and get it to work. 
    1. meaning, we configured network, configured the phone system, configured the settings, and - 
    2. tested the call with a trial SIP trunk from the States.
    3. we tried calling one another internally using our computers and mobile-phone using the Zoiper client
  4. After proven to work, we proceed with the conversion of the VDI virtualbox image that has been configured-and-tested, to a VHD format.
  5. Then, we proceed with the set-up of the VHD on our Windows Server 2012r2 Machine. Note, we used a HP Proliant ML150G6 server for this purpose. The server is about 6 years old, but it works, and the VM utilizes only about 2-3-GB of memory (max), and 10-GB of disk space.
  6. Note that FreePBX actually do not support the configuration and running of their server in a Virtual Machine, on Hyper-V. Note here - 
    1. http://community.freepbx.org/t/x64-distro-on-hyper-v/16296
  7. And there's also issues with FreePBX running on hyper-v with poor line quality... note - 
    1. http://community.freepbx.org/t/poor-call-quality-packet-loss-jitter-on-hyperv-machine/21360/4
    2. As such, we ought to rely only on the main network adapter and not the legacy network adapter
  8. But we the IT Pros are all in the business making things happen, so in the spirit of that, we tried and we did.
  9. There is a post in note-6 that a few people manage to get the set-up to work. Here is a summary:
    1. Set-up the Hyper-V VM with a legacy network adapter (more details here if you need pictures)
    2. Remove any existing network adapter in the hyper-v manager settings for the VM
    3. ensure that the legacy network adapter is set as disconnected for now. (not connected to any network)
    4. Load the ISO file for Microsoft Linux Integration Toolkit - at the point of writing, i used 4.1, for Cent OS 5.2
    5. Start the VM, Login as root, mount the DVD/CD-Rom device, go to the relevant OS folder, and .\install.sh
    6. Once the integration services and drivers are installed, we are in business, and we can proceed to shut-down the machine.
    7. Proceed on next to remove the legacy network adapter in Hyper-V, and install the standard Hyper-V network adapter.
    8. Note the MAC Address, and set the connection to your LAN.
    9. The VM will boot, and if you're like my situation, the network would not work because of the changes of network interface adapter and the issues with the start-up/enable of the adapter.
    10. Based on this link here the issue is related to the choice of network settings and adapter to start.
      1. Basically - Cent OS will start up the relevant network adapter with the required settings like IP/SM/GW from the start-up scripts. 
      2. Since the FreePBX VM was originally set-up in virtual-box, we had to re-configure the start-up script as the network interface card has been changed from eth0 to eth2 (in our case).
      3. using the command "ifconfig" will tell us what is the name of the current enabled network adapter.
      4. if there's no eth(number) available, it means that you need to 'turn-on' the adapter by ifconfig eth(number) up and this command will bring-up the network interface adapter.
      5. next, go to the following location /etc/sysconfig/network-scripts and look at the adapters available. 
      6. I had these adapters, and I have ifcfg-eth0 and I noticed that eth0 is no longer available in my step-3 above while running ifconfig. But, I did have eth0, and i do not have any ifcfg-eth2 file.
      7. As such, I proceed with my vi editor to check the settings for ifcfg-eth0, make the necessary network address amendments (if there is any), and save it.
      8. Next, I cheated by renaming the ifcfg-eth0 to ifcfg-eth2 (since eth0 is no longer in use/not available). - rename files in Linux using "mv" command.
      9. Reboot the VM.
    11. The VM is now accessible on the local network
  10. We proceed with the set-up and application of the SIP trunk from MyRepublic, they are one of the more affordable options down here in Singapore.
  11. We used our existing fiber broadband line, thank God we have 1x Static IP address (dynamic works too by the way.. just need a Dynamic DNS provider like dyndns.org or noip.com)
  12. We performed the necessary port forwarding (NAT) on our firewall (Sonicwall)
  13. Installed Zoiper on our client computer and devices
  14. We are now... in Business! 

I will update with more details as we go along. But thus far, this is a summary that I am hoping that we can refer to in future, and for the community out there to benefit from realizing how fast/reliable our Singapore Fiber Broadband network is.

If we can save more money with it... and change our 15-20year old PBX or Key-phone systems.... why not? :)

No comments: