With apologies to the Univ. of Wisc. for this spoofFor those that have been chomping at the bit to play with podcasting, today's your lucky day. We're going to show you how to do anything you've ever wanted to do with podcasts using your plain old telephone. All you need is a shiny new TrixBox server or any Asterisk® server with freePBX installed. If you don't have a TrixBox system, take advantage of our new one that'll run on your Windows Desktop. The free download and 15-minute installation tutorial are both here. Once you get everything installed, you're half way there. As it happens, freePBX (included as part of every TrixBox) has a podcast recording system built right in. It uses a free service called GabCast. To start podcasting, just sign up for a free GabCast account.

GabCast Overview. Out of the box, there are two things you can do with your TrixBox system and GabCast. First, you can create podcasts. And, second you can host conference calls. Today Nerd Vittles adds the third leg to the stool. With the new GabCast Player for Asterisk, you'll be able to listen to any GabCast channel feed using a garden-variety, touchtone phone. So long as you know the channels you want to listen to, you can kiss your iPod and web browser goodbye and listen to these podcasts by telephone from anywhere. We'll show you how.

We're not going to spend much time talking about conference calls today. Suffice it say, with GabCast, the first 30 minutes are free. After that, it's 10¢ a minute. It takes about 30 seconds to set up a conference call and start using it. The steps to create your own podcast are pretty simple as well. You set up a GabCast account. You configure the GabCast module in freePBX. You dial into GabCast from a phone on your Asterisk system or by calling a toll-free number and entering your channel number and password. Then you start recording your podcast. Press the pound key and decide whether to publish your masteripiece. It's that simple. Once you post your new recording on the system, GabCast automatically generates an RSS Feed alerting subscribers that you've added an episode to your channel. The podcasts can be played back either using a web browser, iTunes, or today's addition: a plain old telephone. Before we get started, we've set up a demo system as usual so you can take the new GabCast Player for Asterisk for a spin. Just dial the number in the left margin and enter 1707 when prompted for the channel number. Enjoy the Nerd Vittles (sick) Joke of the Day. We promise not to add any more! Give us a break. It's just a demo site. If you're interested in some good Asterisk podcasts, try Phoneboy's channel 229 or one of the many Asterisk and TrixBox channels: 292, 1327, and 1493 to name a few. Now where were we?

GabCast Signup. Getting set up with GabCast couldn't be any easier. Go to their web site. Click the Sign Up tab. Agree to the Terms of Service and tell 'em you're older than 13. Fill in the blanks on the form including the password you want to use and a valid email address that you'll use to sign in. Wait for your return email, and you're all set. Log in to your account and click Create a new channel. Fill in the form and be sure to assign a numeric password to the channel. Click Submit and you're done. You'll use your channel number and the numeric password assigned for this channel to access your account by phone and record podcasts. Sign out of GabCast for the time being.

freePBX Setup. Setting up your TrixBox system for GabCast is equally simple. Log in to the freePBX administration section of your TrixBox server using a web browser: http://192.168.0.125/admin. Be sure to use your IP address, not ours. Type maint for your username and whatever password you created when you set up your system. Click on the Setup tab, and Gabcast should be in the list of options in the left column if you set up your system using the Nerd Vittles tutorial. If not, click Tools->ModuleAdmin, Connect to On Line Repository, check the Gabcast module, and then Download and Install it. Now reread this paragraph.

By clicking on the Gabcast link under the Setup tab, you can assign a phone number on your system that you dial to record new podcasts. Just enter the gabcast channel, the numeric password for the channel, and the extension number to be assigned to this channel. Save your settings and click the Red Bar to reload Asterisk. The alternative is to dial *422 (which spells G-A-B) to access GabCast. Then you'll be prompted for your channel number and password. Either way works ... unless you happen to be using a Sipura device for POTS phones. In this case you'll have to activate *422 in the Sipura dial plan to use it. Otherwise, you'll get a fast busy when you dial *422.

Sipura SPA-1001 Setup. If you took our recommendation and are using a Sipura device to enable use of plain old telephones in your home or office, then you'll need to modify the Dial Plan slightly. Point a web browser to the IP address of your device and then click Admin Login and then Advanced. Now click on the Line 1 tab and scroll to the bottom of the form. You'll see a field named Dial Plan. Carefully insert *422| after the first vertical bar in the field. So your dial plan entry should now look like this:

(*xx*xxxxxxxxxxx.|*422|*x*xxxxxxxxxxx.|[3469]11|0|00|[2-9]xxxxxx|xxxxxxxxxxxx.)

Click the Submit All Changes button and wait for your Sipura device to restart. Then pick up a phone connected to the device and dial *422, enter your channel number and password, and begin your recording career. Move over Elvis!

