# Class of Service

**Class of services** define a **[route](https://public.intellasoft.net/books/cli/page/route)** to take when an **[Extension](https://public.intellasoft.net/books/cli/page/extensions) is placing a call. A **class of service** can contain multiple components to place a call through in order of a priority system. These are explained in greater detail below. **[Hunt Groups](https://public.intellasoft.net/books/web-portal-dL9/page/hunt-groups)** as well as **[PhoneMap Groups](https://public.intellasoft.net/books/web-portal-dL9/page/phonemap-groups)** also must have a class of service defined to function properly. Most systems will have default **classes of services** (as well as routes) however additional ones can be created in the CLI for more advanced routing configurations.

<div class="columnLayout single" data-layout="single" id="bkmrk-class-of-service%3A-a-"><div class="cell normal" data-type="normal"><div class="innerCell">- **Class of Service**: A Class of service can be defined to take another class of service
- **Route**: A Class of Service can take a route which takes a trunk group, and then in turn a trunk.
- **Phonegroup**: A class of service can directly call out to another **phonegroup**.
- **Literal**: ??

</div></div></div># Adding an Extension

1\) Enter the CLI's configuration mode

2\) Enter the name of the **Trunk Group** you wish to create. You will be prompted with the minimum required settings.

```
vbox-nathan(config)# cos billing_reroute
!! Notice: Editing new item: billing_reroute
!! Notice: Minimum requirements needed for insert:
!!   desc
vbox-nathan(config-cos billing_reroute)# desc "Rerouted calls to billing from specific extensions"
```

<div class="columnLayout single" data-layout="single" id="bkmrk-"><div class="cell normal" data-type="normal"><div class="innerCell"><div class="code panel pdl conf-macro output-block" data-hasbody="true" data-macro-name="code" style="border-width: 1px;"><div class="codeContent panelContent pdl"><div><div class="syntaxhighlighter sh-confluence nogutter  java" id="bkmrk-vbox-nathan%28config%29%23-1"></div></div></div></div></div></div></div>3\) After this you will need to define the **includes** that the **class of service** will take. This can be done with the following command which takes a number indicating the first **include** that the **class of service** will attempt to take.

```
vbox-nathan(config-cos billing_reroute)# cos_include 1         ### first include that the class of service will attempt to take 
vbox-nathan(config-cos billing_reroute pos-1)# include         ### use tab to get a list of the potential includes that a class of service can take, remember you are not limited to just routes
cos:internal               cos:internal+local         cos:internal+local+ld      cos:internal+local+ld+intl literal:catchall           literal:default            literal:services
phonegroup:Billing         phonegroup:internal        phonegroup:outbound        route:A_Route              route:emerg                route:intl                 route:ld10
route:ld10_reg             route:ld11                 route:ld11_reg             route:local
vbox-nathan(config-cos billing_reroute pos-1)# include route:intl
vbox-nathan(config-cos billing_reroute pos-1)# exit
vbox-nathan(config-cos billing_reroute)# cos_include 2         ### second include a cos will attempt to take 
vbox-nathan(config-cos billing_reroute pos-2)# include route:A_Route
vbox-nathan(config-cos billing_reroute pos-2)# exit
vbox-nathan(config-cos billing_reroute)#
```

<div class="columnLayout single" data-layout="single" id="bkmrk--1"><div class="cell normal" data-type="normal"><div class="innerCell"><div class="code panel pdl conf-macro output-block" data-hasbody="true" data-macro-name="code" style="border-width: 1px;"><div class="codeContent panelContent pdl"><div><div class="syntaxhighlighter sh-confluence nogutter  java" id="bkmrk-vbox-nathan%28config-c-1"></div></div></div></div></div></div></div>4\) Use the **show** command to ensure your settings have been saved. In this example, we have only added 2 includes, but you are able to add as many as necessary.

```
vbox-nathan(config-cos billing_reroute)# show
! Generating running-config
!!!
 
! -------------- Class of Services ----------------
cos billing_reroute
  desc "Rerouted calls to billing from specific extensions"
  cos_include 1
    include route:intl
    exit
  cos_include 2
    include route:A_Route
    exit
  exit
 
exit
```

<div class="columnLayout single" data-layout="single" id="bkmrk--2"><div class="cell normal" data-type="normal"><div class="innerCell"><div class="code panel pdl conf-macro output-block" data-hasbody="true" data-macro-name="code" style="border-width: 1px;"><div class="codeContent panelContent pdl"><div><div class="syntaxhighlighter sh-confluence nogutter  java" id="bkmrk-vbox-nathan%28config-c-3"></div></div></div></div></div></div></div># Class of Service Settings Description

You can also use the "**?**" key to view the description while in the CLI. \* indicates a required setting.

<div class="wiki-content" id="bkmrk-%21-comments-cos_inclu"><div class="contentLayout2"><div class="columnLayout single" data-layout="single"><div class="cell normal" data-type="normal"><div class="innerCell"><div class="table-wrap"><table border="1" class="confluenceTable tablesorter tablesorter-default" role="grid" style="width: 61.8519%; border-collapse: collapse; border-style: solid;"><thead><tr role="row"><td class="confluenceTd" style="width: 20.2532%;">Settings</td><td class="confluenceTd" style="width: 79.7468%;">Comments</td></tr></thead><tbody><tr role="row"><td class="confluenceTd" style="width: 20.2532%;">cos\_include</td><td class="confluenceTd" style="width: 79.7468%;">Create or change an include in this class of service</td></tr><tr role="row"><td class="confluenceTd" style="width: 20.2532%;">desc</td><td class="confluenceTd" style="width: 79.7468%;">(\*) Description

</td></tr><tr role="row"><td class="confluenceTd" style="width: 20.2532%;">do</td><td class="confluenceTd" style="width: 79.7468%;">To run exec commands in config mode

</td></tr><tr role="row"><td class="confluenceTd" style="width: 20.2532%;">exit</td><td class="confluenceTd" style="width: 79.7468%;">Exit from this level (with notification of incomplete config)</td></tr><tr role="row"><td class="confluenceTd" style="width: 20.2532%;">no</td><td class="confluenceTd" style="width: 79.7468%;">Clear settings

</td></tr><tr role="row"><td class="confluenceTd" style="width: 20.2532%;">reorder</td><td class="confluenceTd" style="width: 79.7468%;">Change the order of class of service includes</td></tr><tr role="row"><td class="confluenceTd" style="width: 20.2532%;">show</td><td class="confluenceTd" style="width: 79.7468%;">Show the running-config for the current item</td></tr><tr role="row"><td class="confluenceTd" style="width: 20.2532%;">include</td><td class="confluenceTd" style="width: 79.7468%;">(\*) Item to include</td></tr></tbody></table>

</div></div></div></div></div></div><div id="bkmrk--3"><div class="no-print" id="bkmrk--4"></div></div>