I am by no means receiving any kickbacks for blogging this – just a FYI.

I have been with this kick-ass ITSP for about three years now and have signed up probably 20 people. I encouraged paying the year up front as it is nice to have all you can eat phone service and not have to worry about monthly billing for an entire year. I use this trunk to send and receive crystal clear faxes, have as many simultaneous calls as my bandwidth allows – plus they give you a free SPA2102!

Without further adieu here is why I am so pumped about this. I have happily been paying ~ $280 – $300 annually (depending on exchange) for this service for a long damn time. Now for a “limited time” (I hate that too!) they have got it down for a hundred and fifty smackers!

That means you are getting all of the VoIP goodness I have been getting for half the price! I am considering creating another account just to get the deal!

Anyway, I hope you didn’t find this post as an advert.  I simply thought I should get the word out to all of my faithful readers.

PS . if you do decide to sign up – drop the account name “rappiddev” and they may give me a free month, usually they don’t care though because I pay annually…

Check it out here!

Have fun!

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • NewsVine
  • Reddit
  • StumbleUpon
  • YahooMyWeb
  • Google Bookmarks
  • Yahoo! Buzz
  • TwitThis
  • Live
  • LinkedIn
  • Pownce
  • MySpace

I have been a busy beaver today preparing two new modules for Asteristickies,

I recently completed (and uploaded) the latest release featuring notificxations for your XBMC.   It supports authentication as well as specifying a custom port (for computer builds with limited perimssions (ports < 1000))

The script pops a tiny message at the bottom of the screen and pauses any currently playing media.  There no modificatios to the dial plan and no third party software to install.

To get a copy, sign up at the PiaF forums and PM user “aster1sk” with your email address.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • NewsVine
  • Reddit
  • StumbleUpon
  • YahooMyWeb
  • Google Bookmarks
  • Yahoo! Buzz
  • TwitThis
  • Live
  • LinkedIn
  • Pownce
  • MySpace

This morning I added Growl notifications to Asteristickies using a wonderful PHP class found here.

You do not need to add any third party software to make this work, presuming you have Growl already installed.  Configuration is minimal and notifications can be sent to any routable hostname . address.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • NewsVine
  • Reddit
  • StumbleUpon
  • YahooMyWeb
  • Google Bookmarks
  • Yahoo! Buzz
  • TwitThis
  • Live
  • LinkedIn
  • Pownce
  • MySpace

This weeks project has been a huge learning curve for both Asterisk and communicating with a remote web server. Here are the project goals :

  1. End user (EU from now on) creates an account on web server.
  2. EU Inputs their phone number.
  3. EU immediately receives a call with a random 6 digit number (PIN).
  4. EU inputs the PIN into the web interface and is now validated.
  5. EU schedules when they want to be called.

When the user is called, they are sent to an IVR (interactive voice menu) – here is how that should work.

  1. EU answers the call.
  2. EU hears prompt to press 1, 2 or 3.
  3. EU presses 1 and hears a prompt with instructions (it is a breathing exercise)
  4. EU presses pound to initiate timer and pound once again to end their session.
  5. EU hears prompt directing them to visit web panel to access results.

OK so you see how this is supposed to work – let me explain how I did it.

Step 1. Phone Number Validation

The user enters their phone number in three separate boxes which are heavily processed for error checking and validation.  The number is stored in the database and they are sent to the next page of the wizard.  This page displays a button to initiate the call with a text input box below for the phone pin.  A random 6 digit number is generated, inserted into the database and also passed to the AMI. An Originate action is called sending the EU to a passwd-verify-custom context in the dial plan.

The EU hears a prompt to wait for their verification number – the six digit number passed from the web server is then read to the EU using SayDigits(${UserPin}).  As soon as they enter the PIN in the text box, their phone number is validated and they can begin receiving scheduled calls.

Step 2. Scheduling Calls

The EU is presented with several drop downs : Day (Sunday to Saturday), Hour (01 – 12), Minute (01 – 59), Time (AM – PM).  Once the time is selected and the submit button is pressed, an asynchronous post is sent back to the web server for validation and insertion into the database.

It was super easy to run the schedule without having to SCP .call files or open more holes on the Asterisk system.  I simply run a cron job every minute that pings a listening PHP script on the web server.  PHP queries the database to see if anyone has a call scheduled and has validated their number, PHP will loop through the results creating a new AMI event passing the users unique ID as a dial plan variable.

Part 3. Collecting Key Press Event Data

The IVR is very straight forward.  It is used to determine the EPOCH second for the start and stop time for this breathing exercise.  On key press, Asterisk runs System(/usr/bin/curl -d “userid=${UserId}&action=start&time=${EPOCH}&key=someuniquehash” <http://tld/script.php>)

This sends back to the web server the following data :

User ID – the user ID sent to the AMI from the web server : Now we know who we called

Action – Start, Stop : Now we know whether to insert or update the record

Time – The Epoch time stamp : Now we know when the key was pressed.

Key – A long string of random characters : This way no one can inject false data from their browser.

Once the phone session is complete, the user can login to their panel and view in depth statistics and compare month and year breathing fluctuation times in an easy to read bar graph.

The key things I have learned during creation of this application will allow me to do anything in the field of Web + Phone integration.

Passing a variable to the dial plan from an AMI event is by far the most powerful:

Variable : <VariableName> = <VariableValue>

This can now be accessed in the dial plan using ${VariableName}

I am creating a video demonstrating how to use the application (for end users) – I will post it up here when it is done.  If you want to try it yourself check out Control Pause.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • NewsVine
  • Reddit
  • StumbleUpon
  • YahooMyWeb
  • Google Bookmarks
  • Yahoo! Buzz
  • TwitThis
  • Live
  • LinkedIn
  • Pownce
  • MySpace