the pros and cons of Power over Ethernet

Spurred on by a recent thread on the TAUG mailing list, I’ve been thinking about the cost vs. benefits of Power over Ethernet (PoE). PoE is a way to use the extra 4 wires in 10/100/1000-baseT Ethernet wiring for powering devices. The obvious application is to power IP telephones. Cisco has been doing this for a while using a proprietary solution which is similar to the PoE standard, IEEE 802.3af, which defines a protocol for detecting whether a device (or PD) is capable of receiving power prior to applying it, so that non-PDs don’t get fried by sending 48VDC down the wire. The protocol also determines how much current the PD will draw, and classifies the PD into a device class. All of this is well-described by this Wikipedia article.

There are two main advantages to using PoE, so far as I can see:

  1. No need to get a separate power brick for each device
  2. PDs can be centrally powered from a UPS in case of mains failure

The main con is the added cost, since you now need to purchase a PoE-enabled switch (which will then draw quite a bit of power, as it needs to power the devices).

What kind of cost are we talking about here?

  1. HP Procurve 2650 48-port switch (non-powered): USD $812.99
  2. HP Procurve 2650-PWR 48-port switch (PoE): USD $3,312.99

This works out to about USD $50/port, which I still think is a bit high. But maybe once the cost drops to around USD $25/port, it will be worth it.

Originally I was going to mention that purchasing PoE power injectors is another solution. A power injector has two Ethernet ports and a power brick attached to it; one of the Ethernet ports is an input from the regular non-powered network, and the other is a PoE output port to your PD. But I did some digging and find that the cost of a power injector is greater than USD $50, so I suppose this would only be feasible for a small deployment.

Step back for a moment and you realize that the cost of implementing the logic for PoE is far, far less than USD $50/port. The manufacturers are clearly just capitalizing on the fact that this is “new” technology and making a huge profit on it. As such I predict that there will definitely be wiggle room on the price in the future which will make PoE deployments more cost-effective.

connecting a Cisco 7960 IP Phone to Asterisk

(Don’t worry, the summaries from the 2nd day of BSDCan are coming. I’m 1/4 of the way through, but I got distracted by the following toy!)

I borrowed a Cisco 7960 IP phone from work to test the feasibility of making the existing telephony infrastructure operate with Asterisk instead of Call Manager. To do this, I had to first convert the phone’s firmware from the factory SCCP to SIP. (I could have tried to use Asterisk’s Skinny support, but I figured SIP is more widely supported and I also wanted to check out Cisco’s SIP firmware)

Conceptually this proceeds as follows:

  1. Set up DHCP server to boot the phone and instruct it what TFTP server to use
  2. Set up TFTP server and load it with the SIP firmware, as well as some helper files to ease the transition (files that the SCCP firmware would normally look for to load the second-stage bootloader)
  3. Add both default (SIPDefault.cnf) and phone-specific (SIP<mac-address>.cnf) configuration files to the TFTP server to tell the phone how to register itself to Asterisk
  4. Configure sip.conf in Asterisk to reflect the same settings

Continue reading

BSDCan 2006 Day 0xFFFE: VoIP and FreeBSD tutorial

I’m going to be posting a couple of journal entries where I will summarize the talks I attended at BSDCan 2006 last weekend. It might take me a little while to get through all the summaries, but eventually I’ll finish them all! I’m starting with Day -2 of BSDCan, i.e. 2 days before BSDCan really started I attended a tutorial on VoIP and FreeBSD.

VoIP and FreeBSD Tutorial

Presented by Massimiliano Stucchi

I attended this tutorial, presented by Massimiliano (Max), who works as a consultant for a major communications company in Italy. He mentioned that in his work he manages over 2000 channels — I took this to mean either simple FXO/FXS channels (single POTS lines) or PRIs. I took this to mean about 70 customers with PRIs since PRIs in Europe can carry up to 30 b-channels (whereas in North America, on the T-1 standard, one can carry 24 b-channels).

