Using Default Scripts
The default script is the last level of user-defined error handling before the system kicks in and applies a default system treatment to all active contacts.
You can also configure a separate, default script when you provision a Cisco script application. The system invokes this default script under the following conditions:
-
When the main script aborts, either because of an uncaught exception or because the Cisco Unified CCX server is unable to invoke the primary script because it has not been properly validated.
Note | The default script can access the exception reason for why the main script aborted. You do this by using the GetTriggerInfo step to extract the exception value into a script variable. |
-
When an incoming call must be aborted because the Cisco Unified CCX server has reached its limit for the number of simultaneous sessions for the application.
-
When the Cisco Unified CCX Engine is currently out of available tasks to run the script for an incoming call.
In each of these scenarios, the script marks all active contacts as aborting before the default script is executed. The final state of these contacts will be ABORTED even if they are transferred or redirected as a result of the execution of the default script.
Note | Remember that the purpose of the default script is to gracefully terminate the call when the main script fails, not to have a fall back to provide the original services intended by the primary script. This distinction is important because using system resources to execute this default script may impair system performance. If the primary script fails too often, then you should fix the primary script rather than providing another script to attempt the same task. |
The default script performs the following tasks:
-
Redirects the call to an operator or to another extension for further processing
-
Provides a customized error message to an HTTP request.
-
Plays back a graceful excuse to the caller for the system problems before hanging up.
You can transfer the state of the primary script to the default script before the primary script starts. To do this, define variables in the default script with exactly the same name and type as the variables in the main script. The variables in the default script are then automatically populated with the last values that were held by the corresponding variables in the primary script.
By doing so, you may, for example, be able to tell how many calls were active and terminate all of them gracefully, or you may be able to gain access to information about the caller and use it in your customized message.
Just as in the primary script, you can configure the default script at provisioning time by defining variables as parameters.
For Cisco Unified ICME scripts, the default script executes if the Cisco Unified ICME script issues a request for connecting to the default treatment. The default script, however, can execute only once, so if it has already executed because of a Cisco Unified ICME connect request to a default treatment, it will not be re-executed if the default script fails.
The default script does not execute if the primary script ends normally, even if contacts are still active. In this case, it is considered to be a design problem for the primary script. In such a case, all active contacts not marked as handled abort, and all active contacts marked as handled are simply terminated.
Note | Remember that the default script provides only a final feedback to the contact regarding the system problem and does not continue the service or restart the service. You should therefore make the default script short and to the point. |
The default treatments that the system applies if the contact is still active after the system executes the default script (if any) are:
-
CallContact—Plays back the prompt, “We are currently experiencing system problems, please call back later” as an announcement, followed by a fast busy signal.
-
HTTP Contact—Returns an INTERNAL SERVER ERROR (code 500).
-
eMail Contact—There is no system default treatment for an e-mail contact.