TSP Lab The IMSI-IMEI Database Handler module SgaICDB

The IMSI-IMEI Database Handler module
("SgaICDB")

Table of Contents

Features

User interface

The main menu

Menu Menuitem Shortcut(s) Meaning
[Log]
  Details   Detail level of logging (Off, Normal, Detailed, or Debug)
  Find line containing... (Ctrl-F) Finds text in log window
  Find next matching line (F3) Finds next occurrence of text in log window
  Auto scroll () Allow automatic scrolling of the log screen
[Actions]
  Go on / Pause (Ctrl-P or ) Starts or pauses the processing of the Sga-8004 files.
  Re-enter client password   The password used for client authentication can be re-entered
  Flush status line counters now!   The status line counters can be flushed
  Flush & zero status line counters now!   The status line counters can be flushed and cleared, too
  Save IMSI-IMEI record pairs   Dumps in-memory records into a backup file
  Drop old IMSI-IMEI record pairs   Deletes old record pairs
  DEBUG: Drop very old IMSI-IMEI record pairs   Not available!
  DEBUG: List IMSI-IMEI record pairs (max. 100)   Dumps at most 100 records pairs into the log screen / log file
  Load an 'Sga-8999.zip' file   Loads IMSI-IMEI pair information from an 'Sga-8999.zip' file
  Save settings   Save current GUI settings into the configuration (INI) file

The bottom status-line

The Database

Database structure

There are two different entry types in the database: The database has the following structure:

Deletion strategy

The deletion process goes through the indexes and checks all the records for each index. A record will be deleted when the last seen timestamp of it is older than the setting value (dwRecordpairMinLifeSec) AND An index will be deleted when the last record of it is deleted.

When dwHomeRecordpairLifeSec >= dwRecordpairMinLifeSec then roamers will be deleted from the database after dwRecordpairMinLifeSec and local subscribers will deleted after dwHomeRecordpairLifeSec.
When dwHomeRecordpairLifeSec < dwRecordpairMinLifeSec then dwRecordpairMinLifeSec applies for both types of subscibers.

Note: Deletion process is being executed once a day.

The SIM card - mobile phone assignment monitoring function ("Sga-BV")

Details of this function can be read in the main page.

The function is active when INI/[Sga-BV]/bUseSgaBVDBdll = True.

The "Sga-BV" function related configuration files

"Alarm2" IMEI list

This list contains the list of IMEIs allowed to use by the specified MSISDNs. Each entry contains a IMEI and a text comment, separated by a space or a tabulator character. IMEIs must be 15-digit long (optionally tailed by an 'F' character), otherwise an error (red) line will be appear in the log.
The path of IMEI list file is defined by the INI/[Sga-BV]/sAlarm2listPath configuration entry. The file name format for IMEI-List: "BV-IMEIs_YYYY-MM-DD_HH-MI-SS.txt". The program loads the last one by name. The file checking period can be defined, and there can be a delay time, as well.

Some example entries:

	357888067626220	example1
	35630111111111	short IMEI
	356302222222222 example2
	358678901234560F example3 with a tailing 'F'

"Alarm2" IMSI white list

This list contains a list of IMSIs identifying SIM cards excluded from the IMSI-IMEI assignment monitoring function so there should not be alarmed when these SIM cards are used by the specified IMEIs.
The format of entries of this list is an IMSI and a text comment, separated by a space or a tabulator character. Each IMSI must be 15-digit long, otherwise an error (red) line will be appear in the log.
The path of the IMSI white list file is defined by the INI/[Sga-BV]/sAlarm2listPath configuration entry. The file name format for IMSI-WhiteList: "BV-WhiteIMSIs_YYYY-MM-DD_HH-MI-SS.txt". The program loads the last one by name. The file checking period can be defined, and there can be a delay time, as well.

Some example entries:

	216309012340991	// szerviz-SIM #1
	216309012340992	// szerviz-SIM #2
	21630111111111	too short IMSI
	2163022222222222 too long IMSI

Report files

"Alarm1" files

Each row in these files contains an event when a SIM card was moved to a different mobile equipment than previously seen.
Observed SIM cards are defined by their MSISDNs set in the Sga-BV_IMSISDN-DB.ini configuration file.
One file is generated for every single day.

Content of the report:

The location of "Alarm1" report files is defined by the INI/[Sga-BV]/sAlarm1filesPath configuration entry.

"Alarm2" files

