Wednesday, 21 December 2011

Signed Configuration Files and Moving a Phone From CUCM 8 to CUCME

Communications Manager 8 features signed configuration files by default, however this can cause problems when moving a phone from CUCM 8 to CUCME. The phone will continue to try requesting a signed configuration file (e.g. SEP012345678912.cnf.xml.sgn) instead of an unsigned configuration file (e.g. SEP 012345678912.cnf.xml). As CUCME doesn't by default generate signed configuration files, the phone will fail to download its configuration via TFTP and then fallback to its last known configuration, resulting in a endless loop of registration failure. You can confirm what file the phone is trying to download by enabling debug tftp events.
The solution is to erase the phone's ITL configuration, the process varies between models but for the 7900 series phones it is:

Settings > Security > Trust List > ITL File > **# (to unlock the settings) > Erase

This problem can also bite you when moving a phone between CUCM clusters, Cisco have a support document explaining the fixes here.

Wednesday, 7 December 2011

UC500 Rewriting SIP Headers

One of the big pains with SIP trunks is the variations in implementation between different providers - often the port range for RTP or the caller ID format will be different. These are easily fixed, but what if your SIP trunk provider expects the SIP headers to be formatted in a different way from your equipment? Fortunately the Cisco Unified Border Element (CUBE) functionality allows you to use regular expressions to amend SIP headers.
For this example configuration our SIP trunk provider has specified that for Invite packets:
  1. From header must contain the originating caller ID without the leading zero, e.g. From: "1143210757" <sip:1143213213@>
  2. To header must contain the called number with the leading zero for UK calls or 00 for international, e.g. To: <sip:07891234567@>
As the dialled number will already include the correct number of preceeding zeros no changes are required for this. However we do need to strip the preceeding zero from  the caller ID via a translation profile:

voice translation-rule 200
 rule 1 /^0\(.*\)/ /\1/
voice translation-profile SIP_OUT
 translate calling 200

Now a UC500 series formats the Remote-Party-ID and From fields with the caller ID from the ephone-dn that initiated the call:

Remote-Party-ID: "Firstname Lastname"  <sip:1143213213@>
From: "Firstname Lastname" <sip:1143213213@>

To rewrite them to the correct format with the caller ID inside the quote marks we use a sip-profile. These are applied globally and allow us to amend the SIP headers:

voice service voip
  sip-profiles 100

voice class sip-profile 100
 request ANY sdp-header Connection-Info remove
 response ANY sdp-header Connection-Info remove
 request invite sip-header Remote-Party-ID modify "\"(.*)\" <sip:(.*)@(.*)>" "\"\2\" <sip:\2@\3>" 
 request invite sip-header From modify "\"(.*)\" <sip:(.*)@(.*)>" "\"\2\" <sip:\2@\3>"

The regular expression "\"(.*)\" <sip:(.*)@(.*)>" "\"\2\" <sip:\2@\3>" identifies the text contained in quote marks, followed by the text before and after the @ symbol. It then replaces the text contained in quote marks with the text before the @ symbol. The end result of this is that From: "Firstname Lastname" <sip:1143213213@> becomes From: "1143213213" <sip:1143213213@>.

Further reading on using sip-profiles can be found here.