Saturday, September 28, 2024

Extract the Contents of Cisco COP Files

 This is simply a partial repost of :

How to Extract the Contents of Cisco COP Files

at https://ipcommute.co.uk/technical-articles/19--how-to-extract-the-contents-cisco-cop-files.html

All credit goes to  Aaron Harrison Development Engineer at IPCommute UK

I found it so useful today I wanted to make sure Aaron's post lives on.  Thanks Aaron!


Cisco Option files (COP Files) are released for Cisco Unified Communications Manager (CUCM) to add new functionality, fixes, and other optional components such as locales or phone firmware.


Each COP file is essentially an archive of files - some are copied to the CUCM server, some are used as data to import to the database, others might be scripts.


Occasionally it might be useful to be able to look at the files that make up a COP file. This has been most useful for me when working with National Dial Plans (NDP); these aren't as well documented as they might be, and I find it useful to look into the files and see exactly what each of the clauses in the NDP actually mean in terms of dialled numbers.

So - here is how to do it.

The COP file is basically a gzip, with an encryption header that makes it unrecognisable to archive packages such as 7-ZIP. You'll need two pieces of software:

Once you have downloaded and installed these, grab your COP file of choice. I'll use a Dial Plan from the UK (dp-ffr.3-1-18.GB.cop.sgn).

Run HXD, and open the .cop.sgn file. You'll be presented with a screen that looks like this:



Note above that I’ve highlighted in red the name of the file. Where you see this, highlight it with the mouse, and you should see the hex pattern ‘1F 8B 08’ just after it. This is a Magic Number that marks the start of a GZip file (see http://en.wikipedia.org/wiki/Magic_number_(programming) for more information on Magic Numbers).

What we need to do is highlight everything before that Magic Number, and remove it. Highlight is so that it looks like the following picture, and then click the Edit/Cut menu option. Accept the file size warning.

Once removed, your file should start with the hex values 1F 8B 08. Click the File/Save As menu option and save the file with an additional .gz on the end – e.g. dp-ffr.3-1-18.GB.cop.sgn.gz

Now you can run 7-ZIP, and open the dp-ffr.3-1-18.GB.cop.sgn.gz file. 

Monday, June 24, 2024

PI Meeting / Program Increment Planning

PI Planning stands for Program Increment Planning.

PI Planning sessions are regularly scheduled events held throughout the year where multiple teams within the same Agile Release Train (ART) meet to align to a shared vision, discuss features, plan the roadmap, and identify cross-team dependencies.


Agile Release Train (ART)

An Agile release train (ART) is a team of several Agile Teams working towards a common goal. 

Monday, October 30, 2023

VS Code Remote-SSH to AWS EC2 - disconnect and won't reconnect

Running VS Code 1.83.1 and Remote-SSH to AWS micro / free version EC2 instance of Ubuntu 20.04.6 LTS.

Found that after random intervals of low server stress the Remote-SSH session is disconnected and will not reconnect until the server is stopped and started.  Reloading VS Code does not help. Rebooting the EC2 instance does not help.  Remote IP / AWS security inbound rules are correct.

The fix for me was adding a swap file to the EC2 instance.

See here for the original post I used to set it up:
https://repost.aws/knowledge-center/ec2-memory-swap-file

Use the dd command to create a swap file on the root file system. The block size you specify should be less than the available memory on the instance or you receive a "memory exhausted" error.

I had success setting the swap file to 1 GB (128 MB x 8):

$ sudo dd if=/dev/zero of=/swapfile bs=128M count=8

Update the read and write permissions for the swap file:

$ sudo chmod 600 /swapfile

Set up a Linux swap area:

$ sudo mkswap /swapfile

Make the swap file available for immediate use by adding the swap file to swap space:

$ sudo swapon /swapfile

Verify that the procedure was successful:

$ sudo swapon -s

My results look like so:

Filename                                Type            Size    Used    Priority

/swapfile                               file            1048572 90880   -2

Start the swap file at boot time by editing the /etc/fstab file.

$ sudo nano /etc/fstab

Add the following new line at the end of the file, save the file, and then exit:

/swapfile swap swap defaults 0 0



Thursday, September 07, 2023

CUCM SQL DNs on device types

 Returns device type, device name, associated DNs, etc. where DNs are 1+10 digit format. 

run sql SELECT TypeModel.Name, Device.Name, Device.Description,  DeviceNumPlanMap.Display, NumPlan.DNOrPattern,  DeviceNumPlanMap.NumPlanIndex,  CallingSearchSpace.Name  FROM NumPlan  INNER JOIN TypeModel INNER JOIN Device ON TypeModel.Enum =  Device.tkModel INNER JOIN DeviceNumPlanMap ON Device.pkid =  DeviceNumPlanMap.fkDevice ON NumPlan.pkid = DeviceNumPlanMap.fkNumPlan  INNER JOIN CallingSearchSpace ON  NumPlan.fkCallingSearchSpace_SharedLineAppear = CallingSearchSpace.pkid  INNER JOIN RoutePartition ON NumPlan.fkRoutePartition =  RoutePartition.pkid where dnorpattern like '1%' and length(dnorpattern) = 11 ORDER BY NumPlan.DNOrPattern

Wednesday, July 19, 2023

CUCM SQL device and owner ID where LDAP integrated

 Returns a list of physical devices that are owned by a LDAP integrated user

run sql SELECT device.name, enduser.userid FROM device LEFT JOIN enduser ON device.fkenduser = enduser.pkid where device.name like "SEP%" and enduser.fkdirectorypluginconfig is not null