Cisco CVP Call Studio provides building blocks, called Elements, to build powerful VXML Applications. You will configure each Element to complete your needs. Here we will look at some of the most important Elements in detail.
Some of the Elements can accept input or can provide output which can be used with other Elements. Each Element may have one or more Exit states that indicate dialog status when the Element execution has completed. These are pre-defined Exit states that do not appear in an element configuration and cannot be changed. However, when an Event handler is associated to the elements, the corresponding Exit state is added along with the pre-defined state.
Events
Event and exceptions occurring in a Cisco Unified Call Studio application can be handled by event handlers defined in the applications. When event handlers are configured for elements, the corresponding exit states are created. Following events types are supported:
- Custom Exception- User defined application specific exception.
- Java Exception – Java Exception occurring on a VXML server when executing applications.
- VXML Event – VXML events thrown by the Voice XML browser.
- Hotlink – Local Hotlinks defined for voice elements.
You can configure Event handlers with following attributes:
- Name – The Event Handler name can be changed according to the requirement and the Event Handler name will be added as an exit state.
- Event Type – You can select the event handler type depending on the element, the applicable event types are listed in the drop-down list.
- Event List – You can select from a pre-defined list of VXML and Java exceptions using the drop-down list. In addition, you can also enter a comma separated list of VXML events, Java exceptions, or user defined custom exceptions based on the Event Type selected.
Let’s look at some examples:
- VXML event you can enter error.badfetch to catch a VXML event named error.badfetch
- Java Exception event you can enter “java.io.FileNotFoundException” to catch a Java exception named java.io.FileNotFoundException
- Custom Exception event you can enter “com.cisco.CustomException” to catch a user defined exception named com.cisco.CustomException
Let’s look at some Elements in detail.
Application_Modifier Element
The Application_Modifier action element is used to modify context variables and remove session data values at runtime in a voice application. It will update the application for current session only. This Element has only one Exit state, that is Done. It indicates application’s context variables are modified and session data values are removed during execution.
You can set values which will be added to log before or after execution of this Element under General tab.
![Application_Modifier General tab](https://i0.wp.com/voiptechwikis.com/wp-content/uploads/2023/05/Call-studio-elements_1.jpg?resize=506%2C329)
You can set below values under Settings tab:
- Maintainer – Specifies email address of the application administrator.
- Language – Specifies language identifier, xml:lang attribute
- Encoding – Specifies encoding to use when creating VoiceXML document
- Default Audio path – Specifies a partial URI to a path containing audio content
- Session Data to Remove – Specifies names of the session data values to be removed
![Application_Modifier Settings tab](https://i0.wp.com/voiptechwikis.com/wp-content/uploads/2023/05/Call-studio-elements_2.jpg?resize=477%2C271)
You can set Element and Session data variables under Data tab:
![Application_Modifier Data tab](https://i0.wp.com/voiptechwikis.com/wp-content/uploads/2023/05/Call-studio-elements_3.jpg?resize=521%2C408)
You can select Java exception as event handler type under Events tab for exception handling.
![Application_Modifier Events tab](https://i0.wp.com/voiptechwikis.com/wp-content/uploads/2023/05/Call-studio-elements_4.jpg?resize=530%2C655)
Audio Element
The Audio voice element simply outputs a VoiceXML page with the contents of a single audio group. It is used for greetings, error messages and any other time audio is to be played in a situation not associated with an input state.
You can set audio file name or use Say It Smart feature of this element under Audio tab to play audio content.
![Audio tab](https://i0.wp.com/voiptechwikis.com/wp-content/uploads/2023/05/Call-studio-elements_5.jpg?resize=524%2C503)
Rest of the tabs are similar to Application_Modifier Element.
CVP Subdialog Start
If you want to invoke a different CVP application within an application, you can use CVP Subdialog Start element. This element receives data from a calling application and creates respective Session or Element data variables. This element should be placed at the entry point of application, right after the Start of the Call element.
![CVP Subdialog Start](https://i0.wp.com/voiptechwikis.com/wp-content/uploads/2023/12/Call_Studio_12.jpg?resize=551%2C331)
CVP Subdialog Return
If you have used CVP Subdialog Start element to invoke an application, you must use CVP Subdialog Return element to return data back to the calling application. You should place this element at the place of Hang Up element in the call flow. This element does not have any exit states.
![CVP Subdialog Return](https://i0.wp.com/voiptechwikis.com/wp-content/uploads/2023/12/Call_Studio_13.jpg?resize=464%2C366)
Database
Database element is one of the Integration elements that can be used to integrate with other external application. This element provides ability to execute SQL queries against external database, used within CVP VXML applications. You can run only one SQL query per element. There are 4 types of queries that can be run:
- Single – This is used to run SQL query that returns only one row. Returned row is stored in element data, column name will be the variable name and column value will be the value stored in variable in String format.
- Multiple – This can be used to run an SQL query that returns multiple rows. CVP defined Java data structure called, ResultSetList, stores all rows of the result and is placed in session data.
- Inserts – This is used to run an SQL insert query.
- Updates – This is used to run an SQL update query.
![](https://i0.wp.com/voiptechwikis.com/wp-content/uploads/2023/12/Call_Studio_14.jpg?resize=423%2C329)
There are certain steps which need to be completed before using Database element, as listed below:
- To enable database connection, you have to install appropriate JDBC drivers which are normally jar files and stored under below directory of CVP server: %CVP_Home%\VXMLServer\Tomcat\lib
- Create JNDI datasource connection in webserver.
- Edit Context file on CVP call studio to add JNDI/ datasource information. Context file location is as below: %CVP_Call_Studio%\eclipse\plugins\com.audiumcorp.studio.debug.runtime\CATALINA_HOME\conf Example of an SQL database is as below:
![SQL Database Context configuration](https://i0.wp.com/voiptechwikis.com/wp-content/uploads/2023/12/Call_Studio_15.jpg?resize=1024%2C116)
Set Value
Set Value element allows you to create and set value of local variables. It supports basic mathematical operations, string operations and Java script. The evaluation of a Java script is stored in the variable specified in Settings tab. The scope of a local variable is defined for that particular flow or subflow, they are not available in other subflows.
You can Add, Delete, Update or Move a local variable.
![Local Variable element](https://i0.wp.com/voiptechwikis.com/wp-content/uploads/2023/12/Call_Studio_16.jpg?resize=354%2C354)
Number and Number_With_Confirm
The Number element captures a number input from the caller in the form of either spoken or using keypad. It is stored in element data as a decimal value. Number_With_Confirm element works the same way, in addition to providing a confirmation menu, allowing the caller to either accept their entry or re-enter number. It is more useful when you are using speech and wants caller’s confirmation that what they spoke is captured correctly. Both of the elements can play out audio file, using Audio settings.
![](https://i0.wp.com/voiptechwikis.com/wp-content/uploads/2023/12/Call_Studio_17.jpg?resize=472%2C469)
Record and Record_With_Confirm
The Record element can be used to record caller’s voice input. A prompt is played to the caller then the element starts recording until a termination key is pressed or the recording time limit is reached or the caller hang up. A beep can be played to indicate to the caller that the system is ready to record.
Record_With_Confirm element works the same way as Record element, in addition to play the recording back to the caller and asking if it is acceptable.
![](https://i0.wp.com/voiptechwikis.com/wp-content/uploads/2023/12/Call_Studio_18.jpg?resize=556%2C510)
Rest_Client
The Rest_Client element is another one from integration menus which provides flexible interface to interact with REST endpoints. The communication between REST client and server is made secure using SSL. The Rest_Client element provides users to send GET, POST, PUT or DELETE requests to the REST endpoint.
![Rest_Client](https://i0.wp.com/voiptechwikis.com/wp-content/uploads/2023/12/Call_Studio_19.jpg?resize=563%2C494)
Time and Time_With_Confirm
The Time element captures a time input from the caller, which can be either spoken or DTMF (in HHMM format). The entered value will be stored in element data as a five character string in the format HHMMX, where X is one of the possible values – “a” for AM, “p” for PM, “h” for military time or “?” for an ambiguous time.
Time_With_Confirm element does the same functionality with addition to let caller hear what they entered and confirm if the captured value is correct.
![Time and Time_With_Confirm element](https://i0.wp.com/voiptechwikis.com/wp-content/uploads/2023/12/Call_Studio_20.jpg?resize=554%2C460)
Yes_No_Menu
The Yes_No_Menu presents a yes/no menu to the caller. It can accept DTMF (1 for yes and 2 for no) or spoken input. A separate exit state for the yes and no choices are presented in the application.
![Yes_no_menu element](https://i0.wp.com/voiptechwikis.com/wp-content/uploads/2023/12/Call_Studio_21.jpg?resize=565%2C477)
I am concluding this blog here, however there are more elements to cover, which I am planning to do in the continuation of this series. If you are looking for any specific ones to cover in more depth, please do drop a comment and I will cover them with possibly an example of VXML application.
See you soon!!!