Each row in these files contains an event when a SIM card which is not part of a predefined range was put into a mobile equipment which belongs to "Alarm2 IMEI list". The SIM ranges are defined by the MSISDNs set in the Sga-BV_IMSISDN-DB.ini configuration file.
The IMEI list is defined by the "Alarm2" IMEI list.
SIM card exceptions can be defined by the "Alarm2" IMSI white list.
One file is generated for every single day.

Content of the report:

The location of "Alarm2" report files is defined by the INI/[Sga-BV]/sAlarm2filesPath configuration entry.

Logging

The module creates daily logfiles about its operation. The name of the logfile is "modulename_YYYYMMDD.log", reflecting the day when it is created.
The module can write information into the logfile and onto the screen at various detail levels, set by the [Log]/Details menu item. The logging level can be: Status line counters are logged in every fifteen minutes irrespectively of logging level actually set.

The color coding of the log lines have the following meaning:

Code Color Usage
0 Black Compact data record
1 Red Errors
2 Green Open/close output file/stream
3 Blue Open/close input file/stream
4 Yellow Warnings
5 Light Detailed data (debug info)
6 Dark Grey Detailed data (user info)
7 Purple Operator intervention;
Errors with emphasis

Configuration (Sga-IMSIMSISDNDB_Loader.ini) file settings

Section Entry Example Meaning
[Position]
  iLeft 140 Position of the program module on the display screen
  iTop 72 Position of the program module on the display screen
  iWidth 995 Position of the program module on the display screen
  iHeight 694 Position of the program module on the display screen
[Options]
  bAutoScroll True (Refer to the corresponding menu item!)
[Sga-BV]
  bUseSgaBVDBdll True If true then the Sga-BV function is active
  sAlarm1filesPath d:\Alarm1Files\ Path for "Alarm1" files
  sAlarm2filesPath d:\Alarm2Files\ Path for "Alarm2" files
  dwAlarm2listDelayedLoadingSec 3 Delay time for loading input files
  dwAlarm2listSleepBetweenSubsequentCheckingSec 3 Input files checking period
  sAlarm2listPath e:\Sga-BV\ Location of the IMEI list and the IMSI white list files
[BV-email Settings]
  sOutputMailDirectory f:\Sga-MailSend\ToSend Defines the folder where the email files are being saved to be processed by the email sender application
  sEmailField_sReplyTo john.doe@server.com Defines the "ReplyTo" field
  sEmailField_Subject Az "Sga-BV" rendszer riasztásai Defines the subject of the email
  sEmailField_To_N jsmith@company.com Defines the Nth "To" address
  sEmailField_CC_N mack.stout@outlook.com Defines the Nth "BCC" address
  sEmailField_BCC_N reean.hogan@msn.com Defines the Nth "BCC" address
[BV-email Body Text] In this section the body of the email can be defined as a free text in any number of lines
  Kedves Cím!
_
Az előzetesen megadott MSISDN tartományokra, valamint IMEI számokra vonatkozó riasztási listákat tartalmazza a levél. Maximálisan 2db csatolmányt tartalmazhat, de amennyiben az előző 24 naptári órában nem történt riasztási esemény, akkor a vonatkozó csatolmány nem kerül elküldésre.
_
_
Üdvözlettel,
SGA group
[Advanced]
  wLogDetailLevel 3 (Equals to the listed order; refer to the corresponding menu item!)
  sClientPassword xxx Password used during query client authentication.
When it is not set then a pop-up window will appear to enter a password when the module starts
  wMaxCPUUsagePercent 90 Maximum CPU usage in percent
  dwMaxLinesInLogWindow 1000 Number of lines in the log window on screen
  XXXX IMSI Defines the type of the index for the actual module. Possible values: "IMSI" or "IMEI"
  dwXXXXcountMax 3500000 Defines the maximum amount of indexes
  dwRecordpairMaxCount 3500000 Defines the maximum amount of IMSI-IMEI records pairs
  dwRecordpairMinLifeSec 31536000 Life time for IMSI-IMEI record pairs
  dwHomeRecordpairLifeSec 31539600 Life time for local IMSI-IMEI record pairs
  wLocalTCPport 7101 TCP port for the incoming connections
  sLogFilesPath d:\LogFiles Path of the LOG files.
  sBackupFilesPath d:\Backup_ICDB Path for the saving of the content of the database in case of module exit
[Exclude list] This section can contain a list of IMSI's or IMEI's (depends on the value of [Advanced]/XXXX) exlcuded from collecting then in the database.
A maximum of 100 entries is possible
  216301234567890F any comment Equal sign and comment are optional, not required

Version history