Administrator Guide: Large Internal Directory optimization

History

[16 December 2011]
  • Creation

Introduction

While more and more extensions are added to a SOP cluster. The configuration file starts growing more and more. This can lead to some scalability issue.

In order to ensure a maximum of scalability, this document explains how to configure your system in order to prevent these large configuration files.

This document explains how to adapt your dialplan so that each extension are not defined explicitly. The dialplan will then include generic pattern which will redirect the call the the action Goto.Application. The action Goto.Application will take care to look up the extension in the local database and identify its profile and its status and then redirect the call the associated callflow.

It is recommended to activate this optimization for a system with more than 5000 extensions.

Implementation

Requirements

  • Asterisk-1.2x module v2.31.4 or higher
  • Goto.Application v1.02 or higher
  • Users callflow must use STARTDYNAMICAPPLICATION v5.3 or higher
  • STARTRECURRENTAPPLICATION is not supported, use STARTDYNAMICAPPLICATION 8.5.0 or higher instead
  • SMP v4.5.2 or higher

Step 1: Inventory of the internal directory

Go to
DONE Navigate to:  SMP>Master SOP>Directory>Internal Directory

Identify the exact list of patterns required in order to match all possible extensions. For example:
  • _[1-9]XXX (internal extension of 4 digits)
  • _[1-9]XXXX (internal extension of 5 digits)
  • _[1-9]XXXXX (internal extension of 6 digits)
  • _*9[0-1]XXX (speed-dials of 5 digits)
  • _*9[0-1]XXXX (speed-dials 6 digits)
  • _*XX (short code of 2 digits)
  • _**XXX (short code of 3 digits)

Step 2: Inventory of the phone's restriction group

Go to
DONE Navigate to: SMP>Master SOP>Resources>IP Phones

Identify all the Restriction Group used by the IP phones. For example:
  • NoRestrict
  • User_class10
  • User_class20
  • User_class30
  • Receptionist

Step 3: Creation of the internal route group

This step is described in ExtensionMoveAddChange.

ALERT! For each SOP in the cluster, make sure that all the identified patterns are included in the InternalGroup

This can be verified via the asterisk console:

00000037*CLI> show dialplan InternalGroup
[ Context 'InternalGroup' created by 'pbx_config' ]
  '_**XXX' =>       1. Macro(Action_Goto.APPLICATION_1.02|${EXTEN}||||
  '_*9[0-1]XXX' =>  1. Macro(Action_Goto.APPLICATION_1.02|${EXTEN}||||
  '_*9[0-1]XXXX' => 1. Macro(Action_Goto.APPLICATION_1.02|${EXTEN}||||
  '_*XX' =>         1. Macro(Action_Goto.APPLICATION_1.02|${EXTEN}||||
  '_[1-9]XXX' =>        1. Macro(Action_Goto.APPLICATION_1.02|${EXTEN}||||
  '_[1-9]XXXX' =>       1. Macro(Action_Goto.APPLICATION_1.02|${EXTEN}|||
  '_[1-9]XXXXX' =>      1. Macro(Action_Goto.APPLICATION_1.02|${EXTEN}|||

-= 7 extensions (7 priorities) in 1 context. =-

Step 4: Verify that each identified restriction group can access the InternalGroup

ALERT! This is to be done for each SOP of the cluster.

ALERT! This is to be done for each identified route group in the Step 2.

ALERT! Note that all the callflow, which matches _*XXX, are included in the default context

ALERT! The default context include the context RestrictInternal which itself includes the route group InternalGroup

00000037*CLI> show dialplan NoRestrict
[ Context 'NoRestrict' created by 'pbx_config' ]
  Include =>        'emergency'                                   [pbx_config]
  Include =>        'helpdesk'                            [pbx_config]
  Include =>        'console'                                   [pbx_config]
  Include =>        'default'                                     [pbx_config]
  Include =>        'national'                                    [pbx_config]
  Include =>        'mobile'                                      [pbx_config]
  Include =>        'international'                               [pbx_config]
  Include =>        'premium'                                     [pbx_config]

In order to prevent conflict between different route its is important to set the precedence properly.

In this example the restriction group 'helpdesk' contains a set of extensions customized per site. For example:

00000037*CLI> show dialplan helpdesk
[ Context 'helpdesk' created by 'pbx_config' ]
  '4141' =>         1. Macro(Action_MapNumber_1.11|${EXTEN}||||||||||||0|*123||
  '4242' =>         1. Macro(Action_MapNumber_1.11|${EXTEN}||||||||||||0|*123||

In order to prevent conflict with the route

  '_[1-9]XXX' =>        1. Macro(Action_Goto.APPLICATION_1.02|${EXTEN}|||||

It is important to give to the restriction group 'helpdesk' a lower precedence than the restriction group 'default'.

Often some service are available via specific prefix. This is used for example for the directed park retrieve.
00000037*CLI> show dialplan console
[ Context 'console' created by 'pbx_config' ]
  '_*55.' =>        1. Macro(Action_MapNumber_1.11|${EXTEN}||||||||||||100|10000|NumberToDial|
In order to prevent conflict with some callflow defined in 'defaut'. The restriction group must have a lower precedence than the 'default' restriction group.

The restriction groups 'national', 'mobile', 'international' and 'premium' does usually only contains routes starting with '0' and therefore does not conflict with the 'InternalGroup'.

Step 5: Activation of the LargeInternalDirectory flag

DONE Navigate to:  SMP > Master SOP > Communication Flow Studio > Global Parameters > Integer

In order to activate the optimization of a specific SOP (00000037) create the following parameter:
  • Parameter name: LargeInternalDirectory_00000037
  • Friendly name: LargeInternalDirectoryForSOP37
  • Value: 1
  • Type: AdminVar

Select an extension defined in your directory and check the current definition in the dialplan:

00000037*CLI> show dialplan 3462@NoRestrict
[ Included context 'default' created by 'pbx_config' ]
  '3462' =>        hint: SIP/SDP40371                            [pbx_config]
                    1. SetVar(HuntGroupExtension=)                [pbx_config]
                    2. SetVar(varname_4=HuntGroupExtension)       [pbx_config]
                    3. SetVar(ReceptionExtension=200)             [pbx_config]
                    4. SetVar(TeleworkingNumber=)                 [pbx_config]
                    5. SetVar(varname_1=TeleworkingNumber)        [pbx_config]
                    6. SetVar(ForwardExtension=)                  [pbx_config]
                    7. SetVar(varname_3=ForwardExtension)         [pbx_config]
                    8. SetVar(LastUserSop1=00000037)              [pbx_config]
                    9. SetVar(LastUserSop2=)                      [pbx_config]
                    10. SetVar(Sop=00000037)                      [pbx_config]
                    11. SetVar(LastUserLang=nl)                   [pbx_config]
                    12. Macro(Callflow_User_Office|3462|Steven|Dawn|||||SDP40371||||
[ Included context 'InternalGroup' created by 'pbx_config' ]
  '_[1-9]XXX' =>       1. Macro(Action_Goto.APPLICATION_1.02|${EXTEN}||||||

Do an apply SOP change and check that the dialplan has been simplified

00000037*CLI> show dialplan 3462@!NoRestrict
[ Included context 'default' created by 'pbx_config' ]
  '3462' =>        hint: SIP/SDP40371                            [pbx_config]
[ Included context '!InternalGroup' created by 'pbx_config' ]
  '_[1-9]XXX' =>       1. Macro(Action_Goto.APPLICATION_1.02|${EXTEN}||||||

It is also interesting to verify the reload time of the new configuration:
00000037*CLI> reload
Copyright © Escaux SA