Tuesday, November 13, 2012

Reboot Windows XP from a MSTSC / RDP session

Working on a remote site via MSTSC / RDP to a Windows XP PC, found I needed to reboot the PC after installing the Cisco UCCX Editor. To do so in a MSTSC session, I found either below works:


Ctrl+Alt+End and then select Shutdown, and then Restart.

Start > Run > then type shutdown.exe -r, where -r is the switch to reboot.





Friday, September 07, 2012

CUCM download MoH file from server in production

While migrating a CUCM from a 7.1.3 on MCS to 8.6.2 on UCS, I found the original custom music on hold audio files could not be found by the customer.  How to get the MoH files from the old server to the new was the challenge.

The method to download MoH files from CUCM is well documented on various blogs, one example (and one of my favorites) being here:

http://www.netcraftsmen.net/component/content/article/70-unified-communications/665-retrieving-music-on-hold-moh-files-from-cucm.html   (edit 8/1/2016: previous link is now dead)

Given I had OpenSSH from http://www.openssh.org  installed on my Windows XP laptop and have had success using it in uploads for ages, I thought this would be a no brainer.  What I ran into was that after SSHing to the server and attempting to get the file(s) to my laptop, the CUCM MoH folder structure was created on my laptop, but the files themselves weren't transferred.  It seems from similar Googling that this is a fairly common issue.

What seems to have been the issue in my case was the fact that I was attempting to write to the root directory of my SFTP server in a Windows environment. When CUCM asks for the SFTP directory, people have various suggestions about using / or \ or . or ./ or \., etc., indicating the root SFTP directory.  Given my laptop still runs Windows XP, by creating a folder (in my case, called MOH) in the SFTP root folder, and then using MOH/ as the download directory, the CUCM folders were still created but the files were transferred as well.

Here's the log of the successful transfer, where the MoH file names began with the word Combined.

admin:

admin:
admin:file get activelog mohprep/Combined*
Please wait while the system is gathering files info ...done.
Sub-directories were not traversed.
Number of files affected: 5
Total size in Bytes: 6030843
Total size in Kbytes: 5889.495
Would you like to proceed [y/n]? y
SFTP server IP: 192.168.111.74
SFTP server port [22]:
User ID: sftp
Password: ********
Download directory: MOH/
.....

Transfer completed.
admin:

Monday, July 02, 2012

Packet capture via Cisco CUCM, UCCX, etc. interface

Had an issue where monitoring calls via Cisco Supervisor Desktop was failing when the UCCX server was used as the monitoring server (rather than using the CAD client in desktop monitoring mode).  Setting the switch's monitor destination to my laptop like the UCCX port configuration and using Wireshark as the capture tool showed plenty of interesting traffic, but I didn't seem to be able to retrieve the same from the UCCX server.  Capturing the traffic that UCCX itself "heard" would be helpful.

To capture packets on a CUCM, UCCX, etc. ethernet interface you can run the following from the server command line:

utils network capture size ALL count 10000 file capx

where:
- utils network capture starts the capture on the server's eth0 port
- size ALL indicates no maximum number of bytes of the packet has been set
- count 10000 indicates the number of packets to capture
- file capx defines capx as the file name where the capture will be written too

Once you enter the command, you stop the capture by pressing CTRL+c at command line.

The capture can then be retrieved via RTMT on the second page of the collect files option, and can be opened and analyzed in Wireshark.

NOTE: I never had much of a problem with this command but have been warned it can be business impacting!

Tuesday, May 29, 2012

Inventory serial numbers of Cisco phones on your network

So you're looking to document the serial numbers of phone devices on your network and decide to utilize the Cisco IP Phone Inventory Tool available at http://sourceforge.net/projects/cipinventory/ to scrape your phone screens.  It seems fast and stable, but the current version 0.11 really requires an accurate list of IP addresses associated with phones to work efficiently.

You can decide to scan entire subnets in hopes of discovering phones, but this must be done slowly, multiple times and can still prove to be unreliable. Again, you really need an accurate list of IPs to make this script work well.

You can copy device information screens from the CUCM admin interface to create a list of registered IPs, but this requires lots of text file, Excel, csv, etc. manipulation and I suspect there are bugs in some versions of the GUI.

You can grab MAC addresses and / or IPs from important routers or switches CDP / MAC / ARP tables, but this assumes you have access to the devices, active hosts in arp tables, and more text file, Excel, csv, etc. manipulation.

All these techniques have completeness and accuracy issues, as far as I'm concerned.

Let's just let CUCM tell you what it thinks.

On each server CLI in your cluster, run "show risdb query phone". A snippet of fictitious output is below:

