Category Archives: Programming

Tickling Cisco CME and Voice Gateways

A little while ago, a customer asked if it was possible for a company’s name to appear on the display of their telephones so that they knew who was calling before they answered the phone. For those that do not really know much about telephony, this might sound extremely easy to do – just save the number and then enter the contact’s name. If only it was that simple.

If you have a company with over 3,000 employees, the chances are that these employees will have direct dial numbers which will show up rather than the company’s phone number. Additionally, each phone will need to have every potential phone number for a company saved in its own directory. The permutations of this set up become astronomical when you think that a medium sized company will typically have 3,000 employees. If each of these employees of Company A have a DDI, and Company B also has roughly 3,000 employees, that means that 9,000,000 entries need to be entered on the phones!

One way in which this can be achieved is through the use of TCL scripts, also know as Tickle scripts. The Tickle script runs directly on the Cisco IOS of a router – in this case it will be the voice gateway. The script will run a look up on a .txt or .csv file which will list a company’s name and an associated phone number. Once a call is presented to the voice gateway, the Tickle script will take a hold of the ANI, run a look up on the .txt/.csv file and then send the company’s name directly to the phone.

Obviously, there are downsides to having this script running – especially in a very busy environment. The performance of the router will be considerably affected. This is one thing I mentioned to the customer. Another downside is that the scripts can be extremely flaky, even more so in a very busy environment when there could be hundreds of calls going through the voice gateway every hour.

In the end the customer decided against the script being implemented but my interest in TCL scripts has been piqued, especially as the modifications of what can be displayed on the phones could potentially be limitless – it is also interesting to find out a more efficient way of doing the above without compromising on the routing performance.

Watch this space for developments!



SendKeys Python module

Tedious copy and pasting to make sure the right amount of tabs was pressed to get to a certain link

Tedious copy and pasting to make sure the right amount of tabs was pressed to select a certain link on a webpage.

A few posts ago, I mentioned that I had been tasked with a script that would automate web browsing to a website. I felt, after doing a little bit of research, that the SendKeys module was best suited for the job. The only problem I encountered was when entering the same key command over and over again became extremely tedious as you can see on the right.

The script would load up a webpage, unfortunately using Internet Explorer, accept a security certificate, type in log in details, open a certain page and then activate an online platform that is used by the company I work for. With this script running on another PC to the one it was developed on, I needed to use another module, Py2Exe, to convert the .py file into an executable file.

Despite the length of the script and the repetitive nature of the commands, the script works absolutely perfectly. The pauses need to be planned in advance – especially when loading an application such as Internet Explorer. I obviously will not be posting the script I built due to the fact it does include an internal IP address of a company’s SNMP probe and log in details but I thoroughly recommend the SendKeys module for any automated tasks you encounter.

If you know of a better way in which automated web browsing can be achieved, I am extremely happy to hear any ideas you may have =)


Scripting, scripting, scripting

I have been tasked with some more scripts to build for work. I’ve wanted to get into programming in the past six to twelve months but I find working from reference books extremely abstract but having an actual goal to work towards, in my opinion, aids in the development of a skill.

Recently, I have been given the opportunity to hone my scripting and programming skills by undertaken various Cisco Contact Centre Express projects which involves a lot of call flow scripting, and because of this, I have been tasked with more and more generic scripting jobs.

The latest non-trivial script I have to build requires automated web browsing. As per usual, I will make all of my scripts available once they have been built. If you download any of them, please let me know what you think of it and also report any bugs to me for further development =)


Pinging with times

Today, I found the need to write a simple batch script that would be able to ping a remote host as well as output the times as to when a group of pings were sent. The need for this stemmed from a customer of the company I work for having problems with Cisco IP phones re-registering with the central Cisco Unified Communications Manager server at a certain time every day. Initially, the prognosis was that DHCP was the root cause of the re-registering whereby the devices were renewing their DHCP lease, which by default on Cisco routers is every 24 hours, disconnecting from the network briefly then reconnecting to the network with the same IP address and then re-registering with CUCM. However, this turned out to not be the case as the DHCP lease was extended to occur every seven days but the phones continued to re-register every day. The times in which the re-registering occurred began to change also, varying from 11:30am to 3:45am.

A colleague of mine, during the diagnostic stage, pointed out that the office in which all these phones were re-registering at has a satellite ADSL link to the main office where the CUCM server is at. Now, to prove that this satellite link is the root cause of the re-registering every day, as it is known to be flaky, a constant stream of pings would need to be sent to the remote site’s voice gateway. Simply pinging an interface wouldn’t suffice as time data is not captured and any drops in packets would not be able to be married up to any data captured from the Real Time Monitoring Tool which can be used to view logs on CUCM servers. This is where my very simple, not so clean, batch script comes in handy.

The build of  the script is simple – there’s two files; pingWithTimes.bat and output.bat. The pingWithTimes batch file simple echos the current system time and then pings the the desired interface IP address for, by default, ten times before looping back to the start. Output.bat runs the pingWithTimes.bat file and then saves any output to a text file name output.txt.

The IP address and name of the text document can be edited by using a text editor such as Notepad or Notepad++. Ideally, I would like the script to have prompts but for now, this will suffice.

You can download the .rar of these files here.


Upcoming projects

Since starting my dissertation project, which I will post details up when it is nearing completion as to prevent any plagiarizing and to keep updates as accurate as possible, I have become more aware and enthused by computer science in general. I have taken on a lot of programming for my dissertation, something that I must confess, am not very good at. To further my understanding, and potentially increase my “employability ” after I graduate, I have began to think of projects that I could complete in spare time, obviously in between work, gaming and being a father. These are some projects that I am planning, and I am currently working on at the moment:

– Point of sale solution

Aim: To become accustomed to using a Raspberry Pi and connecting external components such as a touch screen monitor. Decision needs to be made to use one Raspberry Pi as a server for testing purposes as well as using another Raspberry Pi as a client. SQL database back-end with either a Python or Microsoft Access front-end for logging in and navigating menus.

– Baby monitor

Aim: Using previous experience of using the Raspberry Pi and connecting an external component, further components will be attached to the Raspberry Pi such as a WLAN adapter, 1.3MP webcam, a high definition microphone and external speakers on one Raspberry Pi. Potential to connect LEDs to Raspberry Pi as to simulate sound levels when baby cries. Project will incorporate building a program from ground up that will automatically run when devices are booted. Two Raspberry Pis will be used. Pi number 1 will be situated in baby’s room and will stream video and audio. Pi number 2 will be connected to a T.V or computer monitor via HDMI which parents can switch to if sound is omitted from external speakers and/or LEDs light up. Secure ad-hoc WLAN will need to be established between the two Raspberry Pis automatically when booted up.

– Automatic DTMF navigation

Aim: To create an Android smart phone application that will connect to a company’s PBX. The user will be able to swipe through different departments that the company offers i.e: Sales, Customer Service, Deliveries without having to wait through the automated voice detailing which option to select. App will have the ability to be re-branded to fit a company’s brand such as green for Lloyds TSB, blue for Halifax, black for KnowHow etc. If options change, the app will need to be flexible enough to update to reflect any changes on PBX.

These are just some ideas I envision I will be creating in the next six months and I will post updates of each project as and when they happen =)


– M^