Get Adobe Flash player

postheadericon Blogs

postheadericon VoIP - Easier than you may have thought!

VoIP (Voice over Internet Protocol) is everywhere these days.

You can find variations of it in Yahoo Instant Messenger, Skype, Vonage etc. Often these services are free unless you want to make calls to regular "LAN Line" telephones or call people on other networks: e.g. Yahoo User wants to dial a Skype user or some such business. There are a lot of possibilities these days and I'm definitely not an authority on what is the best way to go.

So where is this article going?

I'm going to explain how within 3 hours I was able to create my own VoIP system complete with voicemail, ability to call people on my computer network and even receive a call from someone four states away over the internet. I didn't need to use or sign up for any services and I only used my own computers and a registered internet domain name. To be clear - that person who called me was a "member" of my phone system. They called me using the credentials to my network I gave them. Now I want to share a little about my first stab at making my own VoIP phone system with you simply because I was floored at how easy it was. Now this system can't make regular phone calls yet, nor does this article get into that but regardless... I already have a basic phone system for free!

If this whole VoIP thing doesn't look easy or doing this kind of project on your own servers seems too risky, don't fret because there is help out there! There are many places you can go online to learn more about VoIP. Alternatively, we can help you cut through all the noise. Give us a call or contact us via our contact page and we can discuss what your needs are and devise a plan or offer suggestions then. Let us be clear: We aren't VoIP or PBX experts specifically, but we are experts when it comes to computer networking, CRM and software customization, installation and configuration.

The Scenario

Jegas, LLC is a virtual company meaning our consultants are literally scattered about the USA. Now, for each consultant, there are various methods needed to connect any two - where email is typically the "silver bullet" to get a message across. Other mechanisms are using our cell phones and lan line telephones and instant messenger. We all have different schedules and obviously working as teams on various projects, we need to be in touch with other. Well, realtime isn't always possible, but lets face it - real time is a necessity when you need to collaborate in the thick of a project. Also, we need a way to route calls from our clients directly to the consultants they're working with at any time.

Well, we are working on a large integration project at the time of writing this with a call center/telemarketing company currently where we are tailoring a Business Process Management (BPM) system named Process Maker and the Jegas Application Server work with their VoIP systems which include Open Source systems VICI and Asterisk PBX. So, I had to ask, what does one need to make their own phone system. The answer: Asterisk, a VoIP telephone or a soft-phone such as X-Lite. If you want to dial regular phone lines you need an FXS card. The joke that followed was that I might be able to pull this off in a weekend or more but someone like their network administrator can bang out a full system in twenty minutes. As I mentioned above - I accomplished quite a bit within 3 hours.

Requirements

  • Linux - (FYI - You can use the softphone in Windows, but Asterisk needs Linux.) I used the CentOS Linux distribution (32 bit) but I imagine the installation would work fine on other modern Linux versions. To use the exact version I did, try grabbing this ISO file (you need to make into a CD-ROM) and then it can be used on a virtual machine or a dedicated system to install a CentOS (32 bit) onto: ftp://jegas.net/archives/os/Linux/CentOS/CentOS-5.3-i386-netinstall.iso
  • Asterisk PBX - I used the source code distribution and installed it with the sample scripts to get started. You need to follow the README.txt file instructions. Here is the file I used: ftp://jegas.net/archives/utils/networking/voip/asterisk-1.4.26.2.tar.gz hNow you should note I tried to use their version 1.6.2.0-rc (release candidate) but after multiple iterations of downloading it and trying to open the archive I gave up due to the file being corrupted.
  • Softphone - I already mentioned above I used the X-Lite soft-phone (softphone?) for this experiment and it worked fine. I did find that the offerings for soft phones are limited but they are out there. For software customization reasons (I am a die hard programmer after all), I was trying to inquire about the cost of CounterPath's C++ SDK so I could get fancy later - but when I saw a web form with 50+ fields to fill out, I decided to shoot an email and see what else is out there. There are many... so if you're a die hard developer - you might want to do your research like I plan to on these other soft phones, but in the mean time - Counter Path's X-Lite will get you started and they do have a nice product line without question.I'm assumingyour softphone machine
  • Internet Domain Name - This is NOT REALLY REQUIRED unless you want to reproduce what I was able to do - having someone call me from their softphone to mine accross the internet.

