# Trunk

A **Trunk** is a link to another system, such as a phone carrier, pbx, etc, to send and receive calls. A **Trunk** will need a **[Trunk Handler](https://public.intellasoft.net/books/cli/page/trunk-handler)** defined beforehand to function properly.

# Adding a Trunk

1\) Enter the CLI's configuration mode

2\) Ensure you have already made a **[Trunk Handler](https://public.intellasoft.net/books/cli/page/trunk-handler)**, while you can create a **Trunk** without defining one, you will still need to define one to ensure that the phone system is properly configured.

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

```
vbox-markm(config)# trunk building_a
!! Notice: Editing new item: building_a
!! Notice: Minimum requirements needed for insert:
!!   device_type
!!   desc
!!   capacity
vbox-markm(config-trunk building_a)#
```

<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-markm%28config%29%23--1"></div></div></div></div></div></div></div>4\) Enter the minimum required settings for adding the **Trunk**, you can use the **"?" key** to get a description of all the available settings.

```
vbox-markm(config-trunk building_a)# capacity 50
vbox-markm(config-trunk building_a)# desc "Main building"
vbox-markm(config-trunk building_a)# device_type
SIP         IAX2        DAHDI       VIRTUAL     SIP-VIRTUAL       ### Used tab to get a list of the available devices. 
vbox-markm(config-trunk building_a)# device_type SIP
```

<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-markm%28config-tr-1"></div></div></div></div></div></div></div>5\) After adding the trunk, use the **show** command to ensure your settings have been saved.

```
vbox-markm(config-trunk building_a)# show
! Generating running-config
!!!!
 
! -------------- Trunks ----------------
trunk building_a
  capacity 50
  desc "Main building"
  device_type SIP
  prestart_media no
  record no
  trunk_handler_name default
  sip
    allow ulaw,alaw,adpcm,gsm
    call-limit 50
    canreinvite no
    disallow g723,slin,ilbc,lpc10,g729,speex,g726aal2,g722
    host dynamic
    nat yes
    qualify yes
    rtpholdtimeout 60
    rtptimeout 60
    secret 9a97c729fdce1f0a5d68495f82c5159e
    sendrpid yes
    trustrpid no
    username building_a
    exit
  exit
 
exit
 
vbox-markm(config-trunk building_a)#
```

<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-markm%28config-tr-3"></div></div></div></div></div></div></div>6\) Next define a **[Trunk Handler](https://public.intellasoft.net/books/cli/page/trunk-handler)** that the **Trunk** will use.

<div class="columnLayout single" data-layout="single" id="bkmrk-vbox-markm%28config-tr-4"><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-markm%28config-tr-5"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container" title="Hint: double-click to select code"><div class="line number1 index0 alt2" data-bidi-marker="true">`vbox-markm(config-trunk building_a)# trunk_handler_name`</div><div class="line number2 index1 alt1" data-bidi-marker="true">`audiocodes                local_loop                pstn                      nycvoip`</div><div class="line number3 index2 alt2" data-bidi-marker="true">`branch                    nbs-``9734067200` `default` `localyny`</div><div class="line number4 index3 alt1" data-bidi-marker="true">`chvoip                    Nathans_Test_TrunkHandler`</div><div class="line number5 index4 alt2" data-bidi-marker="true">`vbox-markm(config-trunk building_a)# trunk_handler_name Nathans_Test_TrunkHandler`</div></div></td></tr></tbody></table>

</div></div></div></div></div></div></div>7\) Lastly, do a **show** command to ensure your settings are saved.

```
vbox-markm(config-trunk building_a)# show
! Generating running-config
!!!!
 
! -------------- Trunks ----------------
trunk building_a
  capacity 50
  desc "Main building"
  device_type SIP
  prestart_media no
  record no
  trunk_handler_name Nathans_Test_TrunkHandler
  sip
    allow ulaw,alaw,adpcm,gsm
    call-limit 50
    canreinvite no
    disallow g723,slin,ilbc,lpc10,g729,speex,g726aal2,g722
    host dynamic
    nat yes
    qualify yes
    rtpholdtimeout 60
    rtptimeout 60
    secret 9a97c729fdce1f0a5d68495f82c5159e
    sendrpid yes
    trustrpid no
    username building_a
    exit
  exit
 
exit
 
vbox-markm(config-trunk building_a)#
```

