Create Proactive Notification Applications with VoiceModel

The latest release of VoiceModel now provides support for developing Proactive Notification Applications using a telephone.  Proactive notifications are used to notify customers of important events or information that they are interested in.  The media channel currently supported by VoiceModel is voice over the telephone.  Some notification systems also support channels such as SMS and email. An example application would be a pharmacy notifying you that your prescription is ready for pickup.  With VoiceModel you can develop a notification system once and it will run on any VoiceXML compatible IVR or Tropo.

I personally find notification systems very useful.  I like being kept being informed on events like, my Amazon order was delivered, my flight was delayed, or my kid should be bringing home a report card today. This type of notification is beneficial, but I do not like SPAM.  Do not bombard my phone with sales and advertising.  Not only is this annoying, it is illegal. Be sure to understand the Federal rules and regulations around notifications via the telephone before developing a notification system, or you could be slapped with a very large fine. There, I warned you.

Now that we have the legal issues out of the way lets see how you implement a notification application. VoiceModel has a new object/model called Call.  Call accepts as parameters the phone number to dial, the phone number the call is from that will show up in the Caller ID (optional), and the URI for the controller that  contains the voice application to play when the call is answered.  Here is what a simple application might look like.

    public class CallMeController : VoiceController
        public override CallFlow BuildCallFlow()
            string phoneNumber = ConfigurationManager.AppSettings["phoneNumber"];
            string callerId = ConfigurationManager.AppSettings["callerId"];
            string dialogUri = this.ApplicationUri + "Outbound";
            CallFlow flow = new CallFlow();
            flow.AddState(ViewStateBuilder.Build("call", new Call("callMe", phoneNumber, callerId, dialogUri)), true);
            return flow;

In this example I am getting the phone number to call and caller ID from configuration settings in the web.config.  The dialogUri is the explicit path for the MVC/VoiceModel controller that contains the voice application I want to play to the caller when they answer.  There is a new example project in the source code called OutboundCall that demonstrates how to implement this simple notification system.

This simple example demonstrates the basics for outbound notification but is not very useful for a production application.  I am adding to the Road Map for VoiceModel a project that demonstrates how to manage a list of people to notify.  This can be challenging because it is a queue that has temporal information (time windows for notification so we do not call in the middle of the night) and information for retries on failed calls.  We are always looking for contributors if you want to tackle this interesting project.  Just contact me on CodePlex if you are interested.

Another feature I would like to add for proactive notification is using a different voice application dependent upon whether a machine or a human answers.  If a machine answers (i.e. voice mail) then it does not make sense to have the voice application ask for information (ex: "Would you like to continue getting updates on our progress on getting the power outage in your area fixed?") when the machine will not respond.  In this case you may want to play a different message that provides a phone number for them to dial for an inbound IVR application.  The challenge is that VoiceXML applications are pretty good at determining whether a machine or human has answered, whereas Tropo does not distinguish between the two.  This puts a kink in my vision of developing an application once and having it behave the same on a VoiceXML IVR as it does on Tropo.  And perhaps Twilio in future versions.

One of the reasons that VoiceXML does much better at determining whether a human or machine answered is that the calls are initiated using Call Control XML (CCXML).  CCXML provide much better call control and call progress analysis.  Which brings up an important point when deploying VoiceModel notification systems. When configuring an application that uses VoiceXML for the voice application you need to configure the starting app as CCXML with the URL for the Controller that has the Call object. For Tropo you configure it as any Tropo application , again using the URL for the Controller that has the Call object.

And how do we initiate the call since the application is not being triggered by an incoming phone call?  If you are using Tropo's development environment you first need to get permission from Voxeo Customer Support to make outbound calls from their system by creating a support ticket making the request. Once you have permission you go to where you defined your application in the Tropo Development Web Site and there will be a section called Outbound Tokens.  Click on the one that says Voice and this will bring up a dialog that you click on the Launch Token button.  This will start your outbound application.  Voxeo Prophecy for VoiceXML works in much the same way when using their development environment. This will work fine when you are testing. If you want to automate this process for production you will need to develop an application that makes HTTP requests that passes this token in. It is basically a REST API that is documented on their web sites.


Popular posts from this blog

Customizing Claims for Authorization in ASP.NET Core 2.0

Using Claims in ASP.NET Identity

Adding Email Confirmation to ASP.NET Identity in MVC 5