admin:show risdb query phone

----------- Phone Information -----------

#TotalPhones, #TotalRegistered, #RegisteredSCCP, #RegisteredSIP, #UnRegistered, #Rejected, #PartiallyRegistered, StateId
11, 10, 10, 0, 1, 0, 0, 92259

DeviceName, Descr, Ipaddr, Ipv6addr, Ipv4Attr, Ipv6Attr, MACaddr, RegStatus, PhoneProtocol, DeviceModel, HTTPsupport, #regAttempts, prodId, username, seq#, RegStatusChg TimeStamp, IpAddrType, LoadId, ActiveLoadId, InactiveLoadId, ReqLoadId, DnldServer, DnldStatus, DnldFailReason, LastActTimeStamp
SEP001122334455, My Phone 2, 10.10.1.18, 3, 0, 3037A61720E1, reg, SCCP, 404, yes, 0, 303, NoUserId, 5367, 1328102686, 1, SCCP42.8-5-4S, SCCP42.8-5-4S, 0, 1328102686

Basically , you get a comma seperated table with a couple important columns for our purpose. You will get the IP address of the phone in the Ipaddr column and use it to populate the Cisco IP Phone Inventory Tool inputfile , and the registration status in the RegStatus column so you can eliminate scanning unregistered and unknown devices.

If you want to scan for a particular device type, you can decipher the DeviceModel column by running a bit more SQL shown below. This will provide you with a human readable phone type name associated with the DeviceModel number.

admin:
admin:run sql select enum,name from typemodel
===== =================================================
20 SCCP Phone
30 Analog Access
40 Digital Access
42 Digital Access+
43 Digital Access WS-X6608
47 Analog Access WS-X6624
50 Conference Bridge
51 Conference Bridge WS-X6608
61 H.323 Phone
62 H.323 Gateway
70 Music On Hold
71 Device Pilot
72 CTI Port
73 CTI Route Point
80 Voice Mail Port
90 Route List
100 Load Simulator
110 Media Termination Point
111 Media Termination Point Hardware
120 MGCP Station
121 MGCP Trunk
122 GateKeeper
125 Trunk
126 Tone Announcement Player
254 Unknown MGCP Gateway
255 Unknown
52 Cisco IOS Conference Bridge (HDV2)
53 Cisco Conference Bridge (WS-SVC-CMM)
83 Cisco IOS Software Media Termination Point (HDV2)
84 Cisco Media Server (WS-SVC-CMM-MS)
112 Cisco IOS Media Termination Point (HDV2)
113 Cisco Media Termination Point (WS-SVC-CMM)
131 SIP Trunk
132 SIP Gateway
133 WSM Trunk
134 Remote Destination Profile
85 Cisco Video Conference Bridge (IPVC-35xx)
30027 Analog Phone
30028 ISDN BRI Phone
2 Cisco 12 SP+
3 Cisco 12 SP
4 Cisco 12 S
1 Cisco 30 SP+
5 Cisco 30 VIP
9 Cisco 7935
6 Cisco 7910
7 Cisco 7960
8 Cisco 7940
10 Cisco VGC Phone
11 Cisco VGC Virtual Phone
48 VGC Gateway
12 Cisco ATA 186
124 7914 14-Button Line Expansion Module
336 Third-party SIP Device (Basic)
374 Third-party SIP Device (Advanced)
115 Cisco 7941
119 Cisco 7971
20000 Cisco 7905
302 Cisco 7985
307 Cisco 7911
308 Cisco 7961G-GE
309 Cisco 7941G-GE
335 Motorola CN622
348 Cisco 7931
358 Cisco Unified Personal Communicator
365 Cisco 7921
369 Cisco 7906
375 Cisco TelePresence
30002 Cisco 7920
30006 Cisco 7970
30007 Cisco 7912
30008 Cisco 7902
30016 Cisco IP Communicator
30018 Cisco 7961
30019 Cisco 7936
30032 SCCP gateway virtual phone
30035 IP-STE
404 Cisco 7962
412 Cisco 3951
431 Cisco 7937
434 Cisco 7942
435 Cisco 7945
436 Cisco 7965
437 Cisco 7975
446 Cisco 3911
521 Transnova S3
468 Cisco Unified Mobile Communicator
227 7915 12-Button Line Expansion Module
497 Cisco 6961
480 Cisco TelePresence 3200
496 Cisco 6941
493 Cisco 9971
479 Cisco TelePresence 3000
540 Cisco 8961
505 Cisco TelePresence 1300
229 7916 12-Button Line Expansion Module
495 Cisco 6921
520 Cisco TelePresence 1100
232 CKEM 36-Button Line Expansion Module
503 Cisco Unified Client Services Framework
484 Cisco 7925
537 Cisco 9951
481 Cisco TelePresence 500
228 7915 24-Button Line Expansion Module
230 7916 24-Button Line Expansion Module
478 Cisco TelePresence 1000
admin:

And just an FYI, the output above is a CUCM7 sample and may not include all types available to you via new device paks, COP files and software versions.

Friday, May 25, 2012

Convert WAV to 8 bit, 8 KHz u-Law format

So you have a wonderful new recording you would like to upload to Cisco UCCX (or IPCC, Unity Connection, Unity Express, or whatever) and know that it needs to be in a 8bit, 8KHz, u-Law format.

How do you convert it?

In Windows XP, the Sound Recorder application would allow you to simply change the format by opening it, choosing to save it and then selecting Change in the dialog box. The correct format there is Format: CCITT u-Law and Attributes: 8.000 khz, 8 Bit, Mono.


Now that Microsoft has apparently sucked the life out of Sound Recorder in Windows 7, my next preference is using Audacity.

Edited 7/15/2013: You can find my new post regarding using using the old XP version of Sound Recorder on Windows 7 here: http://webmaxtor.blogspot.com/2013/07/convert-wav-to-8-bit-8-khz-u-law-format.html

The problem now is it's not very clear how to choose the same options.

In Audacity with your file open, confirm the project rate is 8000 (shown in lower left corner of progress bar).

Then, choose Edit | Preferences | File Formats.

In the Uncompressed Export Format, choose Other...

Then, in Header, choose WAV (Microsoft) and in Encoding, choose U-Law.

Then, choose File | Export as WAV and simply name it appropriately.

TaDa.

Monday, April 23, 2012

Cisco 7945G custom wallpaper and CUCM 8.X

As of the time of this writing, there are a couple issues with the "Cisco Unified IP Phone 7975G, 7971G-GE, 7970G, 7965G, and 7945G Administration Guide for Cisco Unified Communications Manager 8.6 (SCCP and SIP).pdf" instructions on how to implement custom wallpapers on 7945G guides.
1. The correct image size for 7945G's is 320x212, not 320 by 216 as indicated in the guide.

Therefore the correct directory path that has to be used or created is "Desktops/320x212x16".

The PNG formated pictures must also be sized as 320x212 for the wallpaper, and 80x53 for the thumbnail.

The List.xml file should also reference the correct directory / size, like below:

<CiscoIPPhoneImageList>
<ImageItem Image="TFTP:Desktops/320x212x16/YourWallpaper-TN.png"
URL="TFTP:Desktops/320x212x16/YourWallpaper.png"/>
</CiscoIPPhoneImageList>
 
2. If you copy and edit the List.xml sample from the PDF for use in production and do not validate using an XML aware text editor (i.e. you use MS Notepad, rather than Notepad++, etc.), you will likely be including some extended characters in the XML file rather than "real" double qoutes around the directories. This will prevent your phones from accessing the wallpaper's as well. Check your XML file in something other than MS Notepad to verify your double quotes are really double qoutes and that the XML is valid.

Friday, March 02, 2012

Cisco UCS on UCS basic things you'll forget

Some basic stuff you need to do in VMWare but will forget to when you get distracted by just getting things upgraded, migrated, licensed, etc.

All documented here: http://www.cisco.com/en/US/docs/voice_ip_comm/cucm/virtual/servers.html


Install the VMWare tools on the applications:
Depending on what application you are running and what version, there are different techniques to do so. See here: http://docwiki.cisco.com/wiki/VMware_Tools

Disable LRO on the host:
You may experience issues with TCP performance speed. See here for modification techniques, and note it requires rebooting the host. See here: http://docwiki.cisco.com/wiki/Disable_LRO

Saturday, January 28, 2012

UC500: How to eliminate the access code for outbound calls in PBX mode, part 2

The basics of how to eliminate the access code for outbound calls in PBX modeis describe well at https://supportforums.cisco.com/docs/DOC-9787

Assuming you start with a basic configuration via Cisco Configuration Assistant, you will still need to modify how the 6XXX pattern, used for transferring calls directly to voicemail is handled, as well as fixing the MWI codes in CUE.

Per the supportforums, I've found using rule 2 below to remove the trailing star from the standard three digit extension works fine applied to dial-peer 2000 associated with the CUE pilot number.  The problem is now when using the 6XXX* pattern to send calls to voicemail, the redirecting number simply becomes 6XXX and CUE replies with a "Sorry. There is no mailbox..." prompt.