<div class="columnLayout single" data-layout="single" id="bkmrk--3"><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-markm%28config-tr-7"></div></div></div></div></div></div></div># Trunk Settings Description

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

<table border="1" class="confluenceTable tablesorter tablesorter-default" id="bkmrk-callerid_name-force-" role="grid" style="border-collapse: collapse; border-style: solid; width: 71.6049%; height: 447px;"><tbody><tr role="row" style="height: 29.8px;"><td class="confluenceTd" style="width: 29.0402%; height: 29.8px;">callerid\_name</td><td class="confluenceTd" style="width: 70.7241%; height: 29.8px;">Force this callerid name when receiving calls from this trunk </td></tr><tr role="row" style="height: 29.8px;"><td class="confluenceTd" style="width: 29.0402%; height: 29.8px;">callerid\_number</td><td class="confluenceTd" style="width: 70.7241%; height: 29.8px;">Force this callerid number when receiving calls from this trunk</td></tr><tr role="row" style="height: 29.8px;"><td class="confluenceTd" style="width: 29.0402%; height: 29.8px;">capacity</td><td class="confluenceTd" style="width: 70.7241%; height: 29.8px;">(\*) Maximum number of concurrent calls to/from this trunk</td></tr><tr role="row" style="height: 29.8px;"><td class="confluenceTd" style="width: 29.0402%; height: 29.8px;">desc</td><td class="confluenceTd" style="width: 70.7241%; height: 29.8px;">(\*) Non-functional description </td></tr><tr role="row" style="height: 29.8px;"><td class="confluenceTd" style="width: 29.0402%; height: 29.8px;">device\_type</td><td class="confluenceTd" style="width: 70.7241%; height: 29.8px;">(\*) Protocol that this device will use</td></tr><tr role="row" style="height: 29.8px;"><td class="confluenceTd" style="width: 29.0402%; height: 29.8px;">do</td><td class="confluenceTd" style="width: 70.7241%; height: 29.8px;">To run exec commands in config mode</td></tr><tr role="row" style="height: 29.8px;"><td class="confluenceTd" style="width: 29.0402%; height: 29.8px;">exit</td><td class="confluenceTd" style="width: 70.7241%; height: 29.8px;">Exit from this level (with notification of incomplete config)</td></tr><tr role="row" style="height: 29.8px;"><td class="confluenceTd" style="width: 29.0402%; height: 29.8px;">iax</td><td class="confluenceTd" style="width: 70.7241%; height: 29.8px;">Change IAX-specific trunk settings</td></tr><tr role="row" style="height: 29.8px;"><td class="confluenceTd" style="width: 29.0402%; height: 29.8px;">incoming\_context\_label</td><td class="confluenceTd" style="width: 70.7241%; height: 29.8px;">  
</td></tr><tr role="row" style="height: 29.8px;"><td class="confluenceTd" style="width: 29.0402%; height: 29.8px;">no</td><td class="confluenceTd" style="width: 70.7241%; height: 29.8px;">Clear settings </td></tr><tr role="row" style="height: 29.8px;"><td class="confluenceTd" style="width: 29.0402%; height: 29.8px;">prestart\_media</td><td class="confluenceTd" style="width: 70.7241%; height: 29.8px;">  
</td></tr><tr role="row" style="height: 29.8px;"><td class="confluenceTd" style="width: 29.0402%; height: 29.8px;">record</td><td class="confluenceTd" style="width: 70.7241%; height: 29.8px;">Whether to record all calls to/from this device</td></tr><tr role="row" style="height: 29.8px;"><td class="confluenceTd" style="width: 29.0402%; height: 29.8px;">show</td><td class="confluenceTd" style="width: 70.7241%; height: 29.8px;"> Show the running-config for the current item</td></tr><tr role="row" style="height: 29.8px;"><td class="confluenceTd" style="width: 29.0402%; height: 29.8px;">sip</td><td class="confluenceTd" style="width: 70.7241%; height: 29.8px;">Change SIP-specific trunk settings</td></tr><tr role="row" style="height: 29.8px;"><td class="confluenceTd" style="width: 29.0402%; height: 29.8px;">trunk\_handler\_name </td><td class="confluenceTd" style="width: 70.7241%; height: 29.8px;">Name of the trunkhandler to use for incoming call processing</td></tr></tbody></table>