Accessing Your GabCasts. The gabcast site explains in detail the available options for listening to gabcasts. Just click on the Listen tab. Then click on a channel, and you can play the feed in your web browser. Or you can Subscribe to a channel and plug the RSS Feed into your favorite RSS Reader/Player including iTunes, Safari, and more than a dozen web portals. You also can insert a Player right into your web site.

Introducing GabCast Player for Asterisk. What was missing from all these features was a simple way to play gabcasts on your plain old telephone. Leave it to Nerd Vittles to close the gap, and today we do by introducing our new Gabcast Player for Asterisk. Once installed, you just pick up a phone and dial 422 for G-A-B. Choose the Channel you want to listen to and select the desired Episode to play. Then just sit back and listen on any phone or speakerphone connected to your Asterisk system. If you really want to get fancy, you can redirect a DID on your system to extension 422, and the whole world can dial into your GabCast Player from anywhere on the planet.

GabCast Player Installation. To get everything working, there are four steps. We'll add a little code to your dialplan in the extensions_trixbox.conf file in the /etc/asterisk folder. Then we'll download the player into /var/lib/asterisk/agi-bin and add a few custom sounds from Allison. And finally we'll add a new Misc Destination using freePBX Setup.

Adding the Dialplan Code. There are a couple of ways to add dialplan code. You can either log in to your server as root and use the nano editor to modify the dialplan (nano -w /etc/asterisk/extensions_trixbox.conf, or you can use the TrixBox web interface pointed to the IP address of your server: http://192.168.0.125/maint. Then choose Config Edit and pick extensions_trixbox.conf to edit. So pick your poison and add the following code into to the [from-internal-trixbox] context (a.k.a. section) of the file. Then save your changes.

exten => 422,1,Answer
exten => 422,2,Wait(1)
exten => 422,3,DigitTimeout(5)
exten => 422,4,ResponseTimeout(7)
exten => 422,5,Read(GABCAST,custom/gabcast-channel,5)
exten => 422,6,NoOp(${GABCAST})
exten => 422,7,AGI(gabcast.php|${GABCAST})
exten => 422,8,Playback(thank-you-for-calling)
exten => 422,9,Playback(custom/gabcast-visit)
exten => 422,10,Playback(goodbye)
exten => 422,11,Hangup

With nano, you save your updates by pressing Ctrl-X, Y, then Enter. With the web editor, you simply click the Update button. Remember that anytime you change your dialplan you'll need to reload your Asterisk settings for the changes to take effect. We're not going to do that just yet because we have to make a change in freePBX which will automatically reload Asterisk when we click the big Red Bar.

Installing the GabCast Player and Sound Files. Custom Asterisk apps such as our Gabcast Player live in /var/lib/asterisk/agi-bin on your Asterisk server. Custom sound bites go in the /var/lib/asterisk/sounds/custom directory. So log in as root and issue the following commands in order:

cd /var/lib/asterisk/agi-bin
wget http://nerdvittles.com/gabcast/player.zip
unzip player.zip
rm -f player.zip
chown asterisk:asterisk gabcast.php
chmod 775 gabcast.php
cd /var/lib/asterisk/sounds/custom
wget http://nerdvittles.com/gabcast/sounds.zip
unzip sounds.zip
rm -f sounds.zip
chown asterisk:asterisk gabcast*
chmod 664 gabcast*

Adding a Miscellaneous Destination to freePBX. One more step and we're finished. Start up freePBX using the IP address of your server: http://192.168.0.125/admin. Click Setup then Misc Destinations. For the Description, type gabcast. For Dial, type 422. Leave the --featurecode-- the way it is and click Submit Changes then the Red Bar. We're done. Just pick up a phone on your system and dial 422. When prompted for the channel, press 1707#. When prompted for the epidsode, just pick one or two and press the pound key... with apologies (in advance) to the ladies and others that are easily offended. You're a gabcast expert now. Enjoy!

Nerds' Corner. Today we introduce a new addition to our free software articles. In Nerds' Corner, we'll provide some insights into the programming hurdles, tips and tricks, and even some feeble insights into the actual code writing to give would-be Asterisk programmers a leg up with future projects. Let us hasten to add a disclaimer. We don't write PHP code that most good PHP programmers would be proud to claim. But our way makes this a one-day project instead of a week or a month. And our code is easy to read and easy to follow, almost self-documenting (which is every programmer's wet dream). It is anything but efficient. But with today's computers and the interactive nature of the applications we are writing, it really doesn't matter. If you'd prefer to study good PHP code writing, study the code for freePBX or a2billing, not ours. Having said that, let us hasten to add that our code works and is usually pretty close to bug-free. Why? Because we can actually read it and find problems before you do. Here's hoping we haven't jinxed ourselves. Be sure to also read the Comments posted below this article just in case.

The difficult issues implementing a player for gabcast all revolved around the MP3 files that actually store the podcasts. First, you need a way to figure out the filenames since they are stored in a hidden directory. Second, you need a way to convert the files into a format that Asterisk can play. And third, of course, you need a player that works with Asterisk and a telephone. Let's tackle them in reverse order. Asterisk includes an MP3Player command which would appear the likely candidate for playing MP3 files. Wrong! It doesn't work on TrixBox systems so we needed a way to convert the MP3 podcasts into a format that a TrixBox system actually could play. As luck would have it, the folks over at the Michigan Telephone Blog already had tackled this issue for podcasts so we started there. The final sticky wicket had to do with actually deciphering the file names of the MP3 files containing the podcasts. Well, the good folks at GabCast.com solved that one for us. It was so obvious it almost bit us. The RSS feed for each channel actually includes an enclosure tag with the MP3 filename in the metadata for each gabcast episode. It was smooth sailing after that. Take the channel number and retrieve the RSS feed for that channel. Then parse the metadata to strip out the MP3 filenames and subjects for each episode. Then prompt the caller for the desired episode, convert the MP3 file (using lame) to an MP3 format that will actually play using the Asterisk AGI playback command. It can play MP3 files if they are in the correct format and if you don't include .mp3 in the filename on the playback command line. Also embedded in the gabcast.php code, you'll find a good example of how to implement IVR technology in an Asterisk PHP script. In this case, we tell the user how many episodes are available and then prompt the user for the desired episode to play after using Flite to play the subjects of the five most recent episodes. If the user enters a number which is outside the appropriate range of existing episodes, then we play the most recent episode whether the user likes it or not. One final gotcha has to do with the numbering of the available episodes. If you look at a few channels on the gabcast site (such as ours), you'll notice that it isn't uncommon for a publisher to delete certain episodes leaving episode numbers which might look like this: 1, 4, 6, 8, 9. This information is available in the RSS feed, but it would complicate the IVR system. So we chose to merely count the episodes in the RSS feed and then number them from 1 to the total number of episodes reserving the highest number for the most recent episode. For most folks, this won't pose a problem because they probably won't be retrieving podcasts with both a web browser and a phone. Thus the mismatched numbering shouldn't matter. If it does, oh well!

One final note of caution. As distributed, the Nerd Vittles Gabcast Player is implemented as a single-user system. Each time someone calls 422, the system erases all existing podcast MP3 files from the previous session. Simultaneous calls would obviously be a problem with this architecture. But we did it so that the code would run efficiently even on a VMware TrixBox implementation. These MP3 files can be quite large depending upon the length of the podcast which can be up to 60 minutes long. The bottom line is that, if you plan to deploy this in a multi-user environment with multiple people simultaneously calling 422, then you'll need to modify the section of the code that deletes the previous MP3 files. You'll find it at line 165 with some commented-out code above it that will work better in a multi-user environment (but will consume more disk space saving prior MP3 podcast sessions).

Finally a special word of thanks to Allison Smith for doing her usual fine job recording voice prompts for this application. One day turnaround would be shocking and downright laughable in most businesses. Not so with Allison. It's her usual way of doing business which makes articles and applications like this one possible. Thanks, Allison!

BroadVoice Strikes Again. The BroadVoice geniuses are burning the midnight oil again. They've finally implemented Basic 911 "Service" for customers in the United States. Here is the important part of last night's customer announcement:

BroadVoice's main concern is customer safety and
satisfaction. For this reason, BroadVoice has made
Basic 911** service available to all U.S Customers.
...
** Basic 911 service is available for all U.S. customers.
Customers who have basic 911 service will receive one (1)
free 911 emergency call per year. Any subsequent calls
within a year will have a fee of $100.00 per call.

[BV goes on to say that "Enhanced" 911 Service calls are free
IF you register your address AND IF you agree to the following:]

YOU ACKNOWLEDGE AND UNDERSTAND THAT BROADVOICE
WILL NOT BE LIABLE FOR ANY SERVICE OUTAGE AND/OR
INABILITY TO DIAL 911 USING THE BROADVOICE SERVICE
OR TO ACCESS EMERGENCY SERVICE PERSONNEL DUE TO
THE CHARACTERISTICS AND LIMITATION OF THE BROADVOICE
SERVICE AS SET FORTH IN THIS DOCUMENT. YOU AGREE TO
DEFEND, INDEMNIFY, AND HOLD HARMLESS BROADVOICE,
ITS OFFICERS, DIRECTORS, EMPLOYEES, AFFILIATES, AND
AGENTS AND ANY OTHER SERVICE PROVIDER WHO FURNISHES
SERVICES TO YOU IN CONNECTION WITH THE SERVICE, FROM
ANY AND ALL CLAIMS, LOSSES, DAMAGES, FINES, PENALTIES,
COSTS, AND EXPENSES (INCLUDING, WITHOUT LIMITATION,
REASONABLE ATTORNEY FEES) BY, OR ON BEHALF OF, YOU OR
ANY THIRD PARTY USER OF THE SERVICE RELATING TO THE
FAILURE OR OUTAGE OF THE SERVICE, INCLUDING THOSE
RELATED TO THE BV 911 SERVICE.


We're guessing that the BroadVoice Bean Counters decided that, if they made the disclaimer obnoxious enough and the fee high enough for this great new service, it might cause all of their customers to have heart attacks which in turn would generate loads of 911 calls. Talk about kicking your customers while they're down. Now read the first sentence again... and then the part in the BIG LETTERS. They really do think the world is full of idiots, don't they? Yikes!


Nerd Vittles Demo Hot Line. You now can take a number of Nerd Vittles projects for a test drive... by phone! The current demos include NewsClips for Asterisk (latest news headlines in dozens of categories), MailCall for Asterisk with password 1111 (retrieve your email by phone), and Nerd Vittles Weather Forecasts by U.S. Airport Code. Just call our number (shown in the left margin) and take any or all of them for a spin. The sound quality may not be perfect due to performance limitations of our ancient Intel 386 demo machine. But the price is right.

Nerd Vittles Fan Club Map. Thanks for visiting! We hope you'll take a second and add yourself to our Frappr World Map compliments of Google. In making your entry, you can choose an icon: guy, gal, nerd, or geek. For those that don't know the difference in the last two, here's the best definition we've found: "a nerd is very similar to a geek, but with more RAM and a faster modem." We're always looking for the best BBQ joints on the planet. So, if you know of one, add it to the map while you're visiting as well.

Hosting Provider Special. Just an FYI that the Nerd Vittles hosting provider, BlueHost, has raised the bar again on hosting services. For $6.95 a month, you can host up to 6 domains with 30GB of disk storage and 750GB of monthly bandwidth. Free domain registration is included for as long as you have an account. That almost doubles last month's deal, and it really doesn't get any better than that. Their hosting services are flawless! We oughta know. We've tried the best of them. If you haven't tried a web hosting provider, there's never been a better time. Just use our link. You get a terrific hosting service, and we get a little lunch money.

Want More Projects? For a complete catalog of all our previous Asterisk projects, click here. For the most recent articles, click here and just scroll down the page.

Headline News for the Busy Executive and the Lazy Loafer. Get your Headline News the easy way: Planet Asterisk, Planet Gadget, Planet Mac, and Planet Daily. Quick read, no fluff.

Got a PDA or Web-Enabled Smartphone? Check out our new PDAweather.org site and get the latest weather updates and forecasts from the National Weather Service perfectly formatted for quick download and display on your favorite web-enabled PDA, cellphone, or Internet Tablet. And, of course, it's all FREE!

Be Sociable, Share!

This article has 2 comments

  1. I recently signed up for e911 service with TelaSIP. At $3/month it provides the Asterisk Community with a viable e911 solution. To my knowledge there is no "per use" charge and they provide assistance in configuring Asterisk to work with their e911 service to anyone who may need it.

  2. Ward, you bring up the 911 topic. I would greatly value your legal insights.
    In order to minimize accidental 911/emergency calls, could I suggest a mini-topic for NerdVittles.
    The solution would be a short, Allison voiced, prelude before making 911 emergency calls. This would add a few seconds to placing the 911 call, but would allow the user to hangup if the call was accidental.

    Something like the following.

    [e911]
    exten => 911,1,Answer
    exten => 911,n,Playback(msg-911-dialed) ; You dialed 911 to reach emergency services.
    exten => 911,n,Playback(msg-911-error) ; If this is in error, please hangup immediately.
    exten => 911,n,Wait(2) ; 2 seconds of silence
    exten => 911,n,Playback(msg-911-connect) ; You will now be connected to the 911 operator.
    exten => 911,n,Wait(2) ; 2 seconds of silence
    ;
    ; continue will normal 911 dialout
    exten => 911,n,Set(CALLERID(num)=${YOUR_CIDNUM})
    exten => 911,n,Set(CALLERID(name)=${YOUR_CIDNAME})
    exten => 911,n,DIAL(SIP/${YOUR_SIP_PEER}/911},120)
    exten => 911,n,Hangup

    Any legal issues? Would this be a good thing?

    Thanks,

    Lonnie