Installing Asterisk

  1. Download and unarchive asterisk - First thing I did was download the Asterisk source code file to my Linux Desktop and because I'm using a GUI I was able to extract it "to named folder" with a click or two. At the command line, I would have executed: tar -xvf asterisk-1.4.26.2.tar.gz which would have done the same thing.
  2. Install Asterisk - Navigate to your new unarchived Asterisk installation directory and read the README.txt file that is comes with.Follow those instructions. IMPORTANT: I installed the sample scripts because I am a newbie! (And I'm glad I did Smile )
  3. Run Asterisk - Open a terminal/console window and type: asterisk -vvvc
  4. Note: To force asterisk to reload the configuration files after you edit them, enter the following command into the running terminal/console that is running asterisk's CLI: module reload
  5. Asterisk Configuration - Oh my goodness is there a lot to this Asterisk thing but fear not - this is the case where I stumbled into some fortune and all I had to do was set up my "phone user" and I was good! (I'll save you some iterations of fighting with things hopefully) - all I ultimately did was open the /etc/asterisk/users.conf file and make sure the sample "Joe User" lines were all commented out (with semi-colons) and then I appended the settings below. Note after I entered the settings below, I reloaded the configuration files (so my changes would take) by entering the module reload Asterisk CLI command as mentioned above. Note, at anytime to stop Asterisk, you can press CNTL+C and you can naturally restart it by just typing asterisk -vccc again at the command line.

;-----------------------
; Jason P Sage
;-----------------------
[6000]
fullname = Jason P Sage
email = This e-mail address is being protected from spambots. You need JavaScript enabled to view it.
secret = 1234
hasvoicemail = yes
vmsecret = 1234
hassip = yes
regexten = 6000
callerid = "Jason P Sage"
host = dynamic
mailbox=6000@default
;-----------------------

I'm sure this isn't the ideal configuration, I just know I was getting these host not dynamic authentication error 403 messages and adding host=dynamic fixed it. Good enough for me for now! (FYI - after my testing I kept copying and pasting that code snippet and tailored it for each Jegas team member. They all have phone extensions assigned now Cool.

 

Configuring your Domain

Ok, this was some new ground for me to cover. I learned that VoIP seems to have it's own way of using DNS. Normally when we go to a web site we type a URL. This URL hits a DNS server somewhere and gets the IP address of that domain + cname comination. (Domain would be say google.com, and CNAME would be www. Together www.google.com should resolve to an IP address.) VoIP however uses a different kind of DNS record that I never had to use before: The SRV record (or service). So, instead of just returning the IP address of a domain, the SRV record returns information like - which port is the VoIP running? What Internet Protocol (IP) is in use? there are a few other settings as well - but regardless - let's just get the thing to work shall we? We can all google later why it works.

Ok - going to that cname topic again, you need to log into your domain name provider's self help kiosk, like we have at http://www.jegas.net for our clients who purchase domain names from us, and go to the area that allows you to control your domain name's DNS settings. In our system, you navigate to My Domains and run the Domain Manager applet. In there you'll find a link to Total DNS Control which allows you to edit your domain's MX records... such as CNAME records and SRV records. We need to create one of each.

  1. Create your SIP CNAME record, that is, just add a cname record named sip
  2. Make sure the IP address this new sip "CNAME" mx record points to is your Asterisk server's outside IP address so people on the outside can reach it (if that's what you want of course). Usually if the server has the same address as your first MX record, you just put a @ in the host address field. If you have NAT routers and firewalls preventing communication, I'm afraid those topics are outside the scope of this article. I will tell you that the default PORT this stuff uses is 5060. I personally opened both UDP and TCP just to make sure my firewall wasn't causing me grief.
  3. Create your SRV record next with the following settings (again we can google the why's later): Service: _sip._udp.yourdomainname  Protocol: _tcp  Name: pbx  Priority: Weight: 20  Port: 5060  Target: @    Ok.. Target might need to be changed to the specific IP address of your PBX if it is different than your main host's IP address.

 

Configuring your X-Lite Softphone

Diagram of SoftPhone by Counterpath

Windows

  • Download the X-Lite softphone from CounterPath, install it and run it.
  • Using the diagram to locate the Windows Config Menu - select SIP account settings.
  • Click the Add button. Highlight your new account with a click and then click the properties button. Note: X-Lite only lets you have one account configured at a time.
  • Settings: Display Name: Your name  UserName: Your Extension  Password: 1234  Authorization Name: Your Extension  Domain: yourdomain.com (or whatever, but without the SIP prefix. e.g. don't put sip.yourdomain.com) Make sure the Register with domain checkbox is checked, and then click on the Domain radio button below that. Leave the default dialing plan text as is, and click Ok, then clic Close on the SIP accounts dialog window.

You should see the phone try to register. If everything was configured like I have outlined - clicking the green button should give you a dial tone, but you can't dial real phone numbers yet - just extensions of other users on your private VoIP network and a couple other numbers that are worth mentioning. I'll mention those below.

 

Linux

The linux phone looks a little different and regardless of the settings I tried, it was always displaying that it was Awaiting proxy login information. But, I managed to tell a Linux user over Yahoo IM what the parameters were and they called me! Cool eh? Well.. here they are and what to do:

  • In the picture above, I drew a circle of what looks like a phone jack or something for Linux above that tells you where to click the phone to get the configuration menu opened. It'll be a LCD looking display - quite neat in my opinion - beats Windows Dialogs in appearance - though navigating it was a little odd. For example, if you don't know that you should TRY to scroll each screen, you might not be aware you are missing an option or two that don't fit visually in this display window. Note: While opening this window up for this article to reference it, I found I kept getting FireFox windows opening to counter path's web site, I'd close it, then another would pop up. I eventually got it to stop by shutting down the softphone but this annoyed me. Additionally, the configuration display didn't seem to open when I told it to - or it was delayed. Bah - but I digress. I just wanted to share that in case you run into any of this bedlam. 
  • Enabled: Leave it set to NO until you fill in the other stuff. Display Name: Your Name  Username: Your Extension  Authorization User:  Your Extension  Password: 1234  Domain/Realm: yourdomain.com (or .net whatever it is)  Sip Proxy: Leave blank Out bound Proxy: Leave Blank  Use Outbound Proxy: Default  Send Internal IP:  Default  Register:  Default  Voicemail SIP URL: Leave Blank Forward SIP URL: Leave Blank (now scroll down as far as you so you see the rest of the options) Use Voicemail: Forward to Voicemail  Direct Dial IP: No Dial Prefix: Leave Blank Provider Website (if applicable): Leave Blank Update Settings (if applicable):  Leave Blank    Ok... NOW scroll up and set "Enabled" to YES Cool

 

Everything is installed... now what?

Ok, you have your Asterisk PBX running, your softphone is fired up and its connecting to your PBX. GREAT! Now, you hopefully have a headset with a microphone or at least a PC microphone and headphones attached to your sound card. Dial 1000 and then click the GREEN phone icon on the softphone. Voice mail can be accessed by dialing 8500, your extension, the hash/pound key, then your voicemail password (1234) followed by the hash/pound key. 

Note: the recording in the extension 1000 greeting mentions dialing into extension 1234 to "emulate" a call coming in to your system (say from a lan line that you set up with a FXS card). When I tried, I just heard a dull hum after it connected. If you have better results, let me know! Meanwhile, this is just the beginning but I intend to finish my phone network with multiple lan lines and FXS cards. When that is done I'll have a complete internet enabled phone system capable of dialing anyone in the world and staying in touch with people on my network without worrying about per use  charges!

Security

Another thing to look into is that VoIP can be run so that phone calls are encrypted. One of the benefits of having your own network is not having to rely on or pass your information through other publicly available networks like Yahoo. Without encryption though, there still is the potential that eaves droppers could be listening. The good news is that I've read that the encryption isn't to hard to set up, so you might want to look into it yourself.


Wrapping it up

Ok - I'm the first to admit these are probably not the ideal PBX and/or softphone configurations, but these will get you chatting on your new VoIP network. Shoot, with a little bit of coordination with your friends, you could make your own private VIP phone network! Why not, the voicemails get emailed to them when they aren't online. They won't miss a thing!

That's it for this article,  I hope you find it useful and perhaps even fun. I felt pretty good when I heard my own dial tone, even if I couldn't call my mother and I could only connect to another computer enthusiast for my first long distance call. I thought this was very cool! Cool

 

--Jason P Sage

 

 

 

 

 

 

 

 

 

The Jegas Application Server is a 10 year software development project which has now been released as Open Source under the GPL3 license.  If you would like to help the Jegas development team improve JAS,  please contact us or make a donation.


vTigerCRM

Solution Graphics

 

Added 2010-12-18
free counters