« Back to General Discussion - All Versions

CVP open/close application using database lookup

Combination View Flat View Tree View
Threads [ Previous | Next ]
Showing 1 - 20 of 48 results.
of 3
I am trying to move my icm admin script for open/close to  studio application. Basically customer would like to change the open/close time through a web page into a sql database. I am planning to write a call studio application to check the open/close time before sending the call to the menu option. The database have mainly three fields DNIS, Open Time, Close time. I just want the studio application to check whether current time is between open & close time before presenting to menu option. Could someone help me whether I can do this by using a simple database element or do I need to know custom element to do this. If this is a simple sql query, can someone provide me an example or point me in the right direction.

You can definitely use the Studio Database element to do that. Look in the Element Specifications ref manual to see how to configure Tomcat to use JNDI. This requires configuring the Tomcat/conf/context.xml or server.xml file. Download the jdbc driver (.jar file) from the internet to match your database and verion. Then install it into Tomcat/common/lib directory. Then you'll have to restart VxmlServer. The query would be simple. SELECT DNIS, OPENTIME, CLOSETIME FROM TABLENAME WHERE DNIS={CallData.DNIS} Data is returned as Element data for the Database element with the names of the columns. So here the element data for the DB element would be named DNIS, OPENTIME, CLOSETIME Then you'll want to use a Decision element to check that the CallData DNIS equals the DB DNIS (to ensure that you got something back from the Demoticon. One warning about the Studio Database element is that if the database is down, the element throws a Java exception and the call will return to ICM down the error path of the RunExternalScript node. On 3/8/2013 5:41 PM, Cisco Developer Community Forums wrote: Mark Applebee has created a new message in the forum "General Discussion - All Versions": -------------------------------------------------------------- I am trying to move my icm admin script for open/close to  studio application. Basically customer would like to change the open/close time through a web page into a sql database. I am planning to write a call studio application to check the open/close time before sending the call to the menu option. The database have mainly three fields DNIS, Open Time, Close time. I just want the studio application to check whether current time is between open & close time before presenting to menu option. Could someone help me whether I can do this by using a simple database element or do I need to know custom element to do this. If this is a simple sql query, can someone provide me an example or point me in the right direction. -- To respond to this post, please click the following link: http://developer.cisco.com/web/cvp/forums/-/message_boards/view_message/12814654 or simply reply to this email. -- Janine Graves

Thanks Janine. To compare the current time against the open/close time I am looking for a built in function to get the current time value. Please let me know there is any function available to do this.

I have done date and time comparisons many times in Studio and I always write a custom class.

In Java you can instantiate a Calendar class object with numbers representing the date and time you are fetching from your caller and then you can use the before() and after() methods on the Calendar class, thus dealing with the intricacies of leap years and so forth. This technique is superior to anything you may cobble together with the Decision Editor. I did try that path. ;-)

Sometimes there is no other way but to go to Java. If you are a Studio programmer and you cannot program in Java, you will struggle on what, on the surface, seems to be a simple requirement for your application.

If you attend Janine’s Developer’s course, you will get the basics of Java. You don’t need the full monty, but you do need the fundamentals as it applies to manipulating data in Studio.

Regards,
Geoff

This is simple. You can do several ways, GregorianCalendar, SimpleDateFormat etc. The following will get you the hour of the day, min, day etc
GregorianCalendar cal = new GregorianCalendar();
int hour = cal.get(Calendar.HOUR_OF_DAY);
int min = cal.get(Calendar.MINUTE);
int day = cal.get(Calendar.DAY_OF_WEEK);


Hemal

From: Cisco Developer Community Forums [mailto:cdicuser@developer.cisco.com]
Sent: Saturday, March 09, 2013 11:20 AM
To: cdicuser@developer.cisco.com
Subject: New Message from Mark Applebee in Customer Voice Portal (CVP) - General Discussion - All Versions: RE: CVP open/close application using database lookup

Mark Applebee has created a new message in the forum "General Discussion - All Versions": -------------------------------------------------------------- Thanks Janine. To compare the current time against the open/close time I am looking for a built in function to get the current time value. Please let me know there is any function available to do this.
--
To respond to this post, please click the following link: http://developer.cisco.com/web/cvp/forums/-/message_boards/view_message/12827372 or simply reply to this email.

FYI, if it's relatively simple comparison the time (no time zone math
that you need to perform) then might get away without using Java.

You can get the current hour, minute, day, month, and year in the
Substitution window under the Date/Time column.

Be aware that they are returned as integers, so they are not padded to
begin with 0 if they're one digit.

But if you are comparing as Number in the Decision element, I think it'd
work for you.

The best way to do this would be within the SQL query itself. Something along the lines of:


SELECT CASE 
    WHEN GETDATE() BETWEEN startTime AND endTIme THEN 'open'
    ELSE 'closed'
