Aterisk PBX Phone Setup Abridged Pt. 1

At my job I have recently started taking on the responsibility of running the local asterisk box for the semi-startup tech company I work for. Previously they had outsourced the task because they lacked anyone experienced in UNIX enough to carry out the task within my particular office. The company offers Windows based solutions, but have an occasional Linux box running around, such as Asterisk boxes, or VMware virtual servers at our datacenters. Our local Asterisk box runs on CentOS 5.1 with a 23 channel PRI inbound and VOIP phones on our desks. We have several VOIP trunks connecting other systems and users, such as contractors and executives that work from home. I dove into the task not knowing anything about Asterisk, but have learned enough about the setup to modify dialplans and add users. So I decided to build my own from scratch to further my learning. Now being a Fedora user one might expect this to be based on an RPM install. I decided not to go that way. I have future plans for this system that might be non-standard so I felt justified that a good ol fashioned tar ball installation would be best. So let’s start with the basics to give you an idea of how easy it can be to build your own phone system.

First let’s download everything. I used the latest 1.4 stable release of Asterisk. You will need LIBPRI, ZAPTEL, and ASTERISK for a basic loadout. I also opted for ASTERISK-ADDONS just to see what they were. This is about as basic of an install as any other Linux program where you download the source. First download everything and then unpack it with the trusty tar -xvzf command. Now let’s build a phone system. Please keep in mind this was built on my Fedora 7 Desktop/Server double duty machine and everything was run as root user so your mileage may vary.

Change directory to the Libpri directory and issue the following commands.
make clean
make
make install
See it was easy, assuming you didn’t get any compiler errors. Did I mention the Asterisk website?

Next step is to cd over to the Zaptel directory. Before installing the Zaptel modules you will need to satisfy some dependencies for your system. On a Redhat derived system such as my install of Fedora, the big ones you will need are kernel-devel and kernel-headers. Easily accomplished with yum or whatever package manager your distro uses. The first command you run should help you figure out what your lacking all together and even tell you the command to resolve the dependencies. Here we go….
./install_prereq test

Told me I was missing some devel files for USB devices and gave me the following command to fix it.
yum install -y libusb-devel
After yum installed the required libraries I ran the command again to double check.
./install_prereq test
Everything looked good, lets install.
./configure
I ran the following command just to checkout what was going to be built and installed, but canceled off.
make menuconfig
make
make install

And that’s it for Zaptel. It’s installed, now let’s move on to Asterisk.

Ok so cd over to the Asterisk directory. During the installation there is a menu that allows you to check the options that will be installed and the dependencies lacking for anything special. If you know that you want to install a specific feature, use this menu to help you figure out the correct software to install in order to satisfy your dependencies. Also if you have problems compiling a specific portion of the system, you may be able to de-select it in this menu and try the compile again, as long as you know you won’t need it. I did this on a codec that failed to compile, and I have never used it at work, so I just removed it from the install. I did make sure to choose the Ulaw/Alaw and GSM codecs along with all the sound files for my language and codecs chosen. Let’s get started.
./configure
make menuselect
make
make install

The above command will begin downloading everything you need that wasn’t included such as sound files.
make samples
This command was optional, but should provide a base line of configuration files for us to work with in building our system.

If you go ahead and build the addons, they are a simple compile.
./configure
make
make install
make samples

Now you should be able to start the Asterisk server in the foreground with the following command.
asterisk -vvc

See that was easy. You should now have the Asterisk console staring you in the face. Just issue the help command to get an idea of what can be done from the console.

Now a lot of you may ask why in the world would you want to build a phone system unless you do it for a living. So here are some reasons.

  1. You want to connect it with the one at work allowing you some work from home days.
  2. It allows you more control over the phone calls coming into your house, allowing you to dodge telemarketers or control the calling habits of your children.
  3. It allows you to put something else on your resume.
  4. With providers like BroadVoice you can have a VOIP account to the real world, real cheap, with left over hardware, and not have to worry about a contract or specialty adapter boxes.
  5. How cool would it be to have an extension in each room of the house, or have voicemail for each family member.
  6. Conference calls with the family anyone? That’s right Asterisk has builtin conference bridge functionality.

These are just a few reasons you may want to look into Asterisk even as a hobbyist. Now if this is professional, keep this in mind. My company maintains a very brand name VOIP system for a client. This system has not been updated to work on new OS’s and is a patch together of at least 2-3 products to get the functionality needed. Asterisk is free when it comes to licensing, actively maintained. centrally managed, and flexible as hell. Just remeber the philosophy behind the Asterisk community, “It’s just software”. This is meant to reflect the lack of limitations. Being open source, if you can write it, it will do it.

