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.

Monday, December 05, 2011

UC520 and UC540 load 8.2.0 and CUE voicemail message delivery log samples with GMail TLS / SSL failures

The trace commands used on CUE are:

no trace all
clear trace
trace voicemail msgnotif all
trace configapi smtp debug
trace entitymanager NotifDevice all
trace smtp all
show trace buffer tail

Below is a successful voicemail notification to ray.maslanka@gmail.com, using smtp-server.roadrunner.com on port 25.

The WAN port is directly connected to a RoadRunner cable modem with a public IP address.

The UC520 firewall is set to "Low" via the CCA GUI and no command line modifications have been made.

4414 12/05 08:39:51.938 VMSS mnot 0 MessageNotification: Enter insertIntoMsgNotifQueue(): msg recipient: UOnenotif target: UOne
4414 12/05 08:39:51.976 capi smtp 0 SmtpServer: getSysdb(): Attribute: address
2322 12/05 08:39:51.977 capi smtp 0 SmtpSysdbNode: get(): address
4414 12/05 08:39:51.978 VMSS mnot 0 MessageNotification: query: INSERT INTO outcall_email_job VALUES ('UOne', 108, 1323092391940, 15, 0, 'UOne');
4414 12/05 08:39:51.996 VMSS mnot 0 MessageNotification: Notifying sender threads
3021 12/05 08:39:52.005 VMSS mnot 0 EmailSender: Processing job: 1
4414 12/05 08:39:52.006 VMSS mnot 0 MessageNotification: Exit insertIntoMsgNotifQueue(): notifyEmailThread=true, notifyPhoneThread=false
3021 12/05 08:39:52.113 VMSS mnot 0 EmailSender: Got a job: [owner_id=UOne, contact=ray.maslanka@gmail.com, extra_text=null, nextSendTime=1323092391940, device_type=32, device_id=108, retryCount=0, targetId=UOne, attach_vm=true, isUrgent=false, isPrivate=false, ndrreason=0, uid=15, messagetype=1, preferenceA, sender=203, callerName=User Three
3021 12/05 08:39:52.118 VMSS mnot 0 EmailSender: sendEmailNotification: checkSendPreConditions passed
3021 12/05 08:39:52.118 capi smtp 0 SmtpServer: getSysdb(): Attribute: address
2297 12/05 08:39:52.119 capi smtp 0 SmtpSysdbNode: get(): address
3021 12/05 08:39:52.119 capi smtp 0 SmtpServer: getSysdb(): Attribute: port
2307 12/05 08:39:52.120 capi smtp 0 SmtpSysdbNode: get(): port
3021 12/05 08:39:52.121 capi smtp 0 SmtpServer: getSysdb(): Attribute: userid
2322 12/05 08:39:52.122 capi smtp 0 SmtpSysdbNode: get(): userid
3021 12/05 08:39:52.122 capi smtp 0 SmtpServer: getSysdb(): Attribute: password
2318 12/05 08:39:52.123 capi smtp 0 SmtpSysdbNode: get(): password
3021 12/05 08:39:52.123 capi smtp 0 SmtpServer: getSysdb(): Attribute: authRequired
2297 12/05 08:39:52.124 capi smtp 0 SmtpSysdbNode: get(): authRequired
3021 12/05 08:39:52.130 VMSS mnot 0 EmailSender: Begin processing email job, UID=15
3021 12/05 08:39:52.158 VMSS mnot 0 EmailSender: Attachment body part added, UID=15
3021 12/05 08:39:53.476 VMSS mnot 0 EmailSender: Sent successfully, UID=15
3021 12/05 08:39:53.476 VMSS mnot 0 EmailSender: Send email rc=1
3021 12/05 08:39:53.476 VMSS mnot 0 EmailSender: Deleting email job: Device ID=108, UID=15
3021 12/05 08:39:53.495 VMSS mnot 0 EmailSender: calculateWaitTime(): current time: 1323092393492, job time: 0
3021 12/05 08:39:53.495 VMSS mnot 0 EmailSender: Wait time=0

Below is a failed voicemail notification to ray.maslanka@gmail.com, using smtp.gmail.com on port 587.

The CUE is configured to require SMTP authentication, and again using ray.maslanka@gmail.com.

Note the errors related specifically to TLS, a logical result of using port 587.

4414 12/05 09:11:59.431 VMSS mnot 0 MessageNotification: Enter insertIntoMsgNotifQueue(): msg recipient: UOnenotif target: UOne
4414 12/05 09:11:59.469 capi smtp 0 SmtpServer: getSysdb(): Attribute: address
2297 12/05 09:11:59.470 capi smtp 0 SmtpSysdbNode: get(): address
4414 12/05 09:11:59.470 VMSS mnot 0 MessageNotification: query: INSERT INTO outcall_email_job VALUES ('UOne', 108, 1323094319432, 17, 0, 'UOne');
4414 12/05 09:11:59.493 VMSS mnot 0 MessageNotification: Notifying sender threads
3021 12/05 09:11:59.502 VMSS mnot 0 EmailSender: Processing job: 1
4414 12/05 09:11:59.512 VMSS mnot 0 MessageNotification: Exit insertIntoMsgNotifQueue(): notifyEmailThread=true, notifyPhoneThread=false
3021 12/05 09:11:59.602 VMSS mnot 0 EmailSender: Got a job: [owner_id=UOne, contact=ray.maslanka@gmail.com, extra_text=null, nextSendTime=1323094319432, device_type=32, device_id=108, retryCount=0, targetId=UOne, attach_vm=true, isUrgent=false, isPrivate=false, ndrreason=0, uid=17, messagetype=1, preferenceA, sender=203, callerName=User Three
3021 12/05 09:11:59.606 VMSS mnot 0 EmailSender: sendEmailNotification: checkSendPreConditions passed
3021 12/05 09:11:59.606 capi smtp 0 SmtpServer: getSysdb(): Attribute: address
2297 12/05 09:11:59.607 capi smtp 0 SmtpSysdbNode: get(): address
3021 12/05 09:11:59.607 capi smtp 0 SmtpServer: getSysdb(): Attribute: port
2307 12/05 09:11:59.608 capi smtp 0 SmtpSysdbNode: get(): port
3021 12/05 09:11:59.609 capi smtp 0 SmtpServer: getSysdb(): Attribute: userid
2322 12/05 09:11:59.610 capi smtp 0 SmtpSysdbNode: get(): userid
3021 12/05 09:11:59.610 capi smtp 0 SmtpServer: getSysdb(): Attribute: password
2318 12/05 09:11:59.611 capi smtp 0 SmtpSysdbNode: get(): password
3021 12/05 09:11:59.612 capi smtp 0 SmtpServer: getSysdb(): Attribute: authRequired
2297 12/05 09:11:59.613 capi smtp 0 SmtpSysdbNode: get(): authRequired
3021 12/05 09:11:59.622 VMSS mnot 0 EmailSender: Begin processing email job, UID=17
3021 12/05 09:11:59.654 VMSS mnot 0 EmailSender: Attachment body part added, UID=17
3021 12/05 09:12:00.339 VMSS mnot 0 EmailSender: Error sending email, UID= 17 :javax.mail.SendFailedException: Sending failed;
nested exception is:
class javax.mail.MessagingException: 530 5.7.0 Must issue a STARTTLS command first. v18sm77175183ibh.4
3021 12/05 09:12:00.339 VMSS mnot 0 EmailSender: Send email rc=2
3021 12/05 09:12:00.339 VMSS mnot 0 EmailSender: Deleting email job: Device ID=108, UID=17
3021 12/05 09:12:00.362 VMSS mnot 0 EmailSender: calculateWaitTime(): current time: 1323094320360, job time: 0
3021 12/05 09:12:00.362 VMSS mnot 0 EmailSender: Wait time=0

Below is a failed voicemail notification to ray.maslanka@gmail.com, using smtp.gmail.com on port 465.

The CUE is configured to require SMTP authentication, and again using ray.maslanka@gmail.com.

Note the errors related "Exception reading response", not a very descriptive error but related to the 465 / SSL authentication.

4414 12/05 09:18:08.994 VMSS mnot 0 MessageNotification: Enter insertIntoMsgNotifQueue(): msg recipient: UOnenotif target: UOne
4414 12/05 09:18:09.083 capi smtp 0 SmtpServer: getSysdb(): Attribute: address
2297 12/05 09:18:09.088 capi smtp 0 SmtpSysdbNode: get(): address
4414 12/05 09:18:09.088 VMSS mnot 0 MessageNotification: query: INSERT INTO outcall_email_job VALUES ('UOne', 108, 1323094689041, 18, 0, 'UOne');
4414 12/05 09:18:09.120 VMSS mnot 0 MessageNotification: Notifying sender threads
4414 12/05 09:18:09.120 VMSS mnot 0 MessageNotification: Exit insertIntoMsgNotifQueue(): notifyEmailThread=true, notifyPhoneThread=false
3021 12/05 09:18:09.194 VMSS mnot 0 EmailSender: Processing job: 1
3021 12/05 09:18:09.212 VMSS mnot 0 EmailSender: Got a job: [owner_id=UOne, contact=ray.maslanka@gmail.com, extra_text=null, nextSendTime=1323094689041, device_type=32, device_id=108, retryCount=0, targetId=UOne, attach_vm=true, isUrgent=false, isPrivate=false, ndrreason=0, uid=18, messagetype=1, preferenceA, sender=203, callerName=User Three
3021 12/05 09:18:09.217 VMSS mnot 0 EmailSender: sendEmailNotification: checkSendPreConditions passed
3021 12/05 09:18:09.217 capi smtp 0 SmtpServer: getSysdb(): Attribute: address
2322 12/05 09:18:09.218 capi smtp 0 SmtpSysdbNode: get(): address
3021 12/05 09:18:09.218 capi smtp 0 SmtpServer: getSysdb(): Attribute: port
2297 12/05 09:18:09.220 capi smtp 0 SmtpSysdbNode: get(): port
3021 12/05 09:18:09.220 capi smtp 0 SmtpServer: getSysdb(): Attribute: userid
2318 12/05 09:18:09.221 capi smtp 0 SmtpSysdbNode: get(): userid
3021 12/05 09:18:09.222 capi smtp 0 SmtpServer: getSysdb(): Attribute: password
2307 12/05 09:18:09.223 capi smtp 0 SmtpSysdbNode: get(): password
3021 12/05 09:18:09.223 capi smtp 0 SmtpServer: getSysdb(): Attribute: authRequired
2322 12/05 09:18:09.224 capi smtp 0 SmtpSysdbNode: get(): authRequired
3021 12/05 09:18:09.230 VMSS mnot 0 EmailSender: Begin processing email job, UID=18
3021 12/05 09:18:09.261 VMSS mnot 0 EmailSender: Attachment body part added, UID=18
3021 12/05 09:20:09.532 VMSS mnot 0 EmailSender: Error sending email, UID= 18 :javax.mail.SendFailedException: Sending failed;
nested exception is:
class javax.mail.MessagingException: Exception reading response;
nested exception is:
java.net.SocketTimeoutException: Read timed out
3021 12/05 09:20:09.532 VMSS mnot 0 EmailSender: Send email rc=2
3021 12/05 09:20:09.532 VMSS mnot 0 EmailSender: Deleting email job: Device ID=108, UID=18
3021 12/05 09:20:09.560 VMSS mnot 0 EmailSender: calculateWaitTime(): current time: 1323094809558, job time: 0
3021 12/05 09:20:09.560 VMSS mnot 0 EmailSender: Wait time=0

Below is the software version information related to the UC520 CUE.

Unfortunately the CUE release notes at http://www.cisco.com/en/US/docs/voice_ip_comm/unity_exp/rel8_6/rel_notes/rel_notes86.html#wp364157 indicate SMTP over TLS and SSL to GMail, etc is supported first in version 8.6.

show software versions


Cisco Unity Express version (8.0.6)


Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2010 by Cisco Systems, Inc.


Components:
- TimeCardView version 8.0.6
- PhoneConnect version 7.0.0
- CUE Voicemail Language Support version 8.0.6
- Monitor Agent version 7.0.0
- Madrox Multi-app Support version 8.0.6

There are multiple conversations on the Internet re: using GMail's SMTP server(s) as voicemail message delivery servers, but none with detailed resolutions.

A request for feedback in the Cisco supportforums re: the software version and related errors can be found here, with no replies at the time of this writing: https://supportforums.cisco.com/message/3503487#3503487

My strategy at this time will be to assume voicemail message delivery from UC5XX with software load 8.2.0 is not possible via GMail's SMTP servers.