Перейти до вмісту

Manage routing groups

Цей контент ще не доступний вашою мовою.

A routing group is the routing table of an account: an ordered list of entries, each pairing a vendor connection with a destination set, and a policy that decides in which order matching entries are tried. The API calls the entries members. These methods do the same as the Routing Groups screen.

addRoutingGroup and updateRoutingGroup take these fields; listRoutingGroups returns them with i_routing_group.

Name Type Description
name string Name of the group (Group Name)
policy string Comma-separated policies in the order they apply, for example prefix,preference. May be empty. Values in the table below
description string Free text
i_media_relay int Media relay for the group’s calls (Media Relay): 1 for the built-in relay, nil to use the connection’s setting. IDs from the media_relays dictionary
timeout_2xx int Seconds the last entry may ring before the call fails (Final 2xx Timeout, sec). Default 300
lrn_enabled boolean Look up the ported number before routing (Enable LRN). Default False
lrn_translation_rule string Rewrites the LRN result (LRN Translation Rule)
disable_onnet_routing boolean True routes every call through the entries; False delivers calls between your own accounts on-net. Default True
onnet_i_connection int Connection for on-net calls (Use Connection); nil uses the built-in registrar
disable_onnet_voicemail boolean True turns voicemail for unanswered on-net calls off. Default True
onnet_voicemail_i_connection int Connection for on-net voicemail (Voicemail Connection)
onnet_scope int Who can reach whom on-net (On-Net Scope): 1 all accounts (default), 2 the customer and its sub-customers, 3 the customer only
onnet_timeout_100 int Reply Timeout, sec for on-net legs, 1 to 32. Default 5
onnet_timeout_1xx int 1xx Timeout, sec for on-net legs. Default 10
onnet_timeout_2xx int 2xx Timeout, sec for on-net legs. Default 60
policy value Panel name Order of the matching routes
least_cost Least Cost Cheapest termination price first
prefix Prefix Length Longest matching prefix first
preference Route Preference Highest route Preference first
order Routing Entries Order Lowest member preference (Order #) first
weight Weighted Distribution Random, in proportion to the members’ weight

addRoutingGroupMember and updateRoutingGroupMember take these fields; listRoutingGroupMembers returns them with i_routing_group_member.

Name Type Description
i_connection int Vendor connection the call is sent to (Connection)
i_destination_set int Destination set with the prefixes and prices for this connection (Termination Route)
preference int Position of the entry (Order #), used by the order policy
activation_date dateTime When the entry starts to apply (Activation Date). Default: now
expiration_date dateTime When the entry stops to apply (Expiration Date). nil or omitted: never
weight int Share of traffic for the weight policy (Weight)

Dates are dateTime.iso8601 in UTC. A string in the form 09:57:29.000 GMT Mon May 29 2017 is accepted too.

Creates a routing group.

Name Type Required Description
name string yes Name of the group
policy string yes Policies, see the routing group structure. Send an empty string for none
other fields no Any field of the routing group structure
Name Type Description
result string OK
i_routing_group int ID of the new group
request
call("addRoutingGroup", {"name": "Wholesale LCR", "policy": "least_cost", "timeout_2xx": 300})
response
{"result": "OK", "i_routing_group": 14}

Returns routing groups with all their fields.

Name Type Required Description
name_pattern string no Filter by name with SQL LIKE syntax: % matches any text
i_routing_group int no Return only this group
Name Type Description
result string OK
list array One struct per group with the fields of the routing group structure and i_routing_group
request
call("listRoutingGroups", {"name_pattern": "Wholesale%"})
response
{
"result": "OK",
"list": [
{"i_routing_group": 14, "name": "Wholesale LCR", "policy": "least_cost", "timeout_2xx": 300},
# … one struct per group, with all fields
],
}

Changes a routing group. Send only the fields you change.

Name Type Required Description
i_routing_group int yes ID of the group
other fields no Any field of the routing group structure
Name Type Description
result string OK
request
call("updateRoutingGroup", {"i_routing_group": 14, "policy": "preference,least_cost"})
response
{"result": "OK"}

Deletes a routing group. Move the accounts, customers and authentication rules that use it to another group first.

Name Type Required Description
i_routing_group int yes ID of the group
Name Type Description
result string OK
request
call("delRoutingGroup", {"i_routing_group": 14})
response
{"result": "OK"}

Adds an entry to a routing group.

Name Type Required Description
i_routing_group int yes ID of the group
i_connection int yes ID of the vendor connection
i_destination_set int yes ID of the destination set
preference int yes Position of the entry
activation_date, expiration_date, weight no See the member structure
Name Type Description
result string OK
i_routing_group_member int ID of the new entry
request
from datetime import datetime
call("addRoutingGroupMember", {
"i_routing_group": 14,
"i_connection": 41,
"i_destination_set": 118,
"preference": 1,
"activation_date": datetime(2026, 11, 1, 0, 0, 0),
"weight": 70,
})
response
{"result": "OK", "i_routing_group_member": 233}

Returns the entries of a routing group.

Name Type Required Description
i_routing_group int yes ID of the group
i_routing_group_member int no Return only this entry
Name Type Description
result string OK
list array One struct per entry with the fields of the member structure and i_routing_group_member
request
call("listRoutingGroupMembers", {"i_routing_group": 14})
response
{
"result": "OK",
"list": [
{
"i_routing_group_member": 233,
"i_connection": 41,
"i_destination_set": 118,
"preference": 1,
"weight": 70,
# … the other member fields
},
],
}

Changes an entry. Send only the fields you change.

Name Type Required Description
i_routing_group int yes ID of the group
i_routing_group_member int yes ID of the entry
other fields no Any field of the member structure
Name Type Description
result string OK
request
call("updateRoutingGroupMember", {"i_routing_group": 14, "i_routing_group_member": 233, "weight": 30})
response
{"result": "OK"}

Removes an entry from a routing group.

Name Type Required Description
i_routing_group int yes ID of the group
i_routing_group_member int yes ID of the entry
Name Type Description
result string OK
request
call("delRoutingGroupMember", {"i_routing_group": 14, "i_routing_group_member": 233})
response
{"result": "OK"}