Monday, February 11, 2013

Enable Calendar Presence

When Cisco originally released the Cisco Unified Presence Communicator (CUPC) client several years ago, they provided end-users with the ability to share their calendar presence.
Jabber for Windows, which replaced CUPC, does not provide the same simple way for the end-user to share his/her calendar presence status (e.g. “In a Meeting” or “Available”).
In order for the end-user to “opt-in” to this feature, he/she must login to the Cisco Unified Presence User Options web page (https://[imp server]/cupuser).  Obviously, this is not the most ideal situation.
In order to enable this feature for the end-user, perform the following steps:
  1. SSH into the Cisco Unified Presence Server
  2. Login with the OS administrator ID and the defined password.
  3. From the command prompt enter the following command, substituting “username” for the end-user account being modified:
run sql execute procedure spSetUserCalendaring((select pkid from enduser where userid like ‘username’),’t',’t')
To adjust this setting for multiple users, I leveraged Excel and the concatenate formula as follows:
  • Column A: This column should contain the usernames
  • Column B: =CONCATENATE(“     run sql execute procedure spSetUserCalendaring((select pkid from enduser where userid like ‘”,A2,”‘),’t',’t') “
Take the results from Column B, copy the values and paste into TextWrangler (Mac) or Notepad++ (Windows).  From here, you can copy/paste the commands into the SSH terminal.
If you notice, I added 5 spaces in front of the SQL command. During my testing, I found that some of the initial characters can be cut off when pasting multiple lines into the CLI.

Monday, January 14, 2013

Translator_X


http://translatorx.cisco.com/


What is TranslatorX?

TranslatorX is a troubleshooting tool that allows you to quickly parse through Cisco Unified Communications Manager or Cisco Unified Border Element trace files and search for Q.931, H.225, SCCP (Skinny), MGCP, or SIP messages. TranslatorX supports searching through large numbers of trace files and provides advanced filtering capabilities to help you find the calls you are interested in. You can generate sophisticated message filters. These filters can be created automatically for you based on call detail record information as well.
TranslatorX is available for Mac OS X, Microsoft Windows, and Linux.

Features

The following is a list of the features of TranslatorX
  • Reads CCM/SDI or SDL Trace files from Cisco Unified Communications Manager
  • Reads SIP debugs from Cisco Unified Border Element (debug ccsip messages)
  • Finds and decodes SCCP (Skinny), H.323 (H.225 and H.245), ISDN Q.931, MGCP, and SIP messages
  • Generates a call list based on Call Detail Record information contained in the trace
  • Decodes Call Detail Record Fields
  • Advanced Filtering Capabilities
  • Automatic Filter generation based on calls from the Call List
  • Message Sequence Diagram Generation
  • Ability to traverse a hierarchy of folders automatically
  • Automatic sorting of messages based on timestamp (in the case of opening multiple files)
  • Automatic exclusion of repetitive messages (SCCP Keepalives, SIP OPTIONS, and MGCP Keepalives)
  • Automatic correlation of H.245 and H.225 messages
  • Can read plain .txt files as well as compressed .gz files automatically

Tuesday, January 1, 2013

MGCP TSHOOTING

Q931 SETUP

Q931 SETUP message arrives. The destination is 2025552002. The bearer channel is channel #1 . The D channel which is used for signaling is the last channel (Serial 0/0/0:23). The SETUP message will be packetized by the gateway and sent to the “mgcp call agent” (the first choice Unified Communications Manager). This is process of taking the ISDN messages arriving on the PRI and packetizing them and sending them to the UCM is known as Q931 backhaul. The UCM listens on TCP port 2428- the gateway uses an ephemeral port that is dynamically selected.
May 30 13:04:07.404: ISDN Se0/0/0:23 Q931: RX <- SETUP pd = 8  callref = 0x0084
 Bearer Capability i = 0x8090A2
 Standard = CCITT
 Transfer Capability = Speech 
 Transfer Mode = Circuit
 Transfer Rate = 64 kbit/s
 Channel ID i = 0xA98381
 Exclusive, Channel 1
 Progress Ind i = 0x8583 - Origination address is non-ISDN 
 Calling Party Number i = 0x0080, N/A
 Plan:Unknown, Type:Unknown
 Called Party Number i = 0xA1, '2025552002'
 Plan:ISDN, Type:National

CRCX

The MGCP messaging sequence now begins. As a reminder the UCM will be listening on UDP port 2427. The Q931 SETUP would have been received by the UCM. The UCM is then able to route the call to the destination (the incoming CSS and incoming significant digits settings on the gateway configuration within UCM is used to route the call to the next hop which is the phone). The UCM will use SIP or SCCP for call setup on the line/phone side but in this instance we are interested in the MGCP call setup. So the first message is  Create Connection (CRCX). The UCM is telling the gateway to provide the ip address and port number that will be used for this call. The UCM is the master and the gateway is the slave and so the UCM also provides a lot of other information to the gateway namely:
(1) C (CallId): globally unique conference id
(2) X (RequestIdentifier): random hexadecimal string generated- all responses to this create connection will contain X=1 within the message.
(3) L (LocalConnectionOptions): information about the call that will be setup- codec = 711u, sampling rate 20ms, s= off (vad), TOS = b8 = DSCP 46
(4) M (ConnectionMode): recvonly.  UCM is not providing gateway information about the other party involved in the call just yet. This is because the phone has not answered yet so the UCM does not have that information. So the gateway will not be sending any packets at this stage.
(5) R (RequestedEvents): The D means invoke the “DTMF package”  if the gateway receives 0-9, ACBD*#.

May 30 13:04:07.404: MGCP Packet received from 10.10.210.11:2427--->
CRCX 610 S0/SU0/DS1-0/1@SiteA-RTR MGCP 0.1 <<< 610 is the transaction number. Each message
                                           <<<  needs a response with this transaction id.
C: D000000002cd8630000000F580000084   
X: 1
L: p:20, a:PCMU, s:off, t:b8, fxr/fx:t38
M: recvonly
R: D/[0-9ABCD*#]
Q: process,loop
<---
The gateway sends a 200 OK confirmation to the UCM providing the requested information that was in the CRCX.  The gateway also provides the UCM a local call identifier (I: ConnectionID). In this instance  the local call ID of I= 57 should be used when referencing this call. The “57″ is randomly generated and only has significance locally for the duration of this call. The information about codec’s and RTP port numbers cannot be carried in the 200 OK and therefore we have Session Description Protocol (SDP) information within the 200 OK. One of the most important lines within SDP is the “m=” line which is used to reveal the information about media. The RTP media types being used by the gateway are “0″ which is G711ulaw and 100 which is Named Signaling Events (NSE) used for fax and modem communications.

May 30 13:04:07.404: MGCP Packet sent to 10.10.210.11:2427--->
200 610 OK <<< 200 OK response. This the response to the request which had transaction id 610
I: 57 <<< Local call ID

v=0
o=- 87 0 IN IP4 10.10.110.1
s=Cisco SDP 0 <<< Beginning of SDP
c=IN IP4 10.10.110.1 <<< mgcp bind media source lo0
t=0 0
m=audio 16910 RTP/AVP 0 100 <<< RTP port number 16910, 0 is g711u, 100 is NSE
a=rtpmap:100 X-NSE/8000
a=fmtp:100 200-202 <<< fmtp= format specific params for rtp payload 100.
                   <<< 200, 201, 202 are Cisco NSE events related to T38 fax
a=X-sqn:0
a=X-cap: 1 audio RTP/AVP 100
a=X-cpar: a=rtpmap:100 X-NSE/8000
a=X-cpar: a=fmtp:100 200-202
a=X-cap: 2 image udptl t38
<---

Alerting, Ringback, RQNT

Below we have the Q931 Call Proceeding and Alerting being sent out to the PSTN- this is  being received from the UCM on the Q931 backhaul link and converted to circuit switched signaling by the gateway DSPs and sent out to the PSTN. The Alerting means that the destination phone is ringing and hence ringback should be given to the caller.  Who provides the ringback? The ringback is known as in-band information is played by our gateway to the PSTN. We inform the PSTN that we are playing ringback since the Progress Indicator is “8″ and this means “in-band” information is present.

May 30 13:04:07.408: ISDN Se0/0/0:23 Q931: TX -> CALL_PROC pd = 8  callref = 0x8084
 Channel ID i = 0xA98381
 Exclusive, Channel 1
May 30 13:04:07.408: ISDN Se0/0/0:23 Q931: TX -> ALERTING pd = 8  callref = 0x8084
 Progress Ind i = 0x8088 - In-band info or appropriate now available
The PSTN now knows that we are going to play a tone/annoucement. Now we need to play it! The UCM tells the gw to play a ringback tone to the PSTN using the Notification Request message.
May 30 13:04:07.408: MGCP Packet received from 10.10.210.11:2427--->
RQNT 611 S0/SU0/DS1-0/1@SiteA-RTR MGCP 0.1
X: 1
R: D/[0-9ABCD*#]
S: G/rt  <<<<<<  S: signal request, G- generic media package, rt= ringback tone
Q: process,loop
<---
We confirm this to the UCM
May 30 13:04:07.416: MGCP Packet sent to 10.10.210.11:2427--->
200 611 OK
<---

CONNECT, MDCX

The next message is the ISDN CONNECT message which means that the Called Party (IP Phone) has answered.

May 30 13:04:13.408: ISDN Se0/0/0:23 Q931: TX -> CONNECT pd = 8  callref = 0x8084
 Display i = 'SiteA phone 2'
May 30 13:04:13.420: ISDN Se0/0/0:23 Q931: RX <- CONNECT_ACK pd = 8  callref = 0x0084
At this stage the gateway needs to know about where to send RTP packets to. UCM tells the MGCP gw information about who to send RTP packets to using the Modify Connection (MDCX) message. We have to include SDP information in order to do this.
May 30 13:04:13.676: MGCP Packet received from 10.10.210.11:2427--->
MDCX 613 S0/SU0/DS1-0/1@SiteA-RTR MGCP 0.1
C: D000000002cd8630000000F580000084 <<< same CallID as CRCX
I: 57 <<< same local CallId as earlier
X: 1 <<< same request identifier as earlier
L: p:20, a:PCMU, s:off, t:b8, fxr/fx:t38
M: sendrecv <<< previously was recvonly- now two way audio.
R: D/[0-9ABCD*#], FXR/t38
S:
Q: process,loop

v=0
o=- 87 0 IN EPN S0/SU0/DS1-0/1@SiteA-RTR
s=Cisco SDP 0 <<< SDP header
t=0 0
m=audio 22876 RTP/AVP 0 <<< IP Phone is listening on port 22876 using rtp payload "0" which is g711u
c=IN IP4 10.10.200.128 <<< IP Phone IP address
a=X-sqn:0
a=X-cap:1 image udptl t38
<---

The MDCX is ack’d by the UCM below.

May 30 13:04:13.692: MGCP Packet sent to 10.10.210.11:2427--->
200 613 OK
<---
At this stage we have an active call. Let’s look at the process of call teardown.

Call Teardown- MDCX

We  see the MDCX being used to revert to “recvonly” meaning stop sending packets to the IP phone.
May 30 13:04:18.616: MGCP Packet received from 10.10.210.11:2427--->
MDCX 614 S0/SU0/DS1-0/1@SiteA-RTR MGCP 0.1
C: D000000002cd8630000000F580000084 <<< same CallID
I: 57 <<< same local CallID
X: 1 <<< same requestID
M: recvonly <<< stop sending packets to IP Phone
R: D/[0-9ABCD*#] <<< keep telling UCM about DTMF received from PSTN
Q: process,loop
<---
We send confirmation to the UCM.
May 30 13:04:18.620: MGCP Packet sent to 10.10.210.11:2427--->
200 614 OK
<---

Q931 DISCONNECT

In this instance the IP Phone hangs up the call and we will see the DISCONNECT  sent out to the PSTN. If the PSTN hung up the call we would see the DISCONNECT arrive from the PSTN.

May 30 13:04:18.624: ISDN Se0/0/0:23 Q931: TX -> DISCONNECT pd = 8  callref = 0x0002
 Cause i = 0x8290 - Normal call clearing
May 30 13:04:18.636: ISDN Se0/0/0:23 Q931: RX <- RELEASE pd = 8  callref = 0x0084
May 30 13:04:18.636:ISDN Se0/0/0:23 Q931: TX -> RELEASE_COMP pd = 8  callref = 0x0002

DLCX

The UCM instructs the gateway to stop listening on the RTP port number setup in the CRCX phase earlier. This is done with the Delete Connection (DLCX) message.
May 30 13:04:18.640: MGCP Packet received from 10.10.210.11:2427--->
DLCX 615 S0/SU0/DS1-0/1@SiteA-RTR MGCP 0.1
C: D000000002cd8630000000F580000084 
<<< same CallID
I: 57 <<< same local CallID
X: 1 <<< same requestID
S:
<---
The gateway confirms the DLCX and includes Connection Parameters (“P”) or QoS stats regarding the call. PS=packets sent, OS=octets sent, PR=packets received, OR=octets received, PL=packets lost, JI= jitter, LA=latency

May 30 13:04:18.664: MGCP Packet sent to 10.10.210.11:2427--->
250 615 OK
P: PS=247, OS=39520, PR=245, OR=39200, PL=1, JI=0, LA=0 <<<<
<---

Monday, December 24, 2012

TEST VOICE GATEWAYS T1/PRI

The number of issues that could arise in your VoIP deployment involving voice gateways are too numerous to capture in one blog.  The issues and variants are probably too numerous to capture in one blog series.  So, my intention with this series is to simply touch on methods I use for testing some (not all) issues I have come across with voice gateways.  Part 1 of this series will focus on how an admin can configure the dial plan in such a way that allows them to "seize" or force calls out any individual T1/E1 voice circuit in their Cisco Unified Communications Manager solution.

Background

 It could be that you don't know what I mean by "seizing" a channel or that you wonder why I keep putting "seize" in quotes.  On many PBX systems there is a way for the admin of the system to force an individual call out any voice circuit attached to the system.  It is a way for the admin to test physical circuits and validate call path.  Different admins and PBX vendors use different terms for this but "seizing" the trunk seems to be a common colloquialism.  I use quotes when referring to "seizing" a trunk with Cisco Unified Communication Manager (CUCM) simply because the concept doesn't inherently exist in the product.  If you want to implement a feature which allows admins to selectively send calls out a particular voice circuit, you will have to design and build it into your dial plan.

Example Dial Plan Scenario

While CUCM dial plan configurations vary from environment to environment, there are common elements across all designs:
  • Devices (phones) are configured with Calling Search Spaces (CSS)
  • Calling Search Spaces contain one or more partitions
  • Partitions contain one or more route patterns
  • Route patterns are configured (most of the time) to use route lists
  • Route lists contain one or more route groups
  • Route groups contain one or more gateways or trunks
Gateways basically bridge call legs between administratively separated domains (in the case of IP-IP gateway) or domains separated by signal methodology (i.e. MGCP and TDM).  The gateway or trunk destination is not an important consideration for the method discussed.
A sample dial plan scenario is provided in the following figure:
dpscenario1

There is nothing extraordinary in the example above, a user in Washington, D.C. dials the directory information line for the District of Columbia and assuming it isnt a blocked pattern the call will use a geographically designated route list. The route list may contain gateways in other geographic areas for redundancy purposes or not. In Chicago, a separate user tries to reach the same directory number may use a separate route list (assuming least cost routing is not implemented).

The Problem Scenario

Assume that the CUCM administrator is located in Chicago and wants to test call routing behavior using the gateways located in D.C. There are several solutions to this question, assuming that the dial plan design isnt that robust the answer most commonly used would be to reconfigure a test phone in Chicago with the D.C. calling search space and place the test call.
Now, assume that the Chicago administrator wants to test an outbound call through a D.C. PRI on the second gateway in Route Group 2 (which is the 4th gateway in the outbound selection list). In many cases this is more difficult and one may juggle route group priority orders to accomplish this.
Administrators may need to selectively test new PRIs added to the system, PRIs that may have voice quality issues, PRIs that may be rejecting long distance calls, or PRIs that have just undergone maintenance. Expanding on this care and feeding concept, an administrator may want to test individual analog circuits, or inter-PBX connections, analog termination on a video MCU, or any other critical system resource.
Using the standard approach the change needed to make a single test is overly cumbersome, may require coordination (i.e. Change Control window), and may introduce unexpected consequences.

A Possible Solution

The NetCraftsmen solution to this administrative burden is to build an overlay dial plan where specific patterns are used that allow a single phone to directly dial a remote party using any gateway configured in the Cisco IP telephony environment.
The basics:
  • Create trunk test route groups
  • Assign trunk test route groups to trunk test route lists
  • Assign one gateway to one trunk test group
  • Create pattern designations to uniquely identify trunk test codes
  • Place trunk test codes in a partition visible from all IP phone calling stations
  • Assign Forced Authorization Codes to provide a level of authorization
To illustrate, look at the following figure which illustrates the overlay concept using the previous example.

dpscenario2

Building the Route List - MGCP Environments

With CUCM 4.1 and later an administrator can assign a single gateway to more than one route group so this allows for two optional configurations when building a route list to work with the Trunk Access methodology.
First, all route groups can be configured in a 1:1 relationship with gateways. So, gateway1 will be part of Route Group1 and Route Group1 can be part of any Route List including the Trunk Testing Route List. The net benefit in the end game is fewer Route Groups which isnt usually a major issue in most environments.
The second option is to assign a gateway to normal call route groups in whatever way makes sense for the existing design and then assign the gateway to a separate Trunk Test route group specifically for use with trunk access testing. With the introduction of Standard Local Route Groups (SLRG) in CUCM 7.x, placing multiple gateways in a single route group is the option many folks will prefer.
In our example it doesn't matter which method an admin uses for their standard call path selection. We are going to create route groups with a single Gateway membership (note we assume two PRIs on each IOS gateway):
  • DC PSTN-localgw1 RG1: DC Gateway 1 is the only member
  • DC PSTN-localgw1 RG2: DC Gateway 2 is the only member
  • DC PSTN-localgw2 RG1: DC Gateway 3 is the only member
  • DC PSTN-localgw2 RG2: DC Gateway 4 is the only member
  • DC PSTN-localgw3 RG1: DC Gateway 5 is the only member
  • DC PSTN-localgw3 RG2: DC Gateway 6 is the only member
 Once assigned to route groups, these gateways can be placed in any production route list. In addition the same route groups can be assigned to route lists specifically used for trunk access testing:
  • DC Test-PRI01 RL: DC PSTN-localgw1 RG1 is the only member
  • DC Test-PRI02 RL: DC PSTN-localgw1 RG2 is the only member
  • DC Test-PRI03 RL: DC PSTN-localgw2 RG1 is the only member
  • DC Test-PRI04 RL: DC PSTN-localgw2 RG2 is the only member
  • DC Test-PRI05 RL: DC PSTN-localgw3 RG1 is the only member
  • DC Test-PRI06 RL: DC PSTN-localgw3 RG2 is the only member

 Building the Route List - H323/SIP Environments

With MGCP, each individual T1/E1 is registered to the CUCM cluster as a MGCP end-point. This is not the case with H.323 and SIP. You could have 16 T1-PRIs terminated on a H.323 gateway and the CUCM references the gateway by a single entry. In other words, the trunks connected to a H.323 gateway are transparent from a CUCM perspective.
This is not a problem, you just need to incorporate that known fact into your dial plan. You can do this on individual test patterns (discussed later) or you can accomplish this by configuring multiple route groups that contain the same H.323 gateway. Then, when you assign the route groups to a route list, modify the called party transformations to prefix digits that the remote H.323/SIP dial-peers will handle in a deterministic way.
For our purposes, we suggest creating a single route group for the H.323/SIP gateway that will be tested and then assign this route group as the only member of a route list used for testing. If you have multiple circuits on the H.323/SIP gateway then you'll use the test pattern to accommodate your dial-peer pattern matching needs. We'll get into this shortly.

Building the Dial Plan

All call routing starts with a digit pattern and the approach outlined in this blog is no different. As such it requires design consideration with respect to the existing dial plan solution. The first question that must be addressed is what partition should be used.
NetCraftsmen typically builds a partition that is dedicated to services which are only visible to IP phones on the CUCM cluster. For optimum flexibility it is recommended that the administrator use a partition that is visible from all IP phone calling search spaces, is not part of any ToD routing solution, and is not visible from any non-IP phone calling search space (i.e. gateway CSS or voicemail port CSS). For the purpose of continuing the example, the CL Svcs-Priv PT is used.
  • CL is used to designate scope, in this case cluster wide.
  • Svcs-Priv identifies this partition as a partition that provides special services that are only available to the local cluster.
After choosing the partition the next step is to identify a digit pattern which is scalable, flexible, and non-overlapping. The asterisk * is a useful digit in to avoid overlapping conditions (keeping in mind that using the asterisk in this way is not an original idea!).
Since scalability is critical and it is possible we may want to extend the usage of asterisk, a digit sequence could be added to designate a feature request. If two digits are used then the administrator can have 100 such features which should be sufficient in most cases. For this example we will reserve 0x for any telecommunication special service codes and assuming this is the first such application we will use *07.
Next a digit pattern is needed to uniquely assign to each gateway in the environment. Another consideration is possibly using a digit flag which identifies geographic location, cluster identification, or some other convention that makes sense to the organization or existing standard. Keep in mind that the future may bring changes that quickly introduce a numbering standard to obsolescence (e.g. using private IP address schemes that try to use octets as site designations).In this example we will use two digits which allows for 100 such configurations.
So, given our standard:
  • *0701 will use DC Test-PRI01 RL
  • *0702 will use DC Test-PRI02 RL
  • *0703 will use DC Test-PRI03 RL
  • *0704 will use DC Test-PRI04 RL
  • *0705 will use DC Test-PRI05 RL
  • *0706 will use DC Test-PRI06 RL
The patterns as they are listed above are not sufficient to satisfy the needs of the CUCM digit analysis subsystem. To make these patterns functional we will actually define a pre-dot digit truncation method, allow any number of digits following the pattern, and define a termination string. With these new configuration changes the pattern for DC Test-PRI01 RL is *0701.!#, the pattern for DC Test-PRI02 RL is *0702.!#, and so on.
The idea is that the administrator will supply all digits needed by the PSTN to route the call. So, if the administrator was going to call toll free information on DC PRI 01, the test pattern is:
*070118005551212#
So, the above would match the route pattern: *0701.!# and the route pattern is configured to strip pre-dot, the gateway receives 18005551212.
Some other examples:
Test Pattern Usage Example
*0703411# Sending information calls (411) out PRI number 3
*0705914105551212# Sending calls to directory information service line for Maryland to a PBX or Centrex Intercomm switch that requires an offnet code of 9.
*070410100333015551212# Use the Sprint long distance PIC code to dial information in California using PRI number 4.
*07012025551212# Dial information in Washington D.C. as a local 10-digit number using PRI number 1.

Going back to our problem scenario: The administrator in Chicago wants to test a call to the D.C. information line using the fourth PRI in the trunk group they would go off hook and dial *07042025551212#. Note that the administrator does not need to specify a leading digit of 1 for long distance since the call is not long distance from the DC trunk group.

Building the Dial Plan - H.323/SIP Considerations

The previous section assumes that you are using MGCP gateways. For the most part, the examples laid out in the previous section are applicable to call agent controlled (e.g. MGCP) and gateway controlled (e.g. H.323) protocols. However, there are a few other things to consider with call signaling scenarios that use gateway controlled protocols.
You can still use the route pattern conventions as defined. The only thing you need to work out is what digit patterns would you like to prefix to the pattern so that the remote H.323 gateway knows which trunk it should use? Basically, come up with a pattern prefix that the CUCM sends to the gateway which aligns with a POTS dial-peer pointing to the trunk you wish to test.
An example dial-peer configuration on one of the D.C. voice gateways in our example could be:
dial-peer voice 79000 pots
 description Trunk Testing circuit 1
 destination-pattern 1990T
 port 0/0/0:23
 !
 dial-peer voice 79001 pots
 description Trunk Testing circuit 2
 destination-pattern 1991T
 port 0/0/1:23
 !
If an admin wishes to test the T1-PRI connected to port 0/0/1 on the example voice gateway, they could use the digit string: *07027035551212#. This would match route pattern: *0702.!#. In this route pattern you would use the called party transformation section to strip the pre-dot and prefix 1991. When the gateway receives the call setup, it will strip the 1991 and send the remaining digits to the PSTN for processing.
Note that you will want to keep your gateway's Class of Restriction (COR) configuration in mind for SRST-enabled gateways. If you don't assign a COR to the test pattern dial-peers but use a corlist configuration for your attached ephones, then you will introduce an opening to toll-fraud scenarios. So, if you use COR on your H.323 gateway, then configure a special COR for these test patterns (e.g. corlist specialTelecomm) and make sure that the COR isn't a member of any SRST ephone corlist.

Authorization Codes

Our solution uses a dial-plan overlay that the operations team can use for testing. Our objective is to minimize unnecessary reconfiguration of phones (i.e. CSS) or route list/route group membership. At the same time, we don't want just any user being able to learn about the trunk access codes and use them to bypass any COR configurations you have in your production dial-plan. Is this likely? Who knows. It is a possible toll-fraud scenario and in my mind, that means it can't be ignored.
The solution is actually quite simple. For all route patterns configured for trunk testing use Forced Authorization Codes (FAC). Assign a permissions level like "250". Then create FAC codes for each of your operations staff or groups of staff members (whatever works best for you). Make sure the FAC permission level used is "higher" or "more restrictive" then what you may already have in place for local, long distance, interlata, international, etc..
If you use FAC and a user was clever enough to figure out the test pattern they would be blocked. Unless, of course, the user also figured out the FAC code. That would reinforce an operational recommendation to review CDRs periodically and to enable storing FAC codes in CDRs. However, this is definitely a topic for another day!

Cisco CUCM Blocking Calls by Calling Party Number (ID)

From time to time the Cisco Unified Communications Manager (CUCM) administrator receives a request to block inbound calls to an organization based on the calling party number (CPN). This is commonly known as "black listing". Historically, admins could use translation profiles on dial-peers to address this need. With CUCM 8.0 the options available to an administrator have been expanded by leveraging a new route directive on translation patterns.
Background
The approach described in this blog is focused on filtering calls based on CPN as presented from the PSTN (via a voice gateway or CUBE). It does not address "black listing" for Cisco Mobility or other station-to-station or stations-to-PSTN use cases.
A typical use case is to block marketing calls, recruitment calls, or any other call that is generally unwanted. The idea is that the administrator creates a list of CPNs that should be blocked and anything else is permitted. Truly a basic concept.
Prior to CUCM 8.0, the most common method for black listing unknown inbound calls based on CPN was to leverage translation-profiles on a Cisco IOS gateway. With the release of CUCM 8.0, there is another option made available to administrators that I believe improves overall operational sustainability.
The Translation-Profile Method
The following diagram illustrates the basics of this method.

In the above example, a call is presented to the voice gateway by the PSTN. The gateway leverages a translation-profile on an ingress POTS dial-peer to "test" the CPN against a list of "blocked" numbers. If the CPN is in the block list then the call is rejected using an administratively defined message. If the CPN is not blocked, then the voice gateway will continue processing the call, matching the VoIP leg dial-peer, and all is well in the world.
An example configuration supporting the described call flow could be:
!Voice Translation Rule set
voice translation-rule 69
  rule 1 reject /^800.*/
  rule 2 reject /2025551000/
  rule 3 reject /7035551000/
!
!Voice Translation Profile Assignment
voice translation-profile all-blacklist
  translate calling 69
!
! Sample POTS Dial-Peer
dial-peer voice 39001 pots
 description Ingress From PSTN
 incoming called-number 301555....
 call-block translation-profile incoming all-blacklist
 call-block disconnect-cause incoming call-reject
 direct-inward-dial
 port 0/0/1:23
 forward-digits 10
!
The POTS dial-peer 39001 is handling ingress calls from the PSTN and it is configured to check the ISDN call setup information elements (IE) against a translation-profile to determine if the call is permitted. The translation profile "all-blacklist" identifies the translation-rule and the IE that should be evaluated. Specifically, the calling IE.
Translation rule "69" defines several patterns that should be rejected. Namely, any number that begins 800, calls from 2025551000, and calls from 7035551000.
The method just described is only applicable to SIP and H.323 configurations. It does not work with MGCP. An additional point of interest is that there is a limit of 15 rules in a translation-rule set. Fortunately, I have not ran up against this limit but I suspect that some people have.
CUCM Route Next Hop by Calling Party Number
In CUCM version 8.0, Cisco added the Hotline Feature. One configuration element added to support this feature is a new paramter on Translation Patterns. This new parameter may be used to instruct the CUCM digit analysis routine to evaluate the call by CPN rather than called party number (DNIS). This configuration parameter is called "Route Next Hop by Calling Party Number" and it can be used to facilitate "black listing" CPNs without requiring the administrator to use the Hotline Feature.
The following diagram illustrates a sample call flow where CPN filtering is facilitated by this new capability.

The call flow can be described as follows:
  1. The PSTN carrier presents the call to the voice gateway.
  2. The voice gateway processes the call and then relays call setup information to the CUCM.
  3. The gateway object in CUCM is configured to use CL_PSTN-In_CSS, which is used for the initial digit analysis step.
  4. A translation pattern in CL_PSTN-In_PT route partition is configured to capture any CPN by using the "!" digit pattern
    • Translation Pattern: !
    • Partition: CL_PSTN-In_PT
    • Calling Search Space: CL_PSTN-Screen_CSS
    • Route Option: Route this pattern
    • Route Option: Urgent Priority
    • Route Option: Route Next Hop by Calling Party Number
  5. Assuming that a CPN is present, CUCM will continue digit analysis using CL_PSTN-Screen_CSS.
  6. The CL_PSTN-Screen_CSS contains one partition, CL_PSTN-Screen_PT and this partition will contain allow and deny patterns. This is where the magic happens.
Before going into how we want to leverage CL_PSTN-Screen_PT, I want to point out something about what is happening at Step 4. I tried this configuration a few times in my lab without success and I realized two things. First, I need to work on my reading comprehension skills. Second, the term "Route Next Hop by Calling Party Number" should be read literally.
What is happening here is that the "!" pattern in CL_PSTN-In_PT is telling the CUCM "evaluate the CPN against the patterns in CL_PSTN-Screen_CSS". Originally, I was trying to add my blocking patterns to CL_PSTN-In_PT with the "Route Next Hop" flag and the "Block this pattern" flag set on the same pattern. This does not work.
Instead, what you need to do is create translation patterns in CL_PSTN-Screen_PT that are configured as normal translation patterns (i.e. do not check the "Route Next Hop by Calling Party Number" option). What the CUCM digit analysis process is going to do is take the CPN and compare it with the translation pattern(s) in CL_PSTN-Screen_PT.
Continuing our example, as you can see in the figure, we have defined the following translation patterns in CL_PSTN-Screen_PT:
  • "!": This pattern is essentially our explicit "allow all" pattern and the Route Option flag is set to "Route this Pattern". You need this to allow call setup to continue for patterns you want to allow through.
  • The following patterns are  configured with the Route Option flag "Block this pattern". So, calls from a CPN that matches any of these patterns is blocked:
    • "2025551000": Specific pattern match.
    • "800!": Any CPN that starts with 1800 or 800 is matched.
When blocking a pattern, the administrator can select one of several disconnect cause codes to send back to the PSTN carrier (via the voice gateway). Selecting "Call Rejected" may be the preferred option because is the system originating the call is automated (i.e. a marketing company's predictive dialer) then there is a possibility the system will act on the rejected inform message and remove the DNIS from their dialing target table.
Summary of Configuration Steps

In my lab, I used the following configuration procedures.
  1. Create partitions:
    • CL_PSTN-In_PT: This partition will hold the translations which flag "Route Next Hop" behavior.
    • CL_PSTN-Screen_PT: This partition will hold translations used to evaluate CPN.
  2. Create Calling Search Spaces:
    • CL_PSTN-In_CSS: This is the CSS assigned to the voice gateway and it contains the CL_PSTN-In_PT.
    • CL_PSTN-Screen_CSS: This is the CSS assigned to the patterns in CL_PSTN-In_PT. This CSS contains the CL_PSTN-Screen_PT.
    • CL_Tenant-Control_CSS: This CSS is assigned to patterns in CL_PSTN-Screen_PT and it contains partitions that have phone DNs and other patterns that route to devices or applications on the CUCM cluster.
  3. Assign the CL_PSTN-In_CSS to the voice gateway.
  4. Add the "Route Next Hop" translation "!" to CL_PSTN-In_PT. Select the CL_PSTN-Screen_CSS, enable call routing, and enable "Route Next Hop by Calling Party Number". NOTE: You can also apply calling or called party transformations at this step, as needed.

  5. Add the "allow all" translation "!" to CL_PSTN-Screen_CSS, enable call routing, and DO NOT enable "Route Next Hop by Calling Party Number".
  6. Add any "black list" translation. Enable call blocking, select disconnect cause reason, and you are good to go.
Considerations
I am not sure why Cisco opted to use a "next instruction" approach here. I am sure there is a good reason and it is probably related to how the Hotline feature is designed to operate. I did try to mix translations that were routing on called party and translations that had the "route next hop" option enabled. Thus, removing one of the prescribed steps. This doesn't work as one would hope. In my tests, the CUCM digit analysis always preferred routing by called party information if you mix patterns in the same CSS.
The configuration examples provided assume that the calls coming into the CUCM are presenting a valid CPN. If calls coming into the system are flagged as private then CPN is not provided. The pattern "!" won't help you and you may need to look at using a null (blank) pattern in CL_PSTN-In_PT and CL_PSTN-Screen_PT. (I have not tested this.)
Conclusions
I am still working through running the CUCM approach described in this blog through some of our production design scenarios for validation purposes. Thus far, the approach seems viable for those who use MGCP gateways, would like to centralize call routing on the CUCM, or have ran into limits with the number of rules that can be assigned to a translation-rule set in IOS.

Cisco RTMT on Mac OS

CISCO RTMT on Mac OS X

  @ciscomonkey's article that is aptly titled "Real Time Monitoring Tool on Mac OS X" (http://www.ciscomonkey.net/rtmt-on-mac/)