GlpiSimcards » History » Version 37

« Previous - Version 37/44 (diff) - Next » - Current version
ricky_ds, 03/20/2012 09:26 AM


Simcards management in GLPI

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!
pin2 code
puk code http://en.wikipedia.org/wiki/Personal_unblocking_code
puk2 code
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 : itemtype will be used in glpi_computers_items
  • a peripheral : a 3G key for example
  • a phone

We can factorize glpi_computers_items in CommonDBRelation in order to manage peripheral and phone connections too

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', '');

To link simcard to peripherals and networkequipements.

CREATE TABLE IF NOT EXISTS `glpi_peripherals_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `items_id` int(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to various table, according to itemtype (ID)',
  `peripherals_id` int(11) NOT NULL DEFAULT '0',
  `itemtype` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `computers_id` (`peripherals_id`),
  KEY `item` (`itemtype`,`items_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `glpi_phones_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `items_id` int(11) NOT NULL DEFAULT '0' COMMENT 'RELATION to various table, according to itemtype (ID)',
  `phones_id` int(11) NOT NULL DEFAULT '0',
  `itemtype` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `phones_id` (`phones_id`),
  KEY `item` (`itemtype`,`items_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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>