cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
818
Views
0
Helpful
2
Replies

CVP Configurable Action Element

vinodkewate
Level 1
Level 1

Hey Guys,

I need your help to understand the step by step process for creating configurable action element.

What i am trying to do is to have element which will take a parameter (Key) and then in the backend it will access SQL DB and fetch matching rows in recordset. Plan is to use JNDI and Connection pooling concept.

Thanks,

Vinod K

2 Replies 2

dehebert
Cisco Employee
Cisco Employee

Hello Vinod,

Have you had a chance to review the  Element Specification Guide for CVP VXML:

http://www.cisco.com/en/US/docs/voice_ip_comm/cust_contact/contact_center/customer_voice_portal/call_studio/7_0/programming/guide/ElementSpecifications.pdf

This provides some pretty good detail on configuring specific elements.

Also, you may want to look into the Pogramming Guide for CVP VXML as this also goes into some good detail on configuring the elements.

http://www.cisco.com/en/US/docs/voice_ip_comm/cust_contact/contact_center/customer_voice_portal/call_studio/7_0/programming/guide/ProgrammerGuide.pdf

I hope this helps.

Thank you,
Denis

A lot of the details on this sort of coding is posted on the CVP Developer's forum.

You should start small. Get the configurable action element template and build one  that does something trivial. Like take some settings and write them to the activity log. Learn where the configurable action element needs to be in Studio for it to see it, to appear in the Gallery, and learn where it needs to be on the VXML server in order to execute.

On the JNDI side, learn how to configure server.xml and context.xml for JNDI, learn where you must place sqlserver.jar so that Tomcat can see it, and use the standard Database Element in a simple app to fetch something from the DB.

Now you need to get to the coding. I always build a standalone Java app that I can call from the command line and build a method in this that does the heavy lifting, and once I have this working I copy the entire method into the configurable action class I am building. If changes are to be made, I go back to my test class and change the method, then copy it again.

Obviously you can't use connection pooling in your test class so you will have something like

        String connectionUrl = "jdbc:sqlserver://" +

                               databaseServer +

                               ":" +

                               databasePort +

                               ";" +

                               "databaseName=MyDatabase;user=" +

                               databaseUser +

                               ";password=" +

                               databasePassword;

          Connection con = null;

          Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");

          con = DriverManager.getConnection(connectionUrl);

whereas inside the custom action element using the JNDI you can say

          Context initialContext = new InitialContext();
          DataSource dataSource = null;

          Connection con = null;

          dataSource = (DataSource) initialContext.lookup("java:comp/env/jdbc/userDBConnection");
          con =  dataSource.getConnection();

assuming

          // Specified in the ResourceLink global tag in Tomcat\conf\context.xml
          //
          //         name="jdbc/userDBConnection" type="javax.sql.DataSource"/>

Regards,
Geoff