Posts

Showing posts with the label VoiceModel

CodePlex is Dead. Long Live GitHub

I was very sad to hear about the demise of CodePlex .  I had a couple of open source projects on their site and I loved the tools provided to manage a project, especially the tight integration with Visual Studio.  But alas all good things must come to an end.  Always looking for a positive aspect to all situations, I decided that on the plus side this will force me to learn how to use Git for version control. I have heard for some time all of the buzz around using Git but was quite content with using Team Foundation Version Control (TFVC).  But even Microsoft is embracing Git and has offered it as an option in Visual Studio for some time now and seems to get all of the new functionality when it come to version control.  Each takes a very different approach to version control, with Git being a distributed solution whereas TFVC is a centralized solution.  Microsoft has a good discussion comparing the two and when to use each in this article, Choosing the ri...

Multiple Recordings and Copying Recordings in VoiceModel

I had a couple of enhancement requests in the VoiceModel Project around making user recordings.  The first request was to allow the directory that holds the recordings to be specified as a file structure or file share. And the second request was to allow multiple recordings in a single session.  I finally got some time to look at implementing these enhancements and was pleasantly surprised that the features were already in place because of the flexibility in the VoiceModel architecture and state machine. Well, for the most part. I will explain one little change I had to make to VoiceModel to get this to work. To test this out I updated the RecordingExample project in the VMWithExamples solution. You can get the source code here . Basically my solution was to add an On-Exit-Action to the recording state that copies the recorded file to another location.  This satisfies the request to be able to put recording in another location, including a file share.   Here is ...

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 onl...

When to Use the Builder Design Pattern

Have you ever looked back at old code you wrote and asked yourself, "Why did I do it that way?"  I do that quite a bit and found myself doing just that on the open source project VoiceModel  that I coordinate and contribute to.  I think it is healthy to question your method of coding as it can lead to refactoring that makes the code easier to understand and maintain, to name just a few benefits of refactoring. The section of code in question had to do with how states where created in a state machine.  VoiceModel has a built-in state machine that make it easy to build voice application call flows .  You add states to the state machine that represent actions like playing a prompt to the user or get input from the user from a telephone keypad or using speech recognition.  These states are specific to the voice part of the application, but you can also have states that perform background operations, such as a query a database.  The states that are u...

Architecture and Database Configuration for a Voice Enabled Survey Application

Image
In a previous post I introduced a new example added to the VoiceModel Project that shows how to create a voice enabled survey application that allows customers to take a survey over the phone.  This sample project uses Entity Framework (EF) 5 as the ORM for persisting the survey meta-data and results. This solution uses the code-first model  where you define your entities as classes first. You will find the entities for this solution in the project Survey.Entities . This solution also uses the Repository Design Pattern to abstract EF to a higher level and allow for easy swapping to another ORM or a mock-up for unit testing.  You will find the code for the Repository in Survey.Repository .  This solution also uses the Fluent API to map the entities to the database schema; setting the primary and foreign keys, as well as the SQL types to store the entity properties in. You will find this configuration in Survey.Repository.ModelConfiguration . ...

VoiceModel Now Available on NuGet

VoiceModel is now available on NuGet , which is the recommended method for starting a VoiceModel project in Visual Studio.  NuGet handles all of the dependencies and if you follow these instruction you will have a working "Hello World" voice application as a starting point. To install VoiceModel with NuGet just create an Empty MVC 4 project.  Remove the Global.asax file and remove App_Start\RouteConfig.cs file. Right click on References, select "Manage NuGet Packages...", and search for VoiceModel. Select the VoiceModel package and install. When installation is complete you will have a running "Hello World" example that will run on any VoiceXML compatible IVR and Tropo . The reason for deleting the RouteConfig.cs and Global.asax file is that NuGet does not have an easy method for modifying existing source files yet.  If you do not delete these files you will have to modify them yourself to get the application to work.  The modifications are minor.  Th...

Creating a Survey Application with VoiceXML and Entity Framework

Image
A new example has been added to the VoiceModel Project  that shows how to create a flexible survey application.  Surveys are powerful tools for soliciting information from customers that can improve business.  Using a voice application over a telephone to perform the survey as another channel of communicating with your customers can be extremely beneficial to understanding what they think of a companies products and services. This survey application is very flexible in that that the survey configuration is stored in a database so that new surveys can be created and old ones modified without creating a new voice application call flow each time.  This the first in a series of posts that describes how the Survey Application is designed and areas of future work to make it even more robust and flexible. The Survey Application uses Entity Framework (EF) version 5 for object-relational mapping (ORM) and uses the code-first model.  The code-first model allows you to d...

Dynamic Menus with VoiceModel

There is a new example in the VoiceModel project that shows how to create dynamic menus. Dynamic menus can be very useful in voice applications where you want to configure how the menus work in some persistence mechanism, allowing you to change the flow of the application without recompiling and redeploying, or if you want to tailor it to a specific user based based on their personal preferences. Here is the code in this new example: public override CallFlow BuildCallFlow() { CallFlow flow = new CallFlow(); flow.AddState(ViewStateBuilder.Build("greeting", "myMenu", new Say("greeting", "Welcome to the dynamic menu example.")), true); //This is a fake service that mimics getting meta-data for the menus from a web service or database DynamicMenuService service = new DynamicMenuService(); VoiceMenu myMenu = service.GetMenu("myMenu"); Prompt menuOptions = new Prompt(); //Build the prompts for the menu option...

New Release of VoiceModel Provides Tropo Support

A new version of VoiceModel has been released that allows your voice applications to run on the Tropo Cloud IVR . Now you can develop your voice applications once and run them on any VoiceXML compatible IVR or on the Tropo Platform.  VoiceModel is an open source project and you can find examples on how to develop with VoiceModel in the source code .

Listening to a Saved Recording Using Tropo and ASP.NET MVC

In my last post I discussed how to save a recording from Tropo using ASP.NET MVC and VoiceModel . I also discussed one of the issues I had to deal with was a difference in how VoiceXML and Tropo handle recordings.  A nice feature in VoiceXML is that you can listen to the recording on the IVR before you save it. With Tropo's Web API there is no mechanism to do this.  The goal of VoiceModel is to develop your voice application once and you can run it on either a VoiceXML or Tropo platform,  therefore I had to make both behave in the same manner.  The solution was to save the recording immediately on completion and to let the user listen to the recording on the application server that VoiceModel is deployed on. In order to grab the correct recording from the application server I needed a method to map a recording to the current session. Fortunately both VoiceXML and Tropo send a unique session ID with each request so I used the session ID as the file name for the audi...

How To Save a Recording in Tropo using ASP.NET MVC

I was having trouble getting recordings to save while adding the Tropo integration to VoiceModel  and I could not find any good examples on how to do this.  Even the examples for TropoCSharp did not show how to save the recordings.  I was able to figure out a solution so I thought I would share it here since there is a lot of requests on the forums to see an example for C# and .NET.  This example was developed using ASP.NET MVC 4. I thought I could reuse the same action on the VoiceModel controller to save recordings in VoiceXML applications, but it turned out that was not the case. When saving a recording in VoiceXML the voice browser wants the next VoiceXML document when it is completed, which is not the case for Tropo.  The only response that Tropo is looking for is whether it gets an HTTP 200 success code or not. The other issue is that the MVC controller action wants to match the name in the multipart form data  request with name given for the...

Progress on Tropo Integration in VoiceModel

We are making progress on the Tropo integration in VoiceModel .   This will allow applications developed in VoiceModel to run as VoiceXML applications or Tropo applications without any changes.  All you have to do is change your application URL in the platform configuration.  So if you deploy your application at http://myServer/myApp  and  have a VoiceModel controller called myController then the starting URL set in Tropo would be http://myServer/myApp/my/StartTropo .  That is all there is to getting your Tropo application running. We are going through the sample applications and using them as a test bed.  Just finished the WeatherVoice example which asks the caller to enter their zip code, retrieves the weather conditions for the area from a service, and voices the data back.  Give it a try by getting the latest version in source control . You can run WeatherVoice on either Voxeo's Prophecy IVR  (in the cloud or on premise), on any VoiceX...

VoiceModel Supports ASP.NET MVC 4

The latest release of VoiceModel  allows developers to easily create VoiceXML applications using ASP.NET MVC 4.  Previously VoiceModel only worked with ASP.NET MVC 3. In addition, all of the projects now open in Visual Studio 2012. Is there a new feature you would like to see in VoiceModel. You can add feature requests or vote on existing feature requests on the VoiceModel Project Site in the Issue Tracker .

Google Weather API is Dead

It looks like Google has killed its unofficial weather service API.  I caught wind of it when I saw a lot of inquiries about it on StackOverflow .  Now when you make a request to the API it returns "Unsupported API".  One of VoiceModels examples used the Google weather API to demonstrate how to get information from a service and voice it back.  When I found this out I searched for another free weather service and found MSN. The example WeatherVoice now uses the MSN service.  The example was written so that it is easy to insert new services or even use a mock-up service when testing.  If you need a replacement for using the Google weather API you may want to check out the example to see how you can use MSN for the same information.

VoiceModel Mayhem Add-On Wins Honorable Mention

An add-on for the open source project Mayhem that was developed using VoiceModel just won an honorable mention in the Make Mayhem Contest .  There were some pretty cool add-ons developed for Mayhem in this contest and you can view the winners on FaceBook . I recently posted about this add-on and the contest.  You can read about it here .  There was not enough time to submit everything intended for Mayhem in this contest. The way this solution was designed it would be easy to send commands to Mayhem via text messages (SMS) using a service like Tropo or SMSIified .  Work is currently being done to integrate VoiceModel with Tropo  which would allow VoiceModel applications to also communicate using SMS.  And it is intended to create an add-on that would control Z-Wave devices in a home for home automation. This would allow you to control lighting and other devices in your home by sending a text message.  Watch this blog for future development.

Tropo My VoiceModel

I recently became interested in Tropo to easily develop applications that support voice and SMS.  Tropo is another service provided by Voxeo .  Voxeo also has the Prophecy platform which allows you to develop voice applications using VoiceXML that can be deployed in the cloud or as an on-premise solution.  The VoiceModel framework lets you easily develop VoiceXML applications using ASP.NET MVC and C# and it has been extensively tested on Prophecy. So why the interest in Tropo? How does it differ from VoiceXML development? Tropo is interesting to me because of its pricing structure for putting applications into production in the cloud.  With many VoiceXML platforms, like Prophecy, there are some up front costs to deploy your app and the pricing structure depends on the amount of minutes you intend to use.  You often have to agree to some minimum minutes that you will use per month. With Tropo it is a simple pricing model. There are no up front costs for going ...

Who Killed ASP.NET MVC?

I recently gave a presentation at a .Net Developer Group meeting about the architecture of VoiceModel  and how it promoted reuse by using ASP.NET MVC as the underlying technology. After the presentation I was having a discussion with the attendees and one of them said, "I heard that MVC is a dying technology." I was kind of taken aback by this comment and wondered where he got this information from. Did I miss some news flash from Microsoft?  He could not remember the source and went on to say, "Yeah, I heard that it is being replaced by ASP.NET Web API".  I assured him that it did not seem possible that Microsoft would abandon a technology that is obviously popular with developers and has an upcoming release with MVC 4, and that Web API is just an extension of MVC that serves a very specific purpose. For those of you not familiar with Web API  it is part of the upcoming MVC 4 release  and allows developers to easily create RESTful web API's using the familia...

Making Mayhem with VoiceModel

Image
I recently used VoiceModel to create an add-on module for Mayhem , an open source project developed by Microsoft that allows non-programmers to use their computers to automate anything.  You can find out more about Mayhem here and about the contest that is running until the end of the month for contributing add-on modules.  I have submitted the add-on module called RemoteCommand which makes it easy to integrate Mayhem with an IVR application.  Watch this video to see how Mayhem, RemoteCommand, and VoiceModel can be used together to automate actions through commands given over the telephone. The voice application used in this demonstration can be found in the VoiceModel examples  found in the source code.  This example demonstrates how to dynamically build speech grammars with VoiceModel. I plan on using this for home automation by creating another Mayhem add-on module for Z-Wave devices.  This will allow for controlling Z-Wave devices i...

How to Build an Open Source Reusable Framework in ASP.NET MVC

I will be giving a presentation on how to create an open source reusable framework using ASP.NET MVC to the local .Net Developer Group in Sarasota, Florida on June 20, 2012.  In this presentation I will be covering the architecture behind VoiceModel , an open source project available on CodePlex that makes it easier to develop VoiceXML applications using ASP.NET MVC, Razor and C#.  If you are in the area be sure to drop by.  The exact time and directions are available here .  I think you will find the presentation very informative. And as always after the meeting there will be continued discussions and networking at the Cock & Bull . They have the greatest beer selection in Sarasota, if not all of Florida.  So come and join in on a fun and informative evening.

How To Create a Menu Using VoiceModel

VoiceModel does not contain a Menu object that will present users with options and branch in the call flow based on the users input.  So how do you add a menu to your voice application when using VoiceModel? Easy. Just add an Ask object and put conditions on the transitions for the state that renders the Ask object to the IVR browser.  Here is some sample code that you can find in the examples for VoiceModel . public class HomeController : VoiceController { public override CallFlow BuildCallFlow() { CallFlow flow = new CallFlow(); flow.AddState(ViewStateBuilder.Build("mainMenu", new Ask("mainMenu", "Press one for option one. Press two for option two.", new Grammar("digits?maxlength=1"))) .AddTransition("continue", "optionOne", new Condition("result == '1'")) .AddTransition("continue",...