Grandstream GXP-2000 SIP VoIP Phone Dual RJ45 VoIP

Grandstream BudgeTone 200 - VoIP phone - SIP

Asterisk: The Future of Telephony

Share/Save/Bookmark

Vyatta Linux Router, Pt 2.

Well I’m a sell out, it’s official. I’ve had such an overwhelming response, according to my stats, on the Vyatta router story that I had to do another. So let’s grab some documentation and get started. By the way here’s the quick start guide, and the command reference for your convenience. I do this because to get the command reference they want you to register and give your e-mail address, unless you know the direct link. Ok, so back at the barn….. I set my test board back up but hooked to my KVM on my main machine and plugged into my network. My main box is running DHCP with Dynamic DNS updates to my in house DNS server on the same box and getting routed out the house through the same box via a NAT firewall through my 8Mb/512Kb cable modem. The main machine is a AMD FX2 3800 with 2GB and dual onboard Gigabit NICs. The test board is from a thin client (got it off an auction) and just a little oversized from a standard mini-itx, which has internal 100Mb NIC and basic IO including audio, video, serial, usb, etc. It is running an unknown VIA 1Ghz processor with 512MB ram and a 1GB CF card for storage, as well as being loaded with a second D-link 100Mb NIC in the single PCI slot. Now that we have specs out of the way, let’s fire this thing off.

So I started booting the test board and then pulled up the docs on a different screen to learn how to setup a few basics. Skimming the docs I learned that they seem to have taken a lesson from the routing industry and have created a Command Line Interface similar to popular commercial routers. You can have different users with different privileges and then there are different modes for working in the router. The first mode is called “Operational Mode” which allows you to run basic utilities for diagnostics and show settings for troubleshooting. To set anything you need to enter the “Configuration Mode” with the command configure, which allows you to change and commit settings. We’ll hit that in a minute. First let’s login. Default credentials are root with a password of vyatta for your privileged user, and username vyatta with password of vyatta for your non-privileged user. Now let’s check our connectivity and see if we can talk to the network we are plugged into. Vyatta has the familiar tab completion for commands found in both UNIX systems and commercial routers, which helps you muttle your way through with minimal referencing of the docs. Logged in as the root user I did the following…..

