.. _run-dni-audit-tool:

Number inventory audit
----------------------------

.. _21.3-PB1|VOSS-1072|EKB-12743:
.. _21.4-PB2|VOSS-1234:
.. _24.2|EKB-18791:
.. _25.3|EKB-25937:


.. tip:: 

   :ref:`use-action-search-to-navigate-automate`



Overview 
............. 

.. index:: Flowchart;Audit Number Inventory

The Number Inventory Audit tool provides the ability to perform an audit of the number inventory 
to ensure that the *status* and *usage* 
values of each number aligns to the devices or services configured with these matching numbers.

Numbers that are in a *Cooling* or *Reserved* state are included in the audit: 

* If the audit finds that these numbers are unused, they are left in a *Cooling* or *Reserved* state. 
* If the audit finds that any of these numbers are used - an admin may have manually updated a user in 
  MS Teams to assign the number - then the number's status is changed to a state that 
  indicates they're in use, to *Used* or *Used-Utility* for example, and they're associated with the 
  correct user.


.. note:: 
  
   * For more information about the values for Status and Usage, see :ref:`concepts-number-status-usage`. 
   * For vendor-specific audit details, see :ref:`number-inventory-vendor-specific-guidance`.
   * You can only run the number inventory audit for customers that have number management enabled. See 
     *Create and Modify a Customer*. 
   * You can view the list of internal numbers, and move, delete, and export them as required, on the **Number 
     Inventory** list view. 


For Microsoft environments, available numbers are added (else updated if present)
to the inventory, with:

* Status: Available
* Vendor: Microsoft
* Number type: Operator Connect or Calling Plan

.. note:: 
  
   For details, see: :ref:`number-audit-process-ms`

The audit creates new numbers for devices or services that don't already exist, and updates existing 
number entries so that the **Status** and **Usage** fields display accurate information at the time 
the audit is run. Importantly, number entries are *not* deleted. 


.. uml::
 
   @startuml
   'Audit Number Inventory Flowchart
   !include style.iuml

   start
   while (Number Management enabled for customer? [default] ) is (No)
     :[[../src/user/create-customer.html Enable Number Management]];
   endwhile (Yes)
   :Choose Audit Number Inventory option;
   note right
     Options: 
     * Customer (not available for customers with Site Location Code-based dial plans)
     * Site

   end note
   :Save;
   stop
   @enduml


.. rubric:: Related topics 

* 
  .. raw:: latex

     Prevent duplicate numbers in the Core Feature Guide

  .. raw:: html
  
     <a href="prevent-duplicate-numbers.html">Prevent duplicate numbers</a> 



Number inventory audit and hierarchies 
...........................................

The table describes the difference between running a number audit inventory at the customer level 
compared to the site level: 

.. tabularcolumns:: |p{4cm}|p{11cm}|

====================== =================================================================================
Customer               * Running the number inventory audit at *customer* level adds directory 
                         numbers at the customer level for services that exist at *site* or *customer* 
                         level, provided that there is not already a directory number for that service 
                         at *site* level. 
                         
                         If there are already directory numbers at the *site* level, then those numbers 
                         are also updated. 
                         
                         This is a mixed mode of audit, which audits directory numbers at both *customer* 
                         and *site* level. For example, if directory numbers only exist at *customer* level, 
                         then the audit only adds and updates directory numbers that exist at the *customer*. 

                         If there are directory numbers at *site* level, the audit will still add new 
                         directory numbers at the *customer* level, but will also update the existing 
                         directory numbers at *site* level.

Site                   * Running the number inventory audit at *site* level adds directory numbers at 
                         *site* level, and updates any existing directory numbers at *site* level only. 
                         No *customer* level directory numbers will be audited and no directory numbers 
                         will be added to *customer* level for *customer* level services.

                       * You can choose to audit either *all* the *sites* for the *customer*, or selected 
                         *sites* 
====================== =================================================================================

.. note:: 

   For sites using *Site Location Code-based* dial plans, number inventories can be created only at the 
   *site* hierarchy. The *customer* hierarchy won't be available.




Audit number inventory troubleshooting
.........................................

The table describes common errors and steps to resolve, when running *audit number inventory*: 


.. tabularcolumns:: |p{7cm}|p{8cm}|

+---------------------------+--------------------------------------------------------------------------------+
| Error                     | Resolution                                                                     |
+===========================+================================================================================+
| Duplicate device profiles | Ensure that device profiles are not duplicated across the sites.               |
| (same profile name) in    |                                                                                |
| different clusters        |                                                                                |
+---------------------------+--------------------------------------------------------------------------------+
| Duplicate phones (same    | Ensure that phones are not duplicated across the clusters.                     |
| MAC) in different         |                                                                                |
| clusters                  |                                                                                |
+---------------------------+--------------------------------------------------------------------------------+
| Same internal number in   | Ensure that internal numbers (even in different partitions) are not duplicated |
| one or more clusters      | across clusters.                                                               |
+---------------------------+--------------------------------------------------------------------------------+


.. rubric:: Related topics 

* 
  .. raw:: latex

     Prevent duplicate numbers in the Core Feature Guide

  .. raw:: html
  
     <a href="prevent-duplicate-numbers.html">Prevent duplicate numbers</a> 



Run a number inventory audit 
..................................

This procedure runs a number inventory audit.

1. Log in to the Automate Admin Portal as a provider or reseller administrator.
#. Select the relevant *Customer* hierarchy level. 

   .. note::

      You can only run **Audit Number Inventory** from a customer hierarchy. If you try to run it from a 
      hierarchy that is not of type Customer, you will be prompted to choose a valid customer hierarchy.

#. Go to **Audit Number Inventory**. 
#. From the **Is Number Inventory deployed at Customer or Site Level** drop-down, select an option, either 
   of the following: 

   * If your number inventory is deployed at customer level, select **Customer**, then click **Save** to 
     run the audit number inventory at all sites at the selected customer.

   * If your number inventory is deployed at site level, choose **Site**, then, at 
     **Would you like to audit all sites or a subset of sites**, select an option: 
     
     * Select **All** to run audit number inventory at all sites at the selected customer. 
     * Select **Specific** to choose the sites where you want to audit the number inventory, then 
       select sites, one or more (maximum 200), from **Available** to **Selected** in the transfer box.  

       .. note:: 

          The number of sites you have in your environment may exceed the number of sites displayed in the 
          transfer box. You can use a *contains* search to filter the list for the 
          sites you want to include in the number inventory audit. 
     
     Click **Save** to run audit number inventory. 

#. View transaction progress. The number inventory is updated at the hierarchy you specified, and below.