END AS 'status'
FROM yourTable
WHERE dnis = '5558675309'
 
There is some more complicated things you can do to have it take the day of week into account as well. I use a system that allows me to have a schedule in a database ,and have the database simple return the status number of the call center. We use a 0-255 value to mark the conditions of the call center.  That way we can play different messages to the caller depending on the status of the call center. If you are interested I can share our table and view schema.
 

ICM is the best place for determining opening hours. Why would you do this in CVP Studio?

Regards,
Geoff

Use ICM man, no need to do it in studio. It is very easy to setup.

From: Cisco Developer Community Forums [mailto:cdicuser@developer.cisco.com]
Sent: Thursday, March 21, 2013 11:36 AM
To: cdicuser@developer.cisco.com
Subject: New Message from Asher Schweigart in Customer Voice Portal (CVP) - General Discussion - All Versions: RE: CVP open/close application using database lookup

Asher Schweigart has created a new message in the forum "General Discussion - All Versions": -------------------------------------------------------------- The best way to do this would be within the SQL query itself. Something along the lines of:


SELECT CASE
WHEN GETDATE() BETWEEN startTime AND endTIme THEN 'open'
ELSE 'closed'
END AS 'status'
FROM yourTable
WHERE dnis = '5558675309'

There is some more complicated things you can do to have it take the day of week into account as well. I use a system that allows me to have a schedule in a database ,and have the database simple return the status number of the call center. We use a 0-255 value to mark the conditions of the call center. That way we can play different messages to the caller depending on the status of the call center. If you are interested I can share our table and view schema.

--
To respond to this post, please click the following link: http://developer.cisco.com/web/cvp/forums/-/message_boards/view_message/13352227 or simply reply to this email.

Asher,
Can you email the schema and code to markapplebee@outlook.com?
Regards
Mark

Yea..I would like to use ICM admin script to do this. But customer wants to manage business hours through a web interface . I think this is the only way I can do this through a DB Dip.
Anyone knows a better option?
 

You can have a web front end that writes to a database and ICM admin scripts that query the database. It has to be optimized to get all the information in one hit since the query will run every 60s. But I have thought about this a few times and prototyped the ICM scripting.

Regards,
Geoff

How about CVP as a "web front end" that kicks off a Studio script that does nothing more than calls a "ReqICMLabel" with passed data to get/set Global Variables, etc.?
I've done something like this with a "TUI" (dial-in) interface, but seems like building a simple web browser-accessible front end to this would be awesome. I don't think you need to call a CVP_Subdialog_Start in order to call a ReqICMLabel, right?
;-)

Bill, that's awesome! I just tried it and it works. But you need to send
in _dnis (which ICM script to run) and a callid (make up a number).
http://vxmlserverip:7000/CVP/Server?application=Test&_dnis=2009&callid=7777777777777777777777

The only WARNING is that you need to follow this up with another URL to
free the vxml server license
http://vxmlserverip:7000/CVP/Server?audium_action=hangup

I guess if the Studio app had a 1-minute Session Timeout, you could omit
the 2nd step.

Bill, I just had these nodes in my Studio app:
StartCall --> ReqIcmLabel --> Custom Java (to create global data) -->
Hangup element.

And the 1 minute Session Timeout in the Studio app works great.
Then you can just use a web browser, use the first URL to call a studio
app that calls an ICM script (passes data and gets back data) and
creates global variables on vxml server.
Just have to remember to do this to all the vxml servers.
LOVE pushing the envelope.

BAM! ...and there it is!!
Thanks for batting it around in your lab, Janine!! ;-)
 - Bill

Bill, you also want these global variables to be created on a restart of
VxmlServer. So, you'd need to kick off the URL request every time
VxmlServer restarts. How do you do that?

And actually, your dnis, ani, and callid could essentially be the building blocks of the action you wish to call. I can already see a simple web form as a front-end providing all sorts of simple but almost always requested functions that are normally done with medium-to-complex dial-in applications. You could front-end with a web server like IIS tied into AD to control access through Windows Domain credentials, and mask the URLs for additional security...
Not that I'm looking to re-invent CCMP here, but the idea definitely has some legs!

These would be ICM Global Variables, which are persistent across Call Router restarts even (independent of CVP/VXML Server).
My thought here is really CVP becomes like a middleware of sorts. The URL request would come from a user trying to do something like perform an emergency close, or a meeting close, or even change hours of operation, etc. So you would need a little bit of web work on the front end to collect the data and construct the URL to send to CVP to actually change the variables in ICM.
Even so, I wasn't expecting the first part to be as easy as you've proven it to be! ;-)
Does that description make sense, or are we not talking about the same idea?

Showing 1 - 20 of 48 results.
of 3