Primarily, VoIP in a free or open-source software environment means Asterisk, which is fine; that’s what I’m interested in. Max did briefly mention that there are other open-source PBXes out there such as VOCAL (which is probably not being actively maintained given that the "latest" release is for RedHat 7.3) and Bayonne, the GNU PBX which might show some promise. Still, when one thinks of open-source PBXes, one typically thinks of Asterisk.

Much of Max’s tutorial was a very basic introduction to Asterisk, which was fine although I felt like I didn’t learn too much more about the operation of the system. He did manage to clear up some terminology for me, though; in particular I think people use the word termination wrong. In the telephony world, termination is used to describe when calls leave your VoIP system and get into the PSTN. I think a lot of people, myself included, misuse the word termination to mean the completion of a call on a DID number, whereas this is actually termed origination. Confusing, yes. I guess it’s the same hurdle in understanding that you need to jump when thinking about what signalling to use for a FXO/FXS device: for an FXO device (which actually interfaces to an FXO, i.e. a CO) you need to use FXS signalling, because your FXO device is behaving as a "station" (like a regular analog phone is a station).

Another useful tip I got out of the tutorial was that faxing does not work well with Asterisk, and definitely not with pure IP. This is in part due to a number of factors: Asterisk does not have the capability to do the error control (ECM) necessary for faxing; although ECM is, strictly speaking, optional, most Class-1 fax devices expect to have it turned on. Moreover, the GSM codec does not handle faxing very well, therefore faxes will not work on IAX or SIP channels. Max felt that the T.38 protocol (faxing over UDP) is probably the way to go, but there is not yet wide support for this.

Max eventually got into some use cases of Asterisk, showing us parts of his dialplan, and discussing some of the syntax, but I felt that during this part of the talk he got a little distracted and started telling some stories & conversing semi-privately with some of the participants. To his credit, Max had some slides prepared, but he did not stick to them, particularly near the end of the tutorial. I think this would have been discouraging to any real newbie who came into the tutorial with absolutely no knowledge of Asterisk. At one point, a newbie asked him what it would take to implement a basic Asterisk setup just for testing — what hardware should be purchased? Max wasn’t able to answer this question directly, perhaps because he had never purchased small-scale hardware. I would have preferred to see an example of a starter setup, such as the use of cheap FXO clone cards to build an answering machine, for example.

Overall, though, I got some good tips from someone who has actually built a large-scale production Asterisk setup. I won’t try running a non-POTS fax line, that’s for sure.

[some] questions answered!

Some of my Asterisk-related questions (below) have been answered through my own digging:

  • There is a list of Asterisk commands on the VoIP Info Wiki.
  • The format of each exten => line is exten => name,priority,application().
  • I still don’t know what all the bundled sounds say, but the extra sound files package includes a readme that indicates what all those GSM files contain. This will be leading to the following hilarious dialplan, when I get around to it:
    carried-away-monkeys.gsm Nobody is available to take your call at the moment. They have been carried away by monkeys.
    lots-o-monkeys.gsm (sound effects of many angry monkeys)
    if-u-know-ext-dial.gsm If you know the extension of the party you wish to reach, dial it now.
    company-dir-411.gsm To access our company directory, dial 411 or dial zero to leave a message in our general mailbox.

Also, it turns out that the entire O’Reilly book on Asterisk is available for download here under a Creative Commons License. Not that I don’t want to pay for the book — I will, because I believe in such things — but for now, it’ll make a good reference.

the Internet was borked today

What a day — Rogers’ network was b0rked starting around noon, which meant that our office T1 connection flapped up and down all afternoon. It finally seemed to give out entirely around 4 p.m., at which point I think everyone at the office just headed home. Since I have my name on a ticket with Rogers, I’ll definitely be asking for a refund per our SLA.

Matt, a former colleague of mine, told me that Bell had been advertising null routes in the morning too — not good. In general, not a good day for Canadian ISPs.

