Handling Disconnects
Someone asked me this question today:
How do I detect a hangup in MSS 2004 R2?
So, I thought I would post my answer:
To
register a jscript function to be called on hangup:
In
each .aspx page that you want to monitor for a hang up place the following in
the <body> tag:
<body
xmlns:speech="http://schemas.microsoft.com/speech/WebControls"
onload="BodyOnLoad()">
Then
create the BodyOnLoad function in your BLOCKED SCRIPT
function
BodyOnLoad() {
RunSpeech.OnUserDisconnected
= HandleDisconnect;
}
Add
this function to your Jscript too. It
will be called whenever a hangup is detected:
function
HandleDisconnect(theQA) {
// Set a flag so that we know we've
disconnected
RunSpeech.CurrentCall().Set("CallState",
"Disconnected");
SemanticItem.SetText("-1", true);
SpeechCommon.Submit();
}
HandleDisconnect
Comments:
The
SemanticItem is used to post back and perform some sort of server side
code. You would have to register a
SemanticItem_Changed event with a server side function.
I
copied most of this information off this
thread on GotSpeech.Net forums.
Technorati Tags: Microsoft Speech Server