Skip to content

Builders

Fluent builders for constructing complex AXL configuration payloads. See the Fluent Builders user guide for detailed usage examples.

axltoolkit.builders.PhoneBuilder

PhoneBuilder(name: str, *, product: str = 'Cisco 8845', protocol: str = 'SIP')

Fluent builder for phone device payloads.

Creates the nested dict structure required by :meth:~axltoolkit.axl.AXLClient.add_phone.

Parameters:

Name Type Description Default
name str

Device name (e.g. "SEP001122334455").

required
product str

Phone model (e.g. "Cisco 8845").

'Cisco 8845'
protocol str

"SIP" or "SCCP" (default "SIP").

'SIP'

Example::

phone = (
    PhoneBuilder("SEP001122334455", product="Cisco 8845")
    .device_pool("Default")
    .sip_profile("Standard SIP Profile")
    .security_profile("Cisco 8845 - Standard SIP Non-Secure Profile")
    .phone_template("Standard 8845 SIP")
    .add_line(1, "1001", "Internal-PT")
    .build()
)

device_pool

device_pool(name: str) -> PhoneBuilder

Set the device pool.

calling_search_space

calling_search_space(name: str) -> PhoneBuilder

Set the calling search space.

common_device_config

common_device_config(name: str) -> PhoneBuilder

Set the common device configuration.

common_phone_config

common_phone_config(name: str) -> PhoneBuilder

Set the common phone configuration profile.

phone_template

phone_template(name: str) -> PhoneBuilder

Set the phone button template.

location

location(name: str) -> PhoneBuilder

Set the location.

security_profile

security_profile(name: str) -> PhoneBuilder

Set the security profile.

sip_profile

sip_profile(name: str) -> PhoneBuilder

Set the SIP profile.

softkey_template

softkey_template(name: str) -> PhoneBuilder

Set the softkey template.

description

description(desc: str) -> PhoneBuilder

Set the description.

owner

owner(userid: str) -> PhoneBuilder

Set the owner user ID.

user_locale

user_locale(locale: str) -> PhoneBuilder

Set the user locale.

network_locale

network_locale(locale: str) -> PhoneBuilder

Set the network locale.

media_resource_list

media_resource_list(name: str) -> PhoneBuilder

Set the media resource list.

load_information

load_information(firmware: str) -> PhoneBuilder

Set the firmware load information.

set

set(key: str, value: Any) -> PhoneBuilder

Set an arbitrary key-value pair on the phone payload.

add_line

add_line(index: int, pattern: str, route_partition_name: str = '', *, display: str = '', display_ascii: str = '', label: str = '', e164_mask: str = '', max_num_calls: int = 4, busy_trigger: int = 2) -> PhoneBuilder

Add a line association.

Parameters:

Name Type Description Default
index int

Line button index (1-based).

required
pattern str

Directory number pattern.

required
route_partition_name str

Route partition for the DN.

''
display str

Display name.

''
display_ascii str

ASCII display name.

''
label str

Line text label.

''
e164_mask str

E.164 alternate number mask.

''
max_num_calls int

Maximum simultaneous calls on this line.

4
busy_trigger int

Busy trigger threshold.

2

build

build() -> Dict[str, Any]

Build and return the phone data dict.

Returns:

Type Description
Dict[str, Any]

A dict suitable for passing to

Dict[str, Any]

meth:~axltoolkit.axl.AXLClient.add_phone.

Raises:

Type Description
ValueError

If required fields are missing.

axltoolkit.builders.SipTrunkBuilder

SipTrunkBuilder(name: str)

Fluent builder for SIP Trunk payloads.

Creates the nested dict structure required by :meth:~axltoolkit.axl.AXLClient.add_sip_trunk.

Parameters:

Name Type Description Default
name str

Trunk name.

required

Example::

trunk = (
    SipTrunkBuilder("SIP-Trunk-ITSP")
    .device_pool("Default")
    .security_profile("Non Secure SIP Trunk Profile")
    .sip_profile("Standard SIP Profile")
    .add_destination("10.0.0.100", 5060)
    .calling_search_space("CSS-Trunk")
    .build()
)

device_pool

device_pool(name: str) -> SipTrunkBuilder

Set the device pool.

calling_search_space

calling_search_space(name: str) -> SipTrunkBuilder

Set the calling search space.

security_profile

security_profile(name: str) -> SipTrunkBuilder

Set the SIP trunk security profile.

sip_profile

sip_profile(name: str) -> SipTrunkBuilder

Set the SIP profile.

description

description(desc: str) -> SipTrunkBuilder

Set the description.

media_resource_list

media_resource_list(name: str) -> SipTrunkBuilder

Set the media resource list.

location

location(name: str) -> SipTrunkBuilder

Set the location.

run_on_every_node

run_on_every_node(enabled: bool = True) -> SipTrunkBuilder

Set whether the trunk runs on every node.

trunk_type

trunk_type(trunk_type: str) -> SipTrunkBuilder

Set the SIP trunk type (e.g. "None(Default)").

Parameters:

Name Type Description Default
trunk_type str

The trunk type string.

required

set

set(key: str, value: Any) -> SipTrunkBuilder

Set an arbitrary key-value pair on the trunk payload.

add_destination

add_destination(address: str, port: int = 5060, *, sort_order: Optional[int] = None, ipv6: bool = False) -> SipTrunkBuilder

Add a destination (SIP peer).

Parameters:

Name Type Description Default
address str

IP address or hostname of the SIP peer.

required
port int

SIP port (default 5060).

5060
sort_order Optional[int]

Route priority order. If None, auto-assigned based on insertion order.

None
ipv6 bool

If True, the address is treated as IPv6.

False

build

build() -> Dict[str, Any]

Build and return the SIP trunk data dict.

Returns:

Type Description
Dict[str, Any]

A dict suitable for passing to

Dict[str, Any]

meth:~axltoolkit.axl.AXLClient.add_sip_trunk.

Raises:

Type Description
ValueError

If required fields are missing.

axltoolkit.builders.CssBuilder

CssBuilder(name: str)

Fluent builder for Calling Search Space payloads.

Example::

css = (
    CssBuilder("CSS-Internal")
    .description("Internal dialing CSS")
    .add_partition("PT-Internal")
    .add_partition("PT-Local")
    .add_partition("PT-LD")
    .build()
)

description

description(desc: str) -> CssBuilder

Set the CSS description.

add_partition

add_partition(partition_name: str) -> CssBuilder

Append a route partition to the CSS (order matters).

build

build() -> Dict[str, Any]

Build and return the CSS data dict.

Returns:

Type Description
Dict[str, Any]

A dict with name, description, and members keys.