This section contains two sample scripts that illustrate the guidelines established in Connector Script Guidelines. You can use these sample scripts as models to create your own scripts. The scripts include:
Sample IC Connector Script
The following script is a sample of an IC connector script. This script tells the simulator to check whether a new call is coming in on channel 10. If the call is coming in on channel 10, the script instructs the simulator to set the id field of the vdu variable to the value 1122334455. If the call is coming in on any other channel, the script instructs the simulator to set the id field of the vdu variable to the value 6677889900.
<?xml version="1.0" encoding="UTF-8"?>
<compare type="EQUAL" field="channel" value="10"/>
<action type="SET_VDU_ID" field="" value="1122334455"/>
<compare type="EQUAL" field="channel" value="*"/>
<action type="SET_VDU_ID" field="" value="6677889900"/>
Sample CTI Connector Script
The following script is a sample of a CTI connector script. You can use CTI connector scripts only to check for error responses when commands are invoked. If no error response is defined in the script for a particular CTI connector, the simulator uses the default action. The default action is usually the successful completion of the item.
The following script simulates various possible error responses when the simulator encounters the designated CTI commands.
<?xml version="1.0" encoding="UTF-8"?>
<action type="ERROR" field="" value="Error invoking hold"
/>
<compare type="EQUAL" field="PhoneNumber"
value="4085777734" />
<action type="ERROR" field="" value="busy" />
<compare type="EQUAL" field="PhoneNumber"
value="4085777735" />
<action type="ERROR" field="" value="noanswer" />
<command name="Retrieve">
<action type="ERROR" field="" value="Error invoking
retrieve" />
<command name="Disconnect">
<action type="ERROR" field="" value="Error invoking
disconnect"/>
<command name="Conference">
<action type="ERROR" field="" value="Error invoking
conference"/>
<command name="Transfer">
<action type="ERROR" field="" value="Error invoking
transfer"/>
This script performs the following actions in applications that use CTI connectors:
- If the command is Hold (CTI), the simulator returns an error message that says, "error invoking hold".
- If the command is Dial (CTI), the simulator checks to see what number was dialed. If the number is 4085777734, the simulator returns an error of "busy". If the number is 4085777735, the simulator returns an error of "noanswer".
- If the command is Retrieve (CTI), the simulator returns an error message that says, "error invoking retrieve".
- If the command is Disconnect (CTI), the simulator returns an error message that says, "error invoking disconnect".
- If the command is Conference (CTI), the simulator returns an error message that says, "error invoking conference".
- If the command is Transfer (CTI), the simulator returns an error message that says, "error invoking transfer".