Interface IScript
A script block is a unit of code that does one particular job. It is used by the script manager to navigate through your menu options.
Namespace: ivrToolkit.Core.Interfaces
Assembly: ivrToolkit.Core.dll
Syntax
public interface IScript
Remarks
An example of a simple IVR program using script blocks would be:
ScriptBlocks\Welcome.cs
ScriptBlocks\MainMenu.cs
ScriptBlocks\Option1.cs
ScriptBlocks\Option2.cs
Examples
// create the script manager
var scriptManager = new ScriptManager(line, startingScript);
// run the script blocks
while (scriptManager.hasNext())
{
scriptManager.execute();
}
line.hangup();
Properties
| Edit this page View SourceDescription
Gets the description of the script block.
Declaration
string Description { get; }
Property Value
Type | Description |
---|---|
string |
Line
Gets the voice line used by the script block
Declaration
IIvrLine Line { get; }
Property Value
Type | Description |
---|---|
IIvrLine |
Methods
| Edit this page View SourceExecute()
Executes the script block
Declaration
IScript Execute()
Returns
Type | Description |
---|---|
IScript | The next script block to run or null indicating the scripts are done |
ExecuteAsync(CancellationToken)
Asynchronously executes the script block
Declaration
Task<IScript> ExecuteAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IScript> | The next script block to run or null indicating the scripts are done |