SpeechSequentialWorkflowActivity.TelephonySession Property
This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.
Gets the telephony session.
Namespace: Microsoft.SpeechServer.Dialog
Assembly: Microsoft.SpeechServer (in microsoft.speechserver.dll)
Syntax
'Declaration
<DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)> _
<BrowsableAttribute(False)> _
Public ReadOnly Property TelephonySession As ITelephonySession
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)]
[BrowsableAttribute(false)]
public ITelephonySession TelephonySession { get; }
Property Value
The ITelephonySession if the host is not null; otherwise null.
Example
The following example shows the definition of sayGreetingEnUS_TurnStarting, a handler for the TurnStarting event on a StatementActivity. In the highlighted line of code, the CurrentUICulture property on TelephonySession is set to the thread's current culture.
/// <summary>
/// sayGreetingEnUS_TurnStarting - TurnStarting entry point
/// for the statement spoken in US English.
/// </summary>
private void statementActivityEnUs_TurnStarting(object sender, TurnStartingEventArgs e)
{
// Setting the CurrentCulture for the thread is required to fetch the localized greeting
// from the resource manager.
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
this.TelephonySession.CurrentUICulture = Thread.CurrentThread.CurrentCulture;
statementActivityEnUS.MainPrompt.ClearContent();
// If a voice appropriate for the CurrentCulture is loaded queue the localized greeting.
if (installTTSVoice(Thread.CurrentThread.CurrentCulture, _defaultVoice.Gender))
{
sayGreetingEnUS.MainPrompt.StartVoice(this.Synthesizer.DefaultVoice);
sayGreetingEnUS.MainPrompt.AppendText(_rsrcManager.GetString("greeting"));
sayGreetingEnUs.MainPrompt.EndVoice();
}
else
{
this.loadDefaultCulture();
sayGreetingEnUS.MainPrompt.AppendText("Language pack for U S English is not installed.");
}
}
Thread Safety
All public static (Shared in Visual Basic) members of this type are thread-safe. Instance members are not guaranteed to be thread-safe.
Platforms
Development Platforms
Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003, Windows Vista Ultimate Edition, Windows Vista Business Edition, Windows Vista Enterprise Edition
Target Platforms
Windows Server 2003
See Also
Reference
SpeechSequentialWorkflowActivity Class
SpeechSequentialWorkflowActivity Members
Microsoft.SpeechServer.Dialog Namespace