.. _internal_number_inventory:

Internal Number Inventory
-------------------------

.. _19.3.1|VOSS-639:

Functionality is available to add, delete or modify a single directory number (DN)
or range of DNs for your site. The directory numbers can be selected when adding
new lines.

The Lines concept maps to ``device/cucm/Line`` and the Lines menu item under
Subscriber Management. A sync of ``device/cucm/Line`` from the UUnified CM will
result in various line types being brought in - including lines assigned to devices,
CTI devices, etc. - essentially anything that would be seen under Directory Numbers
in Unified CM.  

The number inventory can exist at a different level to the lines for users and
devices that consume the numbers. For example, Lines (``device/cucm/Line``) are
typically at the site level with the user, service or device they are on. However,
the inventory can exist at the customer level.

If the Internal Number Inventory (INI) feature has been enabled by an administrator,
lines are no longer added in the conventional sense of the word. They are instead
selected from an existing drop-down list of available numbers - from the INI.

The Internal Number Inventory is used to manage ranges of internal numbers
that are available for use at a hierarchy level. Additional fields are available
to provide further information on a range when listing the numbers. Administrators
are responsible for manually updating these fields.

It is recommended to run an Overbuild before adding numbers and ranges, so that
numbers in |Unified CM| are imported and marked as used.

Ranges can be created from a Start Number to an End Number and can be set to be 
available or in use. When a range is created, the list of numbers is shown on
the list view. Individual numbers can also be set to be Used or Available.

When a range is added that includes existing numbers, these will not be modified. 
The new unused numbers would be added only to complete the range. In other words, 
the range will show up as complete, with unused numbers in between numbers imported
from |Unified CM|.

When a line is added and selected from the drop-down list of available numbers,
it is marked as Used. If the line is used by a device or service that does not
allow a shared line (for example, a Hunt Pilot), then it is marked as not Available.

Number ranges can also be deleted. Numbers in the range that are in use or are
unavailable will be ignored and will not be deleted. If these are modified to be
available and not in use, they can also be deleted. The Used and Available status
of directory numbers can also be modified manually once they are added.

Deleted numbers, e.g. as a result of a subscriber or phone delete are automatically
placed into a cooling period for a predetermined amount of time as specified in
the :ref:`global-settings`. During this period the number is unavailable and
cannot be used, i.e. assigned to a subscriber, phone, device, etc. 

The **Cooling End Date** (yyyy-mm-dd) displays the date on which the cooling period
elapses, at which time the number becomes available in the list of available
numbers.

Numbers in the cooling period can also be manually removed from the cooling period,
and reintroduced into the list of available numbers. See also :ref:`number-management-cooling`.


.. note::

   * A number cooling auto expiry schedule runs daily. This schedule polls the
     **Cooling End Date** field on the number inventory list view to determine
     which numbers have completed their cooling period. These numbers are then
     returned to the list of available numbers at the specific hierarchy level. 
   
   * Number inventory is not partition or cluster aware.  If the same numbers are
     used multiple times but in different partitions, then these all map to the same
     inventory number.  This should be taken into account when thinking about the
     hierarchy level that the number inventory exists.

     Also, not being cluster aware, if the same number exists on different clusters,
     this again will map back to the same inventory value unless numbers are assigned
     to the site level.  

   * Since the inventory is not partition aware, if the same directory number is
     used on a cluster but in different partitions, then VOSS-4-UC workflows will
     update the inventory when *any* of those instances are changed - for instance,
     if there is a directory number 1111 in Cluster X partition and a directory
     number 1111 in Cluster Y partition, and the inventory entry is marked used.

     If one of those instances are deleted, we check to see if there are other
     instances of that line based on the number only (not partition), before
     clearing the "used" flag. In this case, the other instance will be found and
     the inventory will stay marked as "used".

     To summarize: an INI update will check all line numbers that match the INI
     value in different partitions. The update check therefore does *not* only
     check whether the INI value matches the Site Default Partition value. In
     other words, if the INI lookup finds any other instances that match the INI
     value (regardless of partition), it will not update the INI entry to be
     used=false, and will keep it in a used=true state.


The INI number range create procedure initially only creates the DN database in
|VOSS-4-UC|. In other words, the range of numbers are not passed on to |Unified CM|
until they are used.  


.. |VOSS-4-UC| replace:: VOSS-4-UC
.. |Unified CM| replace:: Unified CM