In other news, I’m working on the Asterisk VoIP server again. As I build and configure this thing, I think it’s best if I keep a list of questions that I will try to answer as I progress. Here’s my current list of questions. If you are an Asterisk guru and happen to know the answers to these, feel free to comment on this post!

  1. Actions in the dialplan are usually applications. Where does one find a list of these applications (and what they do), short of doing a show applications at the Asterisk CLI?
  2. What is the syntactical format of each exten => line in the dialplan? (I know I’ll probably come across this somewhere in the docs, eventually)
  3. How do I register phones — either softphones or physical IP phones — in Asterisk, and how do I get those phones to authenticate to the Asterisk server to self-register themselves? Is there any way to autoregister phones with a restricted dialplan?
  4. How do I know what all the sounds bundled with Asterisk say, short of playing them one-by-one?
  5. How do I configure the voicemail system to do things like e-mail voice messages to the mailbox owner, encode the voice mail in different formats like Ogg Vorbis or MP3, and so on?

I plan to post the answers in this journal when I find the answers.

rebuilding Asterisk from scratch

As I mentioned in a previous post, I realized that the knowledge I was going to get out of Asterisk was limited by the amount of hand-holding that Asterisk@Home provides. Don’t get me wrong — A@H is a great way to get started with Asterisk, as it comes with a huge variety of features already built in. However, for someone who is a little more happy hacking about and getting to know every nook and cranny of his VoIP system, I realized that I’d have to start over.

I was also eager to rebuild the VoIP server using a BSD. I find Linux to be just too bloated for use as a VoIP server, and I was also interested in seeing how far NetBSD has come from the days when I used it last; my last NetBSD machine ran 1.6, and they’re onto 3.0 by now. I’m very familiar with the progress made by the FreeBSD Project, and am interested to see how NetBSD stacks up. Continue reading

are you also evolvolving?


(The above is a hilarious typo in the website for VON Canada.)

This month’s Toronto Asterisk Users’ Group meeting was held at the Voice on the Net Canada 2006 conference. Given the audience (business users and implementers of largely commercial telecommunications equipment) Asterisk was probably a new concept to them, which meant that some of the presentations at TAUG were aimed at an entry-level audience.

Still, there were some really cool Asterisk add-ons demonstrated. One such patch was the Asterisk Real-Time Voice Changer, which lets you alter the pitch of your voice in real-time. It’s great fun for pretending to be a secret informant. Claude Patry, one of the developers of the patch, noted that if you have access to the Asterisk CLI, you can even do this to someone else’s voice call in progress — a very evil use, to be sure, but a great way to get back at your co-workers that piss you off.

Iotum demonstrated their “relevance engine”, whch is basically a rules-based engine for determining priority and subsequent routing of incoming voice calls — so for example, if my girlfriend called me, I could get alerted over instant messenger, but lower-priority folks would get shunted to voicemail. Of course this is a trivial example, as the rules taken into account could also be things like “do I have a meeting scheduled with this caller later in the day”, or “I’m expecting a call from such-and-such a person today”.

I’ll probably be reinstalling my Asterisk@Home system with a regular Asterisk installation sometime soon, so I can get a better idea about how things are all put together.

trying out Asterisk@Home

I’ve recently been getting into voice-over-IP telephony, both due to my dayjob (where I’m now responsible for managing a very expensive but full-featured Cisco VoIP System) and my long-time desire to build a hobbyist PBX at home using Asterisk. I’d set up Asterisk under a FreeBSD 5.4 server some months ago, but got as far as installing a demo dialplan before I got distracted. This time around I decided to give Asterisk@Home a spin, because it bundles many common Asterisk add-ons and features into an easy-to-install ISO backed by CentOS 4.x. (For those who don’t know what CentOS is, it’s basically a straight recompile of RedHat’s popular Enterprise Linux product, and as such, available for free.) Continue reading