CCXML, XMPP and PHP

Ever want to build an IVR application that could do screen pops? Want to build it using open standards / open source software? Guess what; you can. Here’s how…

  1. Download yourself a copy of Voxeo Prophecy
  2. Grab a copy of the very cool XMPPHP library from Google Code
  3. Get yourself an XMPP server and a client, or simply use your Google account.

I won’t go over all of the gory details here on how to build a screen pop capable IVR, but if you can build a simple CCXML app to accept an inbound call, you’re more than ready to do this on your own. You can also check out the Voxeo tutorials for pointers.

On an inbound call, I usually grab the caller’s ANI in order to make it part of the screen pop:

<transition state="'init'" event="connection.alerting">
 <assign name="ani" expr="event$.connection.remote"/>
 <send target="'screen_pop.php'" targettype="'basichttp'" namelist="ani"/>
</transition>

Sending this information to a simple PHP script built with the XMPPHP library allows you to generate a screen pop via an instant message to the XMPP account of your choice:

connect();
$conn->processUntil("session_start");
$conn->message("someguy@someserver.net", "You are receiving a call from: $ani");
$conn->disconnect();
?>

How cool is that!

Obviously there are lots of options for looking up information on the caller, once you have their ANI, that you can use to augment the information in your screen pop.

Just goes to show you, there isn’t much you can’t do with open source / open standards.

Viva screen pop!

2 thoughts on “CCXML, XMPP and PHP

  1. Mark,

    I did the same thing recently, but used Twitter instead. Using the Twitter API, it’s very easy to send a direct message. I’m going to do the Google Talk next, just to get it working. Using my inbound number at IfByPhone, I’m tying it to my contacts database so I can get a screen pop to see exactly who is calling, and what company they are with.

    Great post.

  2. I did the same thing recently, but used Twitter instead. Using the Twitter API, it’s very easy to send a direct message.

    That’s a great idea – I’ll have to try that next.

    I’ll also have to get cracking on some ifbyphone posts as well. Stay tuned for that…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s