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

Ballistics Gel

Just about everyone has seen the CSI series on CBS and the various other shows dealing with forensics, as well as shows like Myth Busters. Within the episodes of theses iconic shows, you will see the use of ballistics gel to help determine the specifics of traumatic wounds or show the effects of various “high kinetic energy” experiments or terminal effects of ammunition. Looks like cool stuff but where do you get it. Well I’ll give you a hint “gel” is short for gelatin. That’s right folks, there’s always room for Jello. Of course let’s not waste the tasty treat on something that is being made to be destroyed. For this homebrew project go look for the unflavored raw gelatin. It’s usually on the baking isle of your local mega mart. OK folks, now here’s the magic ratio. You want 1lb/gal of water. That’s 16oz/gal, 4oz/quart, 1oz/cup. Now the ounces, are in weight not volume. The common ballistic gel mixes are made by the same people who make brand name edible gelatin, it’s just slightly tweaked so that when mixed per directions, it comes out near the ideal calibration point needed by forensic labs. However, each batch made must be calibrated by firing a projectile into it and measuring the penetration. I was not looking for something that scientific out of a homemade project. I just wanted to know the general difference of impact between my .45 230gr FMJ rounds and my .45 230gr Hydra-shok JHP rounds that I keep around for home defense. Unfortunately I left the camera behind when I shot this stuff up. On top of that the test batch I made was just to see if I could do it. Despite their lack of size, I was convinced of the effectiveness of my defense rounds. “Daddy like.” This is real simple folks, but it stinks to high heaven to do this. If you are sensitive to smells, beware. When I try this again, it will happen outside. Why? Go read about gelatin. I’ll give you the short version. It’s made from animal parts. That will make you think the next time you go to enjoy Jello. The unflavored version has nothing to mask the raw smell when you cook it. Trust me, do this in a shop, garage, or outside. From what I could tell most suggest that you dump the gelatin in cold while mixing (usually with a drill attachment) and let it “hydrate”. Well it was late at night and I made a small batch so I just dumped it into the pot with the flame on the stove set as low as it would go. Most recipe’s I found don’t want you bringing the mixture above 130-140*F while cooking. When you dump it in hot, it instantly begins to thicken, which slows down the water absorbtion of the mixture. In other words, it gets in its own way. This didn’t ruin my batch, it just took a while to “hydrate” everything. You can see in the picture as I’m waiting for the clumps to dissolve.

Cooking Ballistics Gel

Cooking Ballistics Gel

Once it is dissolved, you will need something to pour it into. Notice the disposable loaf pan in the picture. I used this as my mold. You could make your own mold, just make sure you grease it so you can release the gelatin. I used a napkin and a Teflon mechanics spray smeared around, followed by non-stick cooking spray to coat my molds. Once you have your mold release in place, pour in the mixture then place in the fridge and to let it set up. Now this is not calibrated ballistics gel when done, and should not be used for any official forensics purpose. But it sure is a good way to get an idea of new ammunition performance, or hand load performance as it should end up a close approximation. The mixture can have some additives placed in it to prevent mold growth over long term storage, and you should be able to remelt the mass and recast it if you desire. I just wanted to test so I didn’t bother with these considerations. This mix was used the next day. After setting in the fridge, keep in a cooler while in transport. The blocks should not be given the opportunity to warm up until they are ready for use.

Ballistics Gel Blocks

Ballistics Gel Blocks

As you can see these blocks were not very large or deep. But they were still fun to shoot, and still gave a very basic idea of bullet performance. If you take your ammo seriously, whether you load it yourself, or buy it and want proof of it’s performance, I challenge you to go try this yourself.

Brain Gelatin Mold

Gelatin Mold - Heart

Champion Animal Prairie Dog large Paper Shooting Target, 8.5×11 - 12pk

Share/Save/Bookmark