Last login: Fri Aug 8 01:28:13 2008 from 192.168.60.1
Linux vyatta 2.6.23-1-486-vyatta #1 SMP Sat Apr 19 12:37:43 PDT 2008 i686
Welcome to Vyatta.
This system is open-source software. The exact distribution terms for
each module comprising the full system are described in the individual
files in /usr/share/doc/*/copyright.
vyatta:~# show interfaces ethernet
Interface IP Address State Link Description
eth0 192.168.60.252/24 up up
eth1 - up down
vyatta:~#

Now you can see in this terminal output that I already have an address, but it didn’t to start with, so I need to configure that……

vyatta:~# configure
[edit]
root@vyatta# set interfaces ethernet eth0 address dhcp
[edit]
root@vyatta#

Ok so far so good. Now let’s setup ssh so we don’t need a monitor and keyboard attached to it.

root@vyatta# set service ssh port 22
[edit]
root@vyatta# set service ssh allow-root
[edit]
root@vyatta# commit
There should be some text here about generating the ssh keys and restarting the service.
root@vyatta# exit
exit
vyatta:~#

Ok so now we should be able to login to this thing. Let’s go find the IP address and check the interface.

vyatta:~# show interfaces ethernet detail
eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:16:ec:54:fd:e8 brd ff:ff:ff:ff:ff:ff
inet 192.168.60.252/24 brd 192.168.60.255 scope global eth0
inet6 fe80::216:ecff:fe54:fde8/64 scope link
valid_lft forever preferred_lft forever

RX: bytes packets errors dropped overrun mcast
76484 719 0 0 0 0
TX: bytes packets errors dropped carrier collisions
54652 443 0 0 0 0

eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:40:05:08:9e:26 brd ff:ff:ff:ff:ff:ff

RX: bytes packets errors dropped overrun mcast
0 0 0 0 0 0
TX: bytes packets errors dropped carrier collisions
0 0 0 0 0 0

vyatta:~#

Looks good to me. Now go ssh over to it and play. I will post more to come.

Linksys WMP54GS Wireless-G PCI Card with SpeedBooster

M270A-BK60 Mini Itx Case Black with 60W Power Adaptor

D-Link DGS-2208 8-Port 10/100/1000 Desktop Switch

Share/Save/Bookmark

Instant Linux Router, Just Add Hardware

The other day at work someone smacked me with a clue-by-four in regards to a new Linux distro for the purpose of routing. It’s called Vyatta. You can buy their hardware or download the distro and roll your own. The free version is called Vyatta Community Edition which is on release 4, otherwise known as VC4. Now my main machine runs Fedora Linux, and it is EVERYTHING for my network. DHCP, DNS, Internal Web, VPN Server for my box at work, etc. Now the more I’ve played around with Linux over the 11+ years I’ve used it. The more I’ve wished for a seamless router solution based on it that rivaled enterprise level gear. Don’t get me wrong, I like my machine handling network functions more than using a $50 router out of the local retailer, but I’ve always had a need for slightly more. Take in mind, I work in IT, I went to school for IT, and I’m (re)studying for Cisco certifications. Cisco is good gear, no doubt about it. That’s why they have such a market share of the enterprise level stuff. But it’s prohibitively expensive for home users and small businesses that could use advanced functionality. Looks like Vyatta may be the cure for that. So I took the liberty of downloading the community version of it and loading it up. Now I have a mini-itx board I found for cheap at an online auction along with an LCD that I dug up at a recycling center (thrown away because its base was broken), a CF-IDE converter, and other bits and pieces. I figured a router should be embedded with no mechanical storage. Burn the CD off, boot the test board up on an old CD-ROM, and then I ran CFDISK to partition the Compact Flash. Once done I ran the setup script as detailed in the documentation, only straying from the defaults when it asked me to create partitions. I now understand that this is unneeded and that the setup script will handle Compact Flash. Now for the next part, learning the system. VC4 has a Command Line Interface (CLI) to it, but it’s specific to VC4. VC3 had a web interface I’m told, and VC4 is predicted to have one at a later date. So now I have to learn the command line. There is a quick start guide, but I have yet to have time to read it. This is just step one.

My test setup for Vyatta

My test setup for Vyatta

Part 2

Intel D945GCLF 533FSB DDR2 667 533 Audio Video LAN Box Mini-ITX Motherboard

Embedded Ide To Cf Adapter

SanDisk 2GB ULTRA II CompactFlash Card (SDCFH-2048-901)

Share/Save/Bookmark

Terminal Services and Barcodes

Given the fact that I do system administration work for a hosted solutions provider, I thought it would be nice for a change of pace to post a computer related article. I seem to be tied up in all sorts of mechanical projects at the house, time for a change. So let’s kick this off with some things I figured out at my job, without giving away confidential data. One customer today was using hand held bar code scanners made by Symbol. Specifically they had 2 models, LS1902 and LS2208. They had no problem scanning barcodes and getting them to display in notepad on the local machines. The trouble came about from trying to get a proper read into their hosted terminal services system that we maintain. Their barcodes had the “&” symbol in them but it would just put the number 7 in their place. Further troubleshooting revealed that sometimes it would also shift the case of the letters in the barcode. We then realized that if the Terminal Services window was not in fullscreen mode that it would work properly. After some research and experimenting we found a work around for the issue. It had been working previously but broke several days ago coincidentally. The solution was as follows. Go to your options within the connection you are using on the local machine (options button on new connection, or right click and edit an existing connection icon). From there go to the local resources tab, then look at the keyboard section. There should be a field there about “Windows Key Combinations”, change the setting to “On the local computer”. It’s now time to test your barcodes. See Picture….

Local resource tab for Terminal services connection

Local resource tab for Terminal services connection

This is using RDP Client V6 on Windows 2K3 terminal services, which is also the same combination we were troubleshooting. The down fall to this fix is that you will not be able to use Window’s shortcut keys within the Terminal Services connection. (Ex. Alt-Tab, Win-E, Win-D, Win-L, etc.) These combination will only work on the local terminal. The default behaviour is for it to act locally unless in full screen mode on the connection. Changing this setting now forces all those combination keys plus more to act locally at all times. Use cautiously.

Terminal Services for Microsoft Windows Server 2003: Advanced Technical Design Guide (Advanced Technical Design Guide series)

Microsoft Windows Server(TM) 2003 Terminal Services (Pro-One-Offs)

Windows(R) Server(TM) 2003/2000 Terminal Server Solutions: Implementing Windows Terminal Services and Citrix MetaFrame Presentation Server 3.0 (3rd Edition) … Addison-Wesley Microsoft Technology Series)

Share/Save/Bookmark