Welcome to MSDN Blogs Sign in | Join | Help

Am I Done?

Unified Communications for Developers

News

  • Disclaimer These postings are provided "AS IS" with no warranties and confer no rights. They do not represent the views of Microsoft.







    Am I Done? at Blogged
Creating a Click to Call Application w/Speech Server (2007)

The term "Click to Call" is thrown around a bit to mean slightly different things. In this post I'm going to show you how to create a web based interface, in which end users can type their name and phone number and have your Speech Server (2007) application call them.

This sounds more diffcult than it actually is. Speech Server (2007) uses MSMQ to place outbound calls, meaning that my website only has to write messages to MSMQ to trigger an Outbound Call in Speech Server. When I write items to MSMQ I just need to pass it parameters such as phone number to call, the person's name, etc..

Step 1
Create a Private Transactional Queue in MSMQ and give it a name.

Step 2
Create an ASP.NET Website with input fields for both Name and Phone Number, along with a Submit Button.


Step 3
Add the MSMQ to the Code Behind for the Submit button, using the name of the Queue you created in Step 1. Add a reference to System.Messaging

protected void btnCallNow_Click(object sender, EventArgs e)
{

string outboundInfo = string.Format("OutboundPhoneNumber={0}&Name={1}", this.tbNumber.Text, this.tbName.Text);

MessageQueue queue = new MessageQueue(@".\private$\OutboundCallMe");
Message message = new Message(outboundInfo);

 

MessageQueueTransaction transaction = new MessageQueueTransaction();

transaction.Begin();
queue.Send(message, transaction);
transaction.Commit();

}

Step 4
Create a Speech Server application which will read the values from the query string, and use them to place an outbound call.

You could have a Code Activity prior to the Make Call Activity which will set the value based on the Queue object, as well as set the statement prompt which will speak the person's name.

private void setOutbound_ExecuteCode(object sender, EventArgs e)
{

this.makeCall.CalledParty = QueryString["OutboundPhoneNumber"];
this.makeCall.CallingParty = "5554861";

this.sayWelcome.MainPrompt.SetText("Hello {0}", QueryString["Name"]);

}

Step 5
In the Speech Server Administrator Console, Set the Outbound Queue property to the name of Queue created in Step 1.


Very little Code to create a simple "Click to Call" web based application...

Posted: Wednesday, April 09, 2008 7:29 PM by midunn@microsoft.com

Comments

Speech Served Here said:

Cool application from Mr. Dunn! Sent to you by Brandon Tyler via Google Reader: Creating a Click to Call

# April 10, 2008 10:43 AM

Anthony Bearon said:

Triggering an outbound call via a POST to the .speax file is an alternative to using MSMQ, and was designed for just this scenario.

The Speech Server project template includes Outbound.aspx which does this for you, so all you need to do is navigate to Outbound.aspx from IE.

# May 8, 2008 5:46 AM
Anonymous comments are disabled
Page view tracker