.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Articles >> General >> Post New Resource Bookmark and Share   

 Subscribe to Articles

How to build a voice recognition IVR system

Posted By:Evan Miller       Posted Date: July 07, 2011    Points: 200    Category: General    URL: http://www.dotnetspark.com  

Voice recognition is a technique a lot of people are intereted in, I'm sure. From my article you will get to know how to build a simple voice recognition IVR.
 

In telecommunications, IVR allows customers to interact with a company's database via a telephone keypad or by speech recognition, after which they can service their own inquiries by following the IVR dialogue. Voice recognition IVRs work by this method: The caller is given a choice to answer a question, usually with "yes" or "no." After receiving an answer, the system escalates the caller to the next level. If the caller replies with a unique answer, the automated response is usually, "Sorry, I didn't understand you; please try again," with a repeat of the question and available answers.

 

The reason I'm writing this article is that my company has recently arrived to the point when such a system should be installed immediately. I think this is a great moment because the inability of handling every incoming call is definitely the sign of the growing success. But actions should be done right away. That's why I've chosen the simpliest way of building an IVR system: using a software development kit. I would like to share my experiences, because I'm very satisfied with this solution and I think the information could be useful to others, too. With the help of the sample program on the SDK's site, I can easily guide you through the process, and share you some other valuable information.

 

Let's start with the configuration of the program. Follow these steps to create your example IVR system:

1.  Start the sample program in Visual Studio ( Voice_IVR.sln )

2.  Set the LocalIPAddress
In FormMain.cs you need to fill in the following code section with your IP address:
SoftPhoneFactory.CreateSoftPhone("192.168.91.41", 5000, 8000, 5060);

3.  Set the SIP account
In FormMain.cs you need to fill in the following code section with the parameters of your SIP account:

1.    SIPAccount acc = new SIPAccount(  

2.    registrationRequired: true,  

3.    displayName: "oz889",  

4.    userName: "oz889",  

5.    registerName: "oz889",  

6.    registerPassword: "oz889",  

7.    domainServerHost: "192.168.91.212",  

8.    domainServerPort: 5060  

9.    );  

4.  Finally, start the application (F5).

 

Now let's have a look at the IVR system structure:


IVREngine

This class handles the operation of the IVR system. It handles incoming calls and navigates the customer among the actual menu items in the IVR menu.

IVRMenuElement

This interface needs to be realized by the IVR menu items.

BaseIVRMenuElemnt

It is an abstract base class that realizes the IVRMenuElement interface and includes the methods that can be necessary for IVRMenuElement. The base class includes the method that is required for activate and deactivate the InputInterpreter, and the cloning of submenus.

IInputInterpreter

This interface needs to be realized by the class that interprets input data.

VoiceInputInterpreter

This is the class that realizes IInputInterpreter. It is responsible for realizing keywords. Users can receive notification by subscribing for InputInformation event, and if the searched keyword is used.

 

For those who are curious for some programming background, here is the how-to-use of the IVREngine. It's really easy:

1.    private IVREngine ivrEngine;  

2.    /* Create a softphone... 

3.     * */  

4.    ISoftPhone softPhone = SoftPhoneFactory.CreateSoftPhone("LOCALIPADDRESS",  

5.               5000, 8000, 5060);  

6.      

7.    /* Set the SIP Account settings.. 

8.     * */  

9.    SIPAccount acc = new SIPAccount(  

10.                           registrationRequired: true,  

11.                           displayName: "oz889",  

12.                           userName: "oz889",  

13.                           registerName: "oz889",  

14.                           registerPassword: "oz889",  

15.                           domainServerHost: "192.168.91.212",  

16.                           domainServerPort: 5060  

17.                          );  

18.                         

19.                       /* Create IVRMenu 

20.                        * */  

21.                       IIVRMenuElement rootMenu = CreateIVRMenu();  

22.                         

23.                       /* Create IVREngine 

24.                        * */  

25.                       ivrEngine = new IVREngine(softPhone, rootMenu, acc);  

26.                         

27.                       /* Start IVREngine 

28.                        * */  

29.                        ivrEngine.Start();   


The setup of the IVR menu is similarly easy by using the previously learnt classes. The sample menu structure is the follows:

1.    /*Create IVR root menu 

2.     */  

3.    IIVRMenuElement rootMenu = new WavePlayerElement("D:\\demo.wav", new VoiceInputInterpreter(new[] { "Email", "Speech", "Softphone" }));  

4.       

5.    /*Create IVR submenus 

6.     */  

7.    IIVRMenuElement dataBaseTextToSpeechElement = new DataBaseTextToSpeechElement(new VoiceInputInterpreter(new []{"end"}));  

8.    IIVRMenuElement voiceMessageToEmailElement = new VoiceMessageToEmailElement("mailinside.ozeki.hu", voiceMessageData, null, new VoiceInputInterpreter(new[] { "end" }));  

9.    IIVRMenuElement softPhoneElement = new SoftPhoneElement(new VoiceInputInterpreter(new[] { "end" }));  

10.                          

11.                       /*Adding submenus to the root menu 

12.                        */  

13.                       rootMenu.AddSubMenuElement("Email", voiceMessageToEmailElement);  

14.                       rootMenu.AddSubMenuElement("Speech", dataBaseTextToSpeechElement);  

15.                       rootMenu.AddSubMenuElement("Softphone", softPhoneElement);  

16.                          

17.                       /*Create IVRMenu end element 

18.                        */  

19.                       IIVRMenuElement endMenuElement = new EndElement();  

20.                          

21.                       /*Adding end menu to the submenus 

22.                        */  

23.                       rootMenu.AddSubMenuElement("end", endMenuElement);  

24.                       dataBaseTextToSpeechElement.AddSubMenuElement("end", endMenuElement);  

25.                       voiceMessageToEmailElement.AddSubMenuElement("end", endMenuElement);  

26.                       softPhoneElement.AddSubMenuElement("end", endMenuElement);  

 

Of course this wasn't a full review of the SDK, but if it aroused your interest, you probably should visit the site I got the information from. I hope it will help you, too.

http://www.voip-sip-sdk.com/p_118-how-to-use-the-c-sip-source-implementation-of-ozeki-voip-sdk-for-voice-recognition-ivr-voip.html


 Subscribe to Articles

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend