Product: UCCX 9.x and above (the configuration API wasn’t available until 9.x)
Scenario: An Agents answers calls for CSQ A from 12PM – 6PM and then needs to answer calls for CSQ B from 6:30PM – 8PM.
Problem: In UCCX, the only way for an Agent to be a member of more than one CSQ is to use Skills. In the Post, I will use a very simple demonstration of a Use of the API to Automate the Changing of an Agents Skill in order for that Agent to answer calls from different CSQs (and not overlap).
Disclaimer: This Post assumes you have Node.js installed and the Request Library loaded as a dependency in your project. I’m not going to show you how to install Node and or Request. The code I will leave you is classified as a Minimum Viable Product; for example, it seems as though the NodeJS rendition of the setTime function could cause memory leaks. Use this code at your own risk..Ultimately I wanted to demonstrate the use of the API in a real-world scenario as mentioned here.
I could use many tools to perform this little magic trick..Python, Java, Ruby, etc; today I wanted to break out Node.JS mainly to show you CRUD operations in a different language..and Node is just cool too!
Recently, I’ve had the notion to create some automation tasks for Unity Connection (9.x) using the provided API (apparently it (the api) now goes back to 7.x) that uses REST..I’ve blogged about this before even..in Resetting a User’s VM PIN. Why am I spending time creating automation you might ask? The tasks that must be performed on a week by week basis (for the next 49 weeks) includes: Create a Class of Service, Directory Handler, Schedule (and Schedule Detail of course), GDMs, 2 Call Handlers, a User Template and a partridge in a pair tree..MULTIPLIED by 4..I’ve been doing all this for the past 6 weeks..all by hand..Today I’m going to briefly discuss automating the task of creating Schedules..(the actual Holiday Schedules are already configured..but and this doesn’t show you how to create a Holiday Schedule..but if you follow..then you might get the notion and/or no-how to do this 🙂
Before moving on with this, a few disclaimers must be added..this post is really about getting you started with creating Unity Schedules in a bulk fashion..I’m not sure there is any “built-in” methods to do this within Unity itself..unless you use COBRAS (and modify the CSV file?). My other intent is to share some code that might spawn ideas on how to do other interesting things using the API..
*Update: The version of the requests library I used in this post was 2.2.1. Recently 2.5.0 was released (http://docs.python-requests.org/en/latest/) which seems to have broken SSL Self-signed certificates (blindly trusting the verification of a lab box). You can “downgrade” requests using Easy_Install:
#From OS X Open Your Terminal and perform the following
sudo easy_install uninstall requests
sudo easy_install https://pypi.python.org/packages/source/r/requests/requests-2.3.0.tar.gz
#On Windows from a CMD Line
easy_install -m requests
easy_install 'URL from ABOVE'
Product: CUCM 9.x – 10.x (this script was tested on CUCM 10.5 using the 9.1.x AXL ToolKit)
Scenario: You are on the other side of a Communications Manager from 6.x – 8.x upgrade to 9.x-10.x. Users in CUCM have appropriate Devices Associated with his/her UserId, but the OwnerUserId is not populated on the Phone itself.
Problem: Reconciling User Licenses in 9.x/10.x (ELM/PLM) in order to not be penalized with “less” licenses if/when we deploy Jabber and/or other services for our Users. By default, if you do not “associate” an OwnerUserName with a Device, you only consume a UCL Enhanced License which only allows an “associated user” to have 1 Device, meaning, no Jabber, etc etc devices can be added later for the “user” without purchasing appropriate licenses (again potentially).
Disclaimer: I take no responsibility and/or necessarily provide support for your consumption of this script, so Use at your own peril..and if you do use it, test run it in a lab environment first. This script does 2 things and does them well: It loops through (all) end users (not application users), populates all their controlled device associations and then updates all those devices with an appropriate ownerUserName; it also has the ability for Exclusions of end users (possibly admins who control devices that really aren’t theirs..such as the phone view user if not an application user).
Requirements: Python 2.7, Requests and LXML Libraries, a little programming knowledge is good as well. Watch how to video?
Mac(book) owners shouldn’t feel left out; Python 2.7.6 and easy_install already came preinstalled with your machine..install requests or lxml using Terminal:
sudo easy_install requests
Windows 7 Folks follow the links below:
Download link for Python:
Download link for ez_setup.py/EasyInstall:
I recorded a video that more or less captures the entirety of the process in just a couple of minutes..let me know how it goes..And Watch in full screen for full quality:
Eventually I will find a Blog Series that I can Stick with. A good example of a series that has been spectacular is Will Bell’s SQL Query Series; if you want to learn some neat tricks with pulling records from the CUCM Database while getting a better understanding of how SQL Statements work and how the Fields within a Table of a Database relate with other Tables YOU WILL WANT TO CHECK IT OUT! Sorry for the caps there but you really need to check out his blog..I can only hope this blog can evolve into something like what he has created on his blog.
Today though is just an announcement..and I hope that it will be well received. As the title might denote, I will be casting a wider net when it comes to how I demonstrate Cisco DevOps; I want to “show off” a wider expanse of Cisco technologies..and I will be able to do it by utilizing the Cisco Developer Sandbox and I encourage you to join me! One, the more who have the ability to use this Sandbox the better the environment will become especially when we provide feedback on how some things may need to be set up and Two we’ll just geek out on code and junior mints perhaps..and we can collaborate in Shared Labs..
Since this is a generically titled post, I shouldn’t have any issues keeping the series going. In fact if you look at the Menu of my site, you should already see an option there that says Cisco API Series. And I’ve already interfaced with a few APIs as you will see there (all collaboration based apis): CUCM AXL, Cisco Unity Connection REST API, and Contact Center Express REST API; hopefully soon I will move onto technologies such as CMX (from the Sandbox when it becomes available), APIC-EM, IoT Controllers and Sensors, et al. If you ever visit developer.cisco.com you might notice that there are code samples available, however, they aren’t entirely consumable out of the box. What I want to provide here are practical usage guides along with the Source Code, so you can experiment yourself and come up with your own brilliant ideas of how to use the technology being dealt with. I also want to post stuff on GitHub where it can be forked and further collaboration on the Source Code can be performed. The next several posts are more than likely going to be UC Collaboration based, but I will get to the REST of the APIs very soon..
Let me know what you want to see? I’m open to requests, but remember I may not even know the technology you are asking me to post on..so it might take some time..plus, the technology may not be quite ready in the Sandbox. And, it’s probably better to keep things short…for the posts…and collaborate further in other spaces..I don’t quite know what those other spaces are yet..but I’ll come up with something..or perhaps I can encourage the setup of something that is brewing in the back of my mind…
This is not a post on UCCX Scripting. This post is about using the REST API as it is implemented in the UCCX Configuration API. This is also a post about adding functionality to the Administrative Interface of UCCX by providing a Bulk Provisioning tool. What I will leave you with today is a Command Line Tool that can and will improve the efficiency of creating configuration objects in the Cisco Unified Contact Center Express 9.x and later platform.
This is not my first foray into Representational State Transfer (REST). I previously wrote about using REST to reset a VoiceMail PIN (password): a utility that can be nicely integrated into a companies internal Website. REST is all the rage currently within “all” product lines (especially new ones or ones that didn’t have any APIs exposed previously such as the product we’ll be talking about today) within Cisco’s product portfolio. Why APIs? Why REST? Does this have implications when mentioned in the same breath as “Software Defined Networking (SDN)”? I believe so! But I’ll let that industry speak for itself..REST versus everything else I’ve seen is a simple choice. When working with REST, in order to get a list of data back from a source you merely call the HTTP GET method for what it is you want and what is returned is either an XML and/or JSON object (depends on who created the web service). Once you have the list of data you want, then you construct like objects (xml/json) to either create and/or modify (delete as well..but you don’t have to create an object) additional and/or existing configuration objects. In contrast, web services such as the Simple Access Object Protocol (SOAP) requires you to always pass an XML based object in the Request..this simply isn’t efficient. And if you notice in other posts I’ve created, CUCM still utilizes SOAP; they just call it Administrative XML (AXL) most of the time.
Can you guess what type of phone is depicted in the Image above? First one to guess correctly..wins…
In todays installment we are going to dive into Cisco IP Phone Services Development; we aren’t going to develop any Services, but we will do something that might be somewhat useful for everyone interested in this blog..I am going to demonstrate the remote deletion of an ITL file “just like they do” with the paid applications and just as an FYI, PhoneView’s secret sauce to sending commands like Backgrounds et al is XSI Object Passthrough..Ok now that that is out of the way..today we are just going to POST XML objects straight to a Cisco IP Phone..So, there are a few things that have to be in order before we can get this to work: Web Access has to enabled on the Phone, the CUCM end user account you will use will need to be associated to the phones you are going to “touch”, and the Authentication URL needs to be pointing to a CUCM Node.