Internal Number Inventory Functions¶
The fn.lines macro functions use 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, optionally with a specifiedroutePartitionName.
All macros 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)).
- CUSTOMER_INI_ENABLED macro is
((False)):
Give the following patterns and route partition on the Unified Communications Manager:
| Number | Partition |
|---|---|
| 1000 | |
| 2000 | Site-REL103-Customer |
| 3000 | |
| 4000 | Site-REL103-Customer |
| 5000 | Site-REL103-Customer |
| 6000 |
fn.lines: Return a list of lines. With no parameter, list all the lines on the associated Unified Communications Manager. If the optional parameter is a route partition, list the lines in the partition. If the optional parameter is
custom, show an empty list.If an E164 number is associated with the INI number, then the E164 number is also shown.
Examples:
| Example | Output |
|---|---|
{{fn.lines}}
{{fn.lines Site-REL103-Customer}}
{{fn.lines custom}}
|
[{u'value': u'1000',
u'title': u'1000 +27826543001'},
{u'value': u'2000',
u'title': u'2000'},
{u'value': u'3000',
u'title': u'3000'},
{u'value': u'4000',
u'title': u'4000 +27826543004'},
{u'value': u'5000',
u'title': u'5000'},
{u'value': u'6000',
u'title': u'6000'}]
[{u'value': u'2000',
u'title': u'2000'},
{u'value': u'4000',
u'title': u'4000'},
{u'value': u'5000',
u'title': u'5000'}]
[]
|
- CUSTOMER_INI_ENABLED macro is
((True)):
Given the following properties of an example Internal Number Inventory:
| Number | In Use | Available |
|---|---|---|
| 1000 | N | Y |
| 2000 | N | Y |
| 3000 | N | N |
| 4000 | Y | Y |
| 5000 | Y | Y |
| 6000 | Y | N |
- fn.lines: Return a list of available lines on the Internal Number Inventory, with used lines indicated as (used). The E164 number associated with the INI is shown if available.
- fn.lines_available_only: Return a list of available lines from the Internal Number Inventory, with <TITLE> in brackets after each.
- fn.lines_used_only: Return a list of used lines from the Internal Return a Number Inventory, with <TITLE> in brackets after each.
- fn.lines_unavailable_only: Return a list of unavailable lines from the Internal Number Inventory, with <TITLE> in brackets after each.
- fn.lines_unused_only: Return a list of unused lines from the Internal Number Inventory, with <TITLE> in brackets after each.
- fn.lines_available_used: Return a list of available and used lines from the Internal Number Inventory, with <TITLE> in brackets after each.
- fn.lines_available_unused: Return a list of available and unused lines from the Internal Number Inventory, with <TITLE> in brackets after each.
- fn.lines_unavailable_used: Return a list of unavailable, used lines from the Internal Number Inventory, with <TITLE> in brackets after each.
- fn.lines_unavailable_unused: Return a list of unavailable and unused lines from the Number Inventory, with <TITLE> in brackets after each.
Examples:
| Example | Output |
|---|---|
{{fn.lines}}
|
[{u'value': u'1000',
u'title': u'1000 +27826543001',
{u'value': u'2000',
u'title': u'2000'},
{u'value': u'4000',
u'title': u'4000 (used) +27826543004'},
{u'value': u'5000',
u'title': u'5000 (used)'}]
|
{{fn.lines_available_only avail}}
|
[{u'value': u'1000',
u'title': u'1000 (avail)'},
{u'value': u'2000',
u'title': u'2000 (avail)'},
{u'value': u'4000',
u'title': u'4000 (avail)'},
{u'value': u'5000',
u'title': u'5000 (avail)'}]
|
{{fn.lines_used_only inuse}}
|
[{u'value': u'4000',
u'title': u'4000 (inuse)'},
{u'value': u'5000',
u'title': u'5000 (inuse)'}]
|
{{fn.lines_unavailable_only}}
|
[{u'value': u'3000',
u'title': u'3000'},
{u'value': u'6000',
u'title': u'6000 (used)'}]
|
{{fn.lines_unused_only}}
|
[{u'value': u'1000',
u'title': u'1000'},
{u'value': u'2000',
u'title': u'2000'},
{u'value': u'3000',
u'title': u'3000'}]
|
{{fn.lines_available_used}}
|
[{u'value': u'4000',
u'title': u'4000 (used)'},
{u'value': u'5000',
u'title': u'5000 (used)'}]
|
{{fn.lines_available_unused}}
|
[{u'value': u'1000',
u'title': u'1000'},
{u'value': u'2000',
u'title': u'2000'}]
|
{{fn.lines_unavailable_used}}
|
[{u'value': u'6000',
u'title': u'6000'}]
|
{{fn.lines_unavailable_unused}}
|
[{u'value': u'3000',
u'title': u'3000'}]
|
fn.get_associated_lines: Return a list of lines associated with a given userid from device.cucm.User.
Examples:
| Example | Output |
|---|---|
{{ fn.get_associated_lines jsmith }}
|
{ "85089", "85090" }
|
fn.associated_dn_list: Return a list of directory numbers associated with E164 numbers at the specified context hierarchy and lower. Two models are queried. Results include the range:
data/HcsDpDNE164AssociateDATanddata/HcsDpDNMultiE164AssociateDAT.Examples:
| Example | Output |
|---|---|
{# fn.associated_dn_list #}
|
[
"1015000",
"81104600",
"81104601",
"81104602",
"81104603"
]
|
fn.get_dn_number: Return the matching Directory Number (DN) in a range given a E164 number as input. The E164 ranges are of 1, 10, 100 and 1000.
Two models are queried. If no results are found in
data/HcsDpDNE164AssociateDATthen the ranges indata/HcsDpDNMultiE164AssociateDATare queried.Examples:
| Example | Output |
|---|---|
hierarchy: sys.hcs.CS.Global.LOC002 {{ fn.get_dn_number
\+121000 }}
|
82041000
|
fn.get_e164_number: Return the matching E164 number at the specified context hierarchy; given a Directory Number (DN) range as input. If not found, return a blank result.
Two models are queried. If no results are found in
data/HcsDpDNE164AssociateDATthen the ranges indata/HcsDpDNMultiE164AssociateDATare queried. This means that a E164 range mapping to a range of DNs including that DN would take precedence over a range of E164 mapped to a single DN if both mappings existed for the DN. In the event of a match on a range of E164 numbers mapped to a Single DN, the primary E164 configured is the E164 number returned. If the primary is not configured then no E164 number is returned.Examples:
| Example | Output |
|---|---|
hierarchy: sys.hcs.CS.Global.LOC002 {{ fn.get_e164_number
82029712 }}
|
\+1555559712
|