suppose you have to monitor interfaces on a phone switch. it has two interfaces, one for incoming calls, one for outgoing. you have a computer connected to the switch, and you can run software to monitor the interfaces, to see what sort of events are occurring. the software produces a log file in this format:
Code: Select all
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!! !!!!
!!!! Cisco Packet Telephony Center Monitoring and Troubleshooting Tool (PTC-MT) !!!!
!!!! !!!!
!!!! The software is for use only by or under the direct supervision of !!!!
!!!! authorized personnel or an authorized agent of Cisco Systems, Inc. If you !!!!
!!!! are not an authorized Cisco agent or are not using the software under the !!!!
!!!! direct supervision of a Cisco agent, Cisco grants you no right or license to !!!!
!!!! this software, and you must immediately terminate your use of the software !!!!
!!!! and delete or return the software to Cisco. By continuing to use the !!!!
!!!! software, you represent that you are an agent of Cisco or that you are under !!!!
!!!! the direct supervision of an agent of Cisco authorized to use this !!!!
!!!! software. !!!!
!!!! !!!!
!!!! Please wait a little.... PTC-MT will start in less than 5 seconds. !!!!
!!!! !!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
**********************************************************
* 07 PTC-MT WARNING: Profile file "master.cfg" not found *
**********************************************************
********************************************************
* 07 PTC-MT WARNING: Profile file "user.cfg" not found *
********************************************************
*************************************************************
* 07 PTC-MT WARNING: Profile file "exception.cfg" not found *
*************************************************************
***************************************************************
* 03 PTC-MT INFO: PTC-MT is listening on interface "bge1".... *
***************************************************************
----------------------
SS7 MESSAGES DISPLAY
----------------------
Ser
Time stamp OPC DPC Var Ind. Msg Data
-------------------------------------------------------------------------------------------------------
First packet received - 03/06/2007
13:05:48.987595 0-041-2[00330] 0-048-5[00389] ITU ISUP. -> ACM (06) CIC=00015
SLS=15 Pr:0 Ni:NTL
13:05:49.127631 0-042-4[00340] 0-048-5[00389] ITU ISUP. -> RLC (10) CIC=00035
SLS=03 Pr:0 Ni:NTL
13:05:49.225719 0-041-2[00330] 0-048-5[00389] ITU ISUP. -> IAM (01) CIC=00055 CDPN=0560311324F REDIRECTING=569102813
SLS=07 Pr:0 Ni:NTL CGPN=563863936
13:05:49.245555 0-048-5[00389] 0-041-2[00330] ITU ISUP. -> CFN (2f) CIC=00055
SLS=07 Pr:0 Ni:NTL
13:05:49.315770 0-048-5[00389] 0-041-2[00330] ITU ISUP. -> ACM (06) CIC=00055
SLS=07 Pr:0 Ni:NTL
13:05:49.335440 0-048-5[00389] 0-041-2[00330] ITU ISUP. -> CPG (2c) CIC=00055 EVENT=Alerting
SLS=07 Pr:0 Ni:NTL
13:05:49.473668 0-063-1[00505] 0-048-5[00389] ITU ISUP. -> IAM (01) CIC=00500 CDPN=141499912F CGPN=569871451
SLS=04 Pr:0 Ni:NTL
13:05:49.552544 0-042-4[00340] 0-048-5[00389] ITU ISUP. -> REL (0c) CIC=00211 Cause 16 = Normal Call Clearing
SLS=03 Pr:0 Ni:NTL
13:05:49.565458 0-048-5[00389] 0-042-4[00340] ITU ISUP. -> RLC (10) CIC=00206
SLS=14 Pr:0 Ni:NTL
13:05:49.854074 0-041-2[00330] 0-048-5[00389] ITU ISUP. -> CPG (2c) CIC=00015 EVENT=Alerting
SLS=15 Pr:0 Ni:NTL
13:05:50.394305 0-037-6[00302] 0-048-5[00389] ITU SNM.. -> RST (15) PC=0-050-7[00407]
Pr:0 Ni:NTL
13:05:50.446115 0-042-4[00340] 0-048-5[00389] ITU ISUP. -> IAM (01) CIC=00035 CDPN=141499911F CGPN=568550740
SLS=03 Pr:0 Ni:NTL
13:05:50.492999 0-063-1[00505] 0-048-5[00389] ITU ISUP. -> IAM (01) CIC=00657 CDPN=141499921F CGPN=560371114
SLS=01 Pr:0 Ni:NTL
your task is to merge two files that look like the above file. if file1 looks like
Code: Select all
13:05:48.987595 0-041-2[00330] 0-048-5[00389] ITU ISUP. -> ACM (06) CIC=00015
SLS=15 Pr:0 Ni:NTL
13:05:49.127631 0-042-4[00340] 0-048-5[00389] ITU ISUP. -> RLC (10) CIC=00035
SLS=03 Pr:0 Ni:NTL
13:05:49.225719 0-041-2[00330] 0-048-5[00389] ITU ISUP. -> IAM (01) CIC=00055 CDPN=0560311324F REDIRECTING=569102813
SLS=07 Pr:0 Ni:NTL CGPN=563863936
Code: Select all
13:05:48.954074 0-041-2[00330] 0-048-5[00389] ITU ISUP. -> CPG (2c) CIC=00015 EVENT=Alerting
SLS=15 Pr:0 Ni:NTL
13:05:49.114305 0-037-6[00302] 0-048-5[00389] ITU SNM.. -> RST (15) PC=0-050-7[00407]
Pr:0 Ni:NTL
13:05:49.246115 0-042-4[00340] 0-048-5[00389] ITU ISUP. -> IAM (01) CIC=00035 CDPN=141499911F CGPN=568550740
SLS=03 Pr:0 Ni:NTL
Code: Select all
13:05:48.954074 0-041-2[00330] 0-048-5[00389] ITU ISUP. -> CPG (2c) CIC=00015 EVENT=Alerting
SLS=15 Pr:0 Ni:NTL
13:05:48.987595 0-041-2[00330] 0-048-5[00389] ITU ISUP. -> ACM (06) CIC=00015
SLS=15 Pr:0 Ni:NTL
13:05:49.114305 0-037-6[00302] 0-048-5[00389] ITU SNM.. -> RST (15) PC=0-050-7[00407]
Pr:0 Ni:NTL
13:05:49.127631 0-042-4[00340] 0-048-5[00389] ITU ISUP. -> RLC (10) CIC=00035
SLS=03 Pr:0 Ni:NTL
13:05:49.225719 0-041-2[00330] 0-048-5[00389] ITU ISUP. -> IAM (01) CIC=00055 CDPN=0560311324F REDIRECTING=569102813
SLS=07 Pr:0 Ni:NTL CGPN=563863936
13:05:49.246115 0-042-4[00340] 0-048-5[00389] ITU ISUP. -> IAM (01) CIC=00035 CDPN=141499911F CGPN=568550740
SLS=03 Pr:0 Ni:NTL