Number Management Functions¶
CUSTOMER_INI_ENABLED¶
The fn.get_lines macro function uses the value of a
CUSTOMER_INI_ENABLED macro at the relevant hierarchy:
- If
((True)), then apply the function to the Internal Number Inventory (INI) at the hierarchy:data.InternalNumberInventory.internal_number. - If
((False)), then apply the function todevice.cucm.Line.pattern.
The macro function will check the CUSTOMER_INI_ENABLED macro first.
This macro should exist at the required hierarchy level and have a
value of ((True)) or ((False)).
Function¶
Function name: fn.get_lines.
Example where CUSTOMER_INI_ENABLED macro is ((True)):
| Example | Output |
|---|---|
{{fn.get_lines}}
|
[{"value": "1000",
"title": "1000 (Used) \\+27826543001",
{"value": "2000",
"title": "2000"},
{"value": "3000",
"title": "3000 (Used-Utility)"},
{"value": "4000",
"title": "4000 (Cooling) \\+27826543004 ...(release date: 2021-09-25)..."},
{"value": "5000",
"title": "5000 (Reserved)"}]
|
Parameters¶
The parameter names and values are listed below.
Note
More than one parameter can be used. These should then be comma-separated,
for example: {{ fn.get_lines status:Used,direction:parent}}.
status: the status of the line.Parameter values:
AllAvailableUsedAvailable_or_UsedUsed-UtilityUsed_or_Used-UtilityReservedCooling
For details, refer to Number Status and Usage.
Usage example:
{{fn.get_lines status:Available}}Example Output {{fn.get_lines status:Available}}
[ {"value": "2000", "title": "2000"} ]
direction: the line search direction in the hierarchy.Note
The default search direction is up, i.e. without the parameter is equal to
direction:up.Parameter values:
up- Upwards. Include current hierarchy. This is the default if the parameter is not used.down- Downwards. Include current hierarchy.local: - On this level only. Include current hierarchy.parent- Parent only. Exclude current hierarchy, in other words, search the parent aslocal.below- Downwards. Exclude current hierarchy.above- Upwards. Exclude current hierarchy.
Usage example:
{{fn.get_lines direction:parent}}Example Output {{fn.get_lines direction:parent}}
[{"value": "1000", "title": "1000 (Used) \\+27826543001"}, {"value": "3000", "title": "3000 (Used-Utility)"} ]
partition: the line search is fordevice.cucm.Line.patternin the specified partition only, i.e. the specifiedroutePartitionName.Parameter value: a partition name, for example Site-REL103-Customer.
Example Output {{fn.get_lines partition:Site-REL103-Customer}}
[{"value": "2000", "title": "2000"} ]
e164: the line search is for the E164 number.Parameter value: an E164 number, for example
\+27826543001.Example Output {{fn.get_lines e164:"\+27826543001"}}
[{"value": "1000", "title": "1000 (Used) \\+27826543001"} ]
scalar_list_only:true: only display thevaluein thetitle, valuepair of the result list.Parameter value: only one value:
true. Without the parameter, the default display is thetitle, valuepair.Example Output {{fn.get_lines scalar_list_only:true}}
[ "1000", "2000", "3000", "4000", "5000" ]
Parameter Types and Permutations¶
Parameters are of the following types:
- Applies to INI:
status,e164 - Applies to cucm/Line:
partition - Other:
scalar_list,direction
The types of parameters will determine the types of lines returned:
- Internal Number Inventory or
device.cucm.Line.pattern
in accordance with whether CUSTOMER_INI_ENABLED is ((True))
or ((False)).
The table below shows the result of parameters and combinations used in these cases.
Note
The default (if not specified) direction is up.
| Parameter Combination | INI enabled | Result |
|---|---|---|
partition [scalar_list, direction] |
Y | Return cucm.Line in partition |
partition [scalar_list, direction] |
N | Return cucm.Line in partition |
status, partition |
Y | Return INI by status upwards |
status, partition |
N | Return cucm.Line in partition |
status |
Y | Return INI by status upwards |
status |
N | Return cucm.Line upwards |
partition |
Y | Return cucm.Line in partition |
partition |
N | Return cucm.Line in partition |