GlpiSimcards » History » Version 43

« Previous - Version 43/44 (diff) - Next » - Current version
ricky_ds, 03/22/2012 02:48 PM


Simcards management in GLPI

This feature is linked to tickets #498 #230

Functionnalities

Field comment
telephone number The phone number : the identifier for the provider
data number the number used for data exchange
fax number
imsi subscribers id (serial)
internal state interesting to know if simcard is locked on not (for Android there's a fixed list here : http://developer.android.com/reference/android/telephony/TelephonyManager.html#getPhoneType%28%29)
state status in GLPI (different from internal state)
size full-size, mini-sim, micro-sim
voltage Might be 1.8, 3.5 or 5V. It's important because 3G modems not compatible with all voltages. For example this modem (http://www.abix.fr/modem-gsm-gprs-edge-sans-fil-format-cle-usb-sans-abonnement,article,308350.html) supports only 3v simcards
username a GLPI user
tech in charge a GLPI user
inventory number
group a GLPI group
group in charge a GLPI group
pin code PIN code is personal. It can be modified by using the PUK code, so no need to store it!
puk code http://en.wikipedia.org/wiki/Personal_unblocking_code
pin2 code PIN2 is needed in some countries to activate or deactivate some services with the service provider. If the IT department manages these service activations, the user doesn't get in contact with PIN2 and doesn't need to change it
puk2 code is needed in case PIN2 has been entered 3 times wrong or for changing PIN2
provider
country how to store it ? it means a table in GLPI with all countries. Do we really need it ?
A simcard can have :
  • financial informations
  • contracts
  • documents
  • history
  • tickets

PUK code

The PUC (PUK) is a SIM-specific code assigned by the service provider. It is near-impossible to guess and enter it; thus, if a user does not know his or her PUC and is prompted for it, it should be obtained from the service provider.

PUK code is higly sensitive, as it allows to reset PIN code. I suggest that this information should only be available for user with right "simcard", "w".

Objects

Simcard

Create a new Simcard objet is mandatory

class Simcard extends CommonDBTM {}

_items table factorization

A Simcard can be connected to :
  • a computer
  • a peripheral : a 3G key for example
  • a phone

To achieve it, it's mandatory to improve direct connections, as described in this page Extend_Direct_Connections

Database

  • Add a new right "simcard" in glpi_profiles
  • Add new option in glpi_transfers
CREATE TABLE IF NOT EXISTS `glpi_simcards` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `entities_id` int(11) NOT NULL DEFAULT '0',
  `phonenumber` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `imsi` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `puk` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `otherserial` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `states_id` int(11) NOT NULL DEFAULT '0',
  `locations_id` int(11) NOT NULL DEFAULT '0',
  `users_id` int(11) NOT NULL DEFAULT '0',
  `users_id_tech` int(11) NOT NULL DEFAULT '0',
  `groups_id` int(11) NOT NULL DEFAULT '0',
  `groups_id_tech` int(11) NOT NULL DEFAULT '0',
  `phoneoperators_id` int(11) NOT NULL DEFAULT '0',
  `simcarsizes_id` int(11) NOT NULL DEFAULT '0', //(SIM, MicroSIM, etc)
  `comment` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `date_mod` datetime DEFAULT NULL,
  `is_global` tinyint(1) NOT NULL DEFAULT '0',
  `is_deleted` tinyint(1) NOT NULL DEFAULT '0',
  `is_template` tinyint(1) NOT NULL DEFAULT '0',
  `template_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `notepad` longtext COLLATE utf8_unicode_ci,
  `ticket_tco` decimal(20,4) DEFAULT '0.0000',
  PRIMARY KEY (`id`),
  KEY `name` (`name`),
  KEY `entities_id` (`entities_id`),
  KEY `states_id` (`simcardstates_id`),
  KEY `puk` (`puk`),
  KEY `imsi` (`imsi`),
  KEY `is_template` (`is_template`),
  KEY `is_global` (`is_global`),
  KEY `users_id` (`users_id`),
  KEY `users_id_tech` (`users_id_tech`),
  KEY `groups_id` (`groups_id`),
  KEY `groups_id_tech` (`groups_id_tech`),
  KEY `is_template` (`is_template`),
  KEY `is_global` (`is_global`),
  KEY `is_deleted` (`is_deleted`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ;
CREATE TABLE IF NOT EXISTS `glpi_phoneoperators` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `comment` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `name` (`name`),
  KEY `code` (`code`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ;
CREATE TABLE IF NOT EXISTS `glpi_simcardstates` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `comment` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `name` (`name`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE IF NOT EXISTS `glpi_simcardsizes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `comment` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `name` (`name`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

INSERT INTO `glpi_simcardsizes` (`id`, `name`, `comment`) VALUES
(1, 'Full-SIM', ''),
(2, 'Micro-SIM', ''),
(3, 'Mini-SIM', '');

Things that needs to be discussed

  • should we display a PIN code field ? it's a dangerour information
    • Walid : I've decide not the include it for the moment
  • should we display the PUK code ? I've proposed to display it only if user have simcard, w right
    • Walid : if you have the puk code, then you can unlock a phone. We could think of a special right for simcard management that allows to view and see PIN & PUK
  • is it important to have a voltage field ? as described earlier, it allows to check 3G modem compatibility
  • what is the use of pincode 2 and puk code 2 ?
  • internal SIM state : I don't think we need it right now

Inventory examples

Here is an example of SIMCard inventory performed by FusionInventory :

<SIMCARDS>
      <COUNTRY>fr</COUNTRY>
      <OPERATOR_CODE>20820</OPERATOR_CODE>
      <OPERATOR_NAME>Bouygues Telecom</OPERATOR_NAME>
      <SERIAL>8933201710019924839</SERIAL>
      <STATE>SIM_STATE_READY</STATE>
      <SUBSCRIBER_ID>208201701929385</SUBSCRIBER_ID>
    </SIMCARDS>