To remove the 6 and star if there, and then just the star if the leading 6 isn't there,  you can change the translation-rule like below (insert rule 1):

voice translation-rule 2222

 rule 1 /^6\(...\)[*]/ /\1/
 rule 2 /\(.*\)[*]/ /\1/

To fix the CUE's ability to light and extinguish MWI:

service-module integrated-Service-Engine 0/0 session

se-10-1-10-1(config)#ccn application ciscomwiapplication aa
se-10-1-10-1(config-application)# parameter "strMWI_OFF_DN" "A8001"
se-10-1-10-1(config-application)# parameter "strMWI_ON_DN" "A8000"

Friday, January 20, 2012

Unity Connection 8.6 find Alternate Extensions

Before you break out CUDLE from http://www.ciscounitytools.com/Applications/CxN/CUDLE/CUDLE.html and get your SQL on, be aware there is an easier way.

To find an Alternate Extension in the Unity Connection database, simply navigate to the Unity Connection administrative GUI as normal.
Pick Users.
Limit your search to a particular partition.
Check the radio button to Display Primary and Alternate Extensions in Selected Partition.
Search by the Alternate Extension you are looking for.

Below is a sample search for 2465 that returns a user with a primary extension of 2466.

Easy.

This is the user returned when searching for 2465.  Note, 2465 is the alternate extension, not the primary extension:


Updated 2/3/2014: This is the page that would be referenced when searching normally for 2466, the primary extension for the user:


Updated 2/3/2014: This is the alternate extension page that is normally not displayed via the default search, but which matches when using the particular partition and Display Primary and Alternate Extensions in Selected Partition :


Sunday, January 15, 2012

MS Excel: Find a value in one list in another list and do two different things if found

I use the following formula or variations on it pretty regularly, but always have to double check the logic to make sure I'm not creating a mess.  Here's my notes to myself on what it does.

=IF(ISERROR((VLOOKUP([what to look for],[where to look for it],1,FALSE))),[do something if TRUE],[do something else if FALSE])

A specific example of when I used it last is:
=IF(ISERROR((VLOOKUP($F3,$B$3:$B$1214,1,FALSE))),F3,"Shipped")
Basically, I have a long list of all the parts that need to be shipped out.  These are all in column F.  I also have a shorter list of parts that have already been shipped.  These are in column B.  Now I need to find what parts still need to be shipped.  I imagine I need to take all the parts in F and try to find them in the shipped parts B.  If they are in that list, then they're shipped and I'm just going to fill the cell with "Shipped".  If they aren't in the list, they haven't been shipped, so I'll fill in the cell with the part.

The whole thing works from the inside out, so the first thing the function does is:

(VLOOKUP($F3,$B$3:$B$1214,1,FALSE)
This takes the value found in F3, and looks for it in column B (or specifically B3 through B1214).
If it finds the F3 value in B, it returns F3,
If it doesn't find F3, it returns #N/A.

Then:

(ISERROR()
This checks to see if something is an error equal to #N/A, #VALUE, #DIV/0, etc.
If it's an error, then ISERROR returns TRUE.
If it's not an error, then ISERROR returns FALSE.

Then:

IF([the TEST],[something if the test is TRUE], [something if the test is FALSE])
If tests a condition (i.e. ) is TRUE or FALSE.
If the test is TRUE, then the thing after the test in the function happens.
If the test is FALSE, then the last thing in the function happens.

So...

First, when we do a (VLOOKUP($F3,$B$3:$B$1214,1,FALSE), maybe we get the value of F3, or maybe we get an error like #N/A.

Let's just assume F3 isn't found.

If so, (VLOOKUP($F3,$B$3:$B$1214,1,FALSE) would return a #N/A.

Next, consequently, the (ISERROR((VLOOKUP($F3,$B$3:$B$1214,1,FALSE))) portion of the function ends up logically looking like (ISERROR(#N/A).

Since ISERROR checks for a value of #N/A, the ISERROR portion of the function returns TRUE.

Ultimately, this first means the IF(ISERROR((VLOOKUP($F3,$B$3:$B$1214,1,FALSE))),F3,"Shipped") logically looks like IF(ISERROR(#N/A),F3,"Shipped") after the VLOOKUP fails to find F3. Then the IF(ISERROR(#N/A),F3,"Shipped") ends up looking like IF(TRUE,F3,"Shipped") after the ISERROR decides #N/A is an error it recognizes.

Finally, since the IF function does the first thing after its test when the result is TRUE, we simply end up with the value of F3.

Ta'da.

Conversely, if our VLOOKUP was actually succesful in finding F3 in B, the ISERROR function would be passed the value of F3, rather than an error. In this case, ISERROR would be false, and would pass FALSE to the IF function. Then, the if function would return the value "Shipped", rather than the value of F3.

Saturday, January 07, 2012

Cisco CUCM install logs via CLI

To get the install logs from Cisco CUCM without RTMT:
  1. Setup a SFTP server somewhere
  2. Console or SSH to CUCM
  3. Run "file get install /*"
  4. When prompted, enter SFTP server address, username, and password
  5. Use "." as the directory path (or get fancier if you want)
Read your logs.  Just when you think you saw it during a console session, there is something better in the log.

Wednesday, January 04, 2012

Cisco Switch Smartport configuration via CLI

After barking up the wrong troubleshooting tree for some time, I ran into a situation where a customer needed a UC540 switchport configured for trunking to a Linksys switch hiding in a ceiling.  Due to VPN network configurations out of my control, I was unable to use Cisco CCA to modify it.  Knowing using the CLI is somewhat of a no-no on UC540s, I wanted to apply the Smartport configurations as if they had been done so via CCA, verses just reconfiguring as if it was any other manageable switch.

You can display the macros used (I think) by CCA as follows:

! To show a short list of available macros, run:
!
UC540#show parser macro brief
!
! This returns:
!
default interface: cisco-desktop
default interface: cisco-phone
default interface: cisco-switch
default interface: cisco-router
default interface: cisco-wireless

! To show the macro details and variables that need to be set, run:
!
UC540#show parser macro
!
! This returns
!
Total number of macros = 5
--------------------------------------------------------------
Macro name : cisco-desktop
Macro type : default interface
# macro keywords $access_vlan
# Basic interface - Enable data VLAN only
# Recommended value for access vlan should not be 1
switchport access vlan $access_vlan
switchport mode access
# Configure port as an edge network port
spanning-tree portfast
--------------------------------------------------------------
Macro name : cisco-phone
Macro type : default interface
# Cisco IP phone + desktop template
# macro keywords $access_vlan $voice_vlan
# VoIP enabled interface - Enable data VLAN
# and voice VLAN
# Recommended value for access vlan should not be 1
switchport access vlan $access_vlan
switchport mode access
# Update the Voice VLAN value which should be
# different from data VLAN
# Recommended value for voice vlan should not be 1
switchport voice vlan $voice_vlan
# Configure port as an edge network port
spanning-tree portfast
--------------------------------------------------------------
Macro name : cisco-switch
Macro type : default interface
# macro keywords $native_vlan
# Access Uplink to Distribution
# Do not apply to EtherChannel/Port Group
switchport trunk encapsulation dot1q
# Define unique Native VLAN on trunk ports
# Recommended value for native vlan should not be 1
switchport trunk native vlan $native_vlan
# Update the allowed VLAN range such that it
# includes data, voice and native VLANs
switchport trunk allowed vlan ALL
# Hardcode trunk
switchport mode trunk
--------------------------------------------------------------
Macro name : cisco-router
Macro type : default interface
# macro keywords $native_vlan
# Access Uplink to Distribution
switchport trunk encapsulation dot1q
# Define unique Native VLAN on trunk ports
# Recommended value for native vlan should not be 1
switchport trunk native vlan $native_vlan
# Update the allowed VLAN range such that it
# includes data, voice and native VLANs
switchport trunk allowed vlan ALL
# Hardcode trunk
switchport mode trunk
# Ensure fast access to the network when enabling the interface.
# Ensure that switch devices cannot become active on the interface.
spanning-tree portfast
--------------------------------------------------------------
Macro name : cisco-wireless
Macro type : default interface
# macro keywords $native_vlan
# Access Uplink to Distribution
switchport trunk encapsulation dot1q
# Define unique Native VLAN on trunk ports
# Recommended native vlan should NOT be 1
switchport trunk native vlan $native_vlan
# Update the allowed VLAN range such that it
# includes data, voice and native VLANs
switchport trunk allowed vlan ALL
# Hardcode trunk to speed up convergence
switchport mode trunk
# Ensure that switch devices cannot become active on the interface.
spanning-tree portfast
--------------------------------------------------------------

! To apply a macro, make note of the macro name and keyword
!
! For example, the cisco-switch macro has a $native_vlan keyword
!
! Then, after removing commands already specific to the port, run (assuming configuring for a switch with native VLAN 1):
!
UC540(config)#int f0/1/2
UC540(config-if)#macro apply cisco-switch $native_vlan 1
UC540(config-if)#macro description cisco-switch

The macros don't do anything I wouldn't normally do, but at least keeps your CCA and CLI configurations consistent.

Pretty cool.