VoiceGlue Up And Running

I now have VoiceGlue up and running on Ubuntu 8.10. (Actually, the Ubuntu server is running as a virtual machine under Sun’s VirtualBox 2.1.)

For those that don’t know, VoiceGlue is an open source project that links Asterisk (the open source PBX) with OpenVXI (an open source VoiceXML platform currently under the stewardship of Vocalocity). VoiceGlue makes it possible for Asterisk users to deploy a completely open source VoiceXML platform for building IVRs and other useful applications.

The VoiceGlue install on Ubuntu 8.10 went smoothly — I did run into an issue with one of the services not starting, but that was easily identified and fixed thanks to a speedy response from the VoiceGlue folks. (This issue was really my own fault — use the pgrep command to make sure you have specific services running. And when in doubt, check the logs people!)

Based on my experience with the install and my initial testing I am extremely impressed with VoiceGlue. Its well documented and there is an active community of users offering tips and troubleshooting advice.

Hats off to the people behind VoiceGlue — Doug Campbell and Steve Smith. Well done!

Advertisements

Ubuntu Asterisk Oddness

I have a virtual machine running Ubuntu 8.10 Server and I’ve been meaning to give VoiceGlue a try to see if I could set up my own completely open source VoiceXML platform,

I found that I was able to run sudo apt-get install asterisk at the command line, and I started to get excited. This was going to be the easiest Asterisk install yet. I was very soon disabused of this foolish notion.

The Asterisk install seemed to go smoothly, as did the basic set up and config. Just to make sure I was doing things by the numbers I set up a couple of extensions and a quick test to have Festival read something back to me. So far, so good. Next it was on to the VoiceGlue install.

Following the instructions in the VoiceGlue Wiki, the install went smoothly. All three VoiceGlue-related services started just fine (the voiceglue service itself barked at me because I had not yet set up call routing in /etc/voiceglue.conf – once I did this, it started up just fine.)

That’s when things got weird. The VoiceGlue Wiki says:

Phoneglue also needs to be contacted via FastAGI for all calls that it will handle, and it needs to use a particular context, extension, and priority to send calls to itself.

OK, no worries there. I set up a new context in /etc/asterisk/extensions.conf and then reloaded the dialplan from the Asterisk console. So far so good. Then, the oddness set in.

I kept seeing an error in the Asterisk logs saying:

res_agi.c:229 launch_netscript: Connect to 'agi://localhost' failed: Connection refused

After banging my head against the wall trying to figure it out I decided to check and see if anything was listening on port 4573 (the default port for FastAGI). No dice.

I tried running the test AGI script comes with Asterisk (agi-test.agi). Again, no dice. In fact, it doesn’t look like there are any directories containing AGI scripts anywhere.

Ubuntu Asterisk seems to be looking in /usr/share/asterisk/agi-bin/ – it doesn’t exist. Neither does the usual directory for AGI scripts (/var/lib/asterisk/agi-bin/). Nor does another common directory – /var/spool/asterisk/outgoing.

Why is all of this missing from the Ubuntu version of Asterisk? Anyone have any thoughts? Did I miss something obvious during the install?

I’m still eager to try VoiceGlue, so it looks like I’ll be building Asterisk from scratch.

Behold the Power of the Command Line

After finding the unbelievingly cool and useful Command-line fu website, I have been consumed with finding and using powerful command line tools. Here are some of the tools I’ve been playing with recently:

xmlstarletxmlstarlet is a powerful tool set for using and manipulating XML from the command line. Anyone that interacts regularly with REST-based APIs should give this a look.

curl – I did a separate post on curl and explained how to use it to interact with the Twitter API. Things get cool fast when you start to combine these tools by piping output from one command to another. For example, using curl and xmlstarlet, you can get your Tweets from the command line (you can change the count parameter in the call to the Twitter API to get a different number of Tweets back):

curl -s -u user:password 'http://twitter.com/statuses/friends_timeline.xml?count=5' | xmlstarlet sel -t -m '//status' -v 'user/screen_name' -o ': ' -v 'text' -n

festival – why read text when you can have your computer speak to you? I’m now getting my daily horoscope via curl, xmlstarlet, festival and cron:

curl -s 'http://www.trynt.com/astrology-horoscope-api/v2/?m=2&d=23' | xmlstarlet sel -t -m '//horoscope' -v 'horoscope' | festival --tts

When you’ve got tools like this, the command line is where its at!

The Penguin Loves Obama

Will he love the penguin back?

That’s the hope of a number of prominent open source advocates who have written an open letter to President Obama encouraging greater use of open source software in the federal government:
penguin

Mr. President, we believe the open-source industry is changing the world of software development in many of the ways you have promised to change American politics. The values of open source mirror those you promoted in your campaign: hope, change, and openness. We, the undersigned, sincerely hope that you will make the use of open-source software a key component of every new technology initiative the United States government enters into during your presidency.

Here’s hoping that President Obama sees the connection between his campaign’s call for change and embracing better ideas for our future, and the principles of open source software development.

Command Line Twitter

Just when I thought it couldn’t get any easier to send out a Tweet, I lucked out and found Command-line Fu.

While browsing some very cool command line tricks, I happened upon a command to send out a Tweet using curl from the command line. I’ve seen this kind of example before – there may even be something similar in the Twitter API Wiki – but for some reason it resonated with me this morning. After playing around with it a bit, I’ve tweaked it to my liking:

curl -s -u user:password -d status="$1" http://twitter.com/statuses/update.xml > /dev/null

You can drop this into a file using your favorite editor. Save it and make sure the file is executable (chmod u+x fileName). You can execute this file at the command line like this:

$ ./fileName "This is the text of my Tweet."

I’ve opted to redirect the output returned by executing the curl command (Twitter will respond to the request with an XML document) to the bit bucket. I’ve also opted to turn off the normal progress indicator used by curl by invoking the -s flag. Feel free to tweak this to your heart’s desire.

I’ll definitely be sending out more Tweets from the command line, and I’ll definitely be going back over to Command-line Fu for some more command line tricks.

Facebook Drama in Maryland

Seems the Maryland Legislature will once again have access to Facebook:

Five days after sparking protests from lawmakers over his decision to block access to the popular networking site from legislative computers, the head of the assembly’s information technology office said yesterday that he will reopen access to Facebook in the next day or two.

It seems concerns over viruses and malware prompted the ban in the first place. The Director of the Maryland Legislature’s Information Services, Mike Gaudiello, now says that his office has “put in place tools to scan legislative computers for the viruses and harmful software that prompted the block…”.

That raised my eyebrows a bit – while Facebook can be (and has been) used to propagate viruses, the biggest threat to government computers is undoubtedly still regular old e-mail. If you’ve got safeguards in place to protect state computers from e-mail propagated viruses, I’m guessing that you’re probably covered as far as Facebook is concerned.

As social networking tools become more integral to the communications between elected officials and their constituents, a host of thorny issues are likely to arise. I’m curious to see how governments will address these issues:

  • Are the direct messages that people can send via Facebook and Twitter subject to public record requirements?
  • Are direct messages that people can send via Facebook and Twitter FOIA-able?
  • Do status updates in Facebook or Tweets meet the requirements for public meeting notices?

It will be interesting to watch as this continues to develop.

BTW, Hats off to @mmahaffie for the link to the article.

Why Does Twitter Rock So Hard?

Here’s why. From the Wired Blog:

Using Twitter’s application programming interface (API), a programmer with even a modest amount of experience can create a web app that gathers public data from Twitter, or uses it to send links, commands or bursts of information.

“[Twitter’s] open API is a huge reason it has grown into such a platform…

State and local governments strapped for cash (that’s all of them I think) take heed.

Open up your data — or, in the words of DC CTO Vivek Kundra, “Democratize” your data — and let the development community build apps for you.