.. _ms-custom-dialplan-models:


Microsoft dial plan models
----------------------------


.. _21.4-PB1|VOSS-1124:
.. _21.4-PB3|VOSS-1271:
.. _21.4-PB4|EKB-17077:


Overview 
..........

Automate supports the ability to predefine dial plan templates for Microsoft data models, and to push 
the dial plans, on-demand, for a specific customer or site. 



.. rubric:: Microsoft dial plan models workflow 

To use this feature: 

1. Ensure you have the **Dial Plan Management Tool** menus exposed in the Admin Portal:

   * In the Global Settings, ensure **Enforce HCS Dialplan Rules** is set to *No*. 
   * Log in with an access profile that has permissions to the **Dial Plan Management Tool** menus.

   .. note:: 
      
      * The **Dial Plan Input Data** menu is relevant only for Cisco dial plans.
      * For Microsoft dial plans, include the Microsoft Dial Plan Models menu and Microsoft models in your menu layout. 

2. :ref:`ms-create-dialplan-name` 
3. :ref:`ms-create-data-models`
4. :ref:`ms-preview-dialplan`
5. :ref:`ms-push-dialplan`


The following Microsoft data models and corresponding device models 
(Microsoft dial plan elements) are supported:

.. tabularcolumns:: |p{10cm}|p{5cm}|

+-------------------------------------------------+--------------------------------+
|  Device Model                                   | Menu                           |
+=================================================+================================+
| device/msteamsonline/CsTenantDialplan           | Tenant Dialplan                |
+-------------------------------------------------+--------------------------------+
| device/msteamsonline/CsOnlinePstnGateway        | SBC Gateways                   |
+-------------------------------------------------+--------------------------------+
| device/msteamsonline/CsOnlinePstnUsage          | PSTN Usages                    |
+-------------------------------------------------+--------------------------------+
| device/msteamsonline/CsOnlineVoiceRoute         | Voice Routes                   |
+-------------------------------------------------+--------------------------------+
| device/msteamsonline/CsOnlineVoiceRoutingPolicy | Voice Routing Policies         |
+-------------------------------------------------+--------------------------------+
| device/msteamsonline/CsTeamsTranslationRule     | Translation Rules              |
+-------------------------------------------------+--------------------------------+



Additional Microsoft device models have been added to offer providers a one-step in the customer onboarding process: pushing provider-specific
dial plan elements as well as Teams polices to the customer's tenant.

The following Microsoft device models are supported. The equivalent data models
have names that match the device model name as follows:

``DP_msteamsonline_<device model name>``

For example, ``DP_msteamsonline_CsOnlineVoicemailPolicy``.  

.. tabularcolumns:: |p{10cm}|p{5cm}|

+--------------------------------------------------------+-----------------------------------+
|  Device Model                                          | Menu                              |
+========================================================+===================================+
| device/msteamsonline/CsCallingLineIdentity             | Calling Line Identity [#]_        |
+--------------------------------------------------------+-----------------------------------+
| device/msteamsonline/CsOnlineVoicemailPolicy           | Online Voicemail Policies         |
+--------------------------------------------------------+-----------------------------------+
| device/msteamsonline/CsTeamsCallingPolicy              | Calling Policies                  |
+--------------------------------------------------------+-----------------------------------+
| device/msteamsonline/CsTeamsCallParkPolicy             | Call Park Policies                |
+--------------------------------------------------------+-----------------------------------+
| device/msteamsonline/CsTeamsEmergencyCallingPolicy     | Emergency Calling Policies        |
+--------------------------------------------------------+-----------------------------------+
| device/msteamsonline/CsTeamsEmergencyCallRoutingPolicy | Emergency Call Routing Policies   |
+--------------------------------------------------------+-----------------------------------+
| device/msteamsonline/CsTeamsEnhancedEncryptionPolicy   | Enhanced Encryption Policies      |
+--------------------------------------------------------+-----------------------------------+


.. [#] When adding an instance by creating a data model (:ref:`ms-create-data-models`)
   and if **Calling ID Substitute** is set to ``Resource Account``,
   a Resource Account which has a number can be selected. 
  
   The **Calling Party Name** is also visible and can be configured.



.. rubric:: Related topics

* :ref:`nextgen-dialplan-overview`
* :ref:`nextgen-dialplan-menu-items`
* :ref:`nextgen-dialplan-viewer`
* :ref:`concepts-nextgen-dialplan-maintenance`
* :ref:`cisco-custom-dialplan-models`



.. _ms-create-dialplan-name:

Create the dial plan name
..............................

1. Go to **Dial Plan**. 

.. image:: /src/images/ms-dialplans-list.png

2. Click **Add**. 
3. Fill out a dial plan name, and a description. 
4. At **Dial Plan Type**, choose an option, either Global, Site, or Multi-tenant / Shared Architecture.

.. image:: /src/images/ms-dialplans.png 

5. Save. 
6. Next steps: Create the data models, with their data. 

   .. image:: /src/images/ms-dialplan-voice-routing-policies-model-data.png 



.. _ms-create-data-models:

Create data models
......................... 

Once you have a dial plan name you can create the data models with data in them. 

1. Go to **Dial Plan Management Tool > Microsoft Dial Plan Models**. 
2. Click on the relevant model.
3. Click **Add**.  
4. Fill out data for the model: 

   * Choose the dial plan name. 
   * Configure data for the model. 

     .. note:: 

        You can also use macros to add values in some fields.  

   .. image:: /src/images/ms-dialplan-model-sbc-gateways-data.png 

5. Save. 
   
   The details you provided goes to the data model. 

6. Next steps: Repeat this procedure to fill out data for any other models (if required) to build out your dial plan, then 
   preview the dial plan you configured. 


.. _ms-preview-dialplan:

Preview a configured dial plan 
................................

You can preview dial plans via the **Dial Plan Viewer**, which provides a 
read-only view of all data model entries added to a selected dial plan name. 

.. note:: 

   The Dial Plan Viewer displays read-only data. You cannot add or update any model entries 
   via the Dial Plan Viewer. You can modify your data entries via the menus, then return to the 
   viewer to see your changes, if required. 

If you have data model entries added to a dial plan name for both Cisco and Microsoft dial plan models, 
these are all accessible for inspection in the tabs of the Dial Plan Viewer. 


.. image:: /src/images/ms-dialplan-viewer-dial-plan.png 


1. Go to **Dial Plan Management Tool > Dial Plan Viewer**. 

2. In the **Dial Plan Viewer** summary list, click on the relevant dial plan name. 

   .. image:: /src/images/ms-dialplan-viewer-list.png 

3. The tabs of the **Dial Plan Viewer** display the data for each data model entry created for the 
   selected dial plan name. 

   .. note:: 

      A dial plan can contain entries for both Cisco and Microsoft dial plan models, allowing you to 
      push dial plans to both CUCM clusters and to the Microsoft tenant (for Microsoft Teams).

   .. image:: /src/images/ms-dialplan-models-tenant-dialplan.png

4. Next steps: Push the dial plan, to a customer or to a site.



.. _ms-push-dialplan:

Push a dial plan to customer or site 
.........................................


The Dial Plan Management Tool can push dial plan data to a customer or to a site, to the Microsoft tenant and to 
CUCM clusters, depending on the hierarchy where you created the dial plan, and 
on the data model entries included in your dial plan.

.. important:: 
   
   If your dial plan is configured at a specific customer hierarchy, you'll need to push it from that hierarchy. 
   If a dial plan is added at a site, it must be pushed to the site at that hierarchy.  



1. Choose the hierarchy where you added your dial plan (a customer or site). 
2. Go to **Dial Plan Management Tool > Dial Plan Maintenance**.
3. At **Dial Plan Name**, select the name of the dial plan you wish to push to the site or customer. 

   .. note:: 

      The **Dial Plan Name** drop-down lists dial plan names added to the current hierarchy. 

      .. image:: /src/images/ms-dialplan-dialplan-maintenance.png 

4. From **Target Call Manager Cluster** and **Target Microsoft Tenant**, choose the relevant 
   target destination for the dial plan, either a CUCM cluster or a Microsoft tenant, or both, provided 
   you have these added to your system.

5. From the **Operation** drop-down, choose an option, either **Push Dial Plan** or **Remove Dial Plan**. 
   To push your dial plan, select **Push Dial Plan**.

6. Click **Save**. 

   The relevant workflows are triggered to determine the content of the dial plan you defined. The dial plan 
   data is pushed to the target (CUCM cluster or Microsoft tenant, as applicable). 

   For Microsoft, the dial plans are added to the Microsoft Tenant in Automate (accessible via the default 
   menus as **MS Teams Dial Plan Management > Tenant Dialplan**), and the dial plan details 
   are also updated to the Microsoft Teams cloud portal.




