Using The Dude to help answer the phone

I had a few moments to write up and share how we are using The Dude to help answer the phones. We’ve been using this for well over a year and it has helped quite a bit.

Outages will happen and customers will always call when there is an outage. Being a small provider, the less the phone rings, the better. We were looking for a simple way to let our customers know when there is an outage by just pressing 1 when they call in. This is the solution we came up with, using The Dude, VBscript, PHP, Swift (text to speech) and Asterisk.

I won’t be putting any of the code that we used here. Mostly because it’s sloppy and we aren’t programmers. I will just be giving a basic run down of what we did to make this work. Google is a better teacher than me.

First we created a DB containing information about our access points. A friendly name, an IP, status, attendant message.

Then for The Dude, we created a VB script that gets ran as a notification. This script talks to the DB and finds the device by IP and changes the status to up or down. The command looks like this:

wscript C:\dudescript\phone_attendant.vbs [Device.FirstAddress] [Service.Status]

On our Asterisk server there is a cron job that runs a php script every five minutes that looks at the table with the access points.

In the table there is one field that is always marked as down which contains the default message of there being no reported outages. When there are no outages the script will convert the no reported outages text to a wav file that is moved to the proper directory for Asterisk.

When the script runs and sees other things down it will look at the attendant message field and construct a string of text that can be converted to wav. In our application we set the attendant message field to the city and the following text is ouput to wav:

Currently there are outages being reported for customers in the following areas $CITY, technicians have been notified

On the asterisk side of things, we just tell it to play the wav file when a caller presses 1.


The Dude Rocks!