Перейти к содержимому

Manage trunks

Это содержимое пока не доступно на вашем языке.

A trunk delivers calls aimed at an account to the account’s own equipment, such as a PBX, instead of to the registered account. It works like a vendor connection, but belongs to an account. A trunk has one or more destinations, managed with the trunk connection methods; incoming routes decide which calls use the trunk. These methods do the same as the Trunks screen of an account.

All methods support trusted mode with i_customer.

Name Type Description
i_trunk int ID of the trunk
i_account int Account the trunk belongs to
name string Name, up to 64 characters in the panel
description string Description
policy string Order in which the trunk’s connections are tried: ordered (default, by their order) or round-robin

Creates a trunk for an account.

Name Type Required Description
i_account int yes ID of the account
name string yes Name of the trunk
description string no Free text
policy string no ordered (default) or round-robin
Name Type Description
result string OK
i_trunk int ID of the new trunk
request
call("createTrunk", {"i_account": 3092, "name": "PBX", "description": "Office PBX"})
response
{"result": "OK", "i_trunk": 52}

Changes a trunk. Send only the fields you change.

Name Type Required Description
i_trunk int yes ID of the trunk
name string no New name
description string no Free text
policy string no ordered or round-robin

The account of a trunk cannot be changed.

Name Type Description
result string OK
i_trunk int ID of the trunk
request
call("updateTrunk", {"i_trunk": 52, "policy": "round-robin"})
response
{"result": "OK", "i_trunk": 52}

Deletes a trunk. The panel deletes the trunk’s connections with deleteTrunkConnection first; do the same.

Name Type Required Description
i_trunk int yes ID of the trunk
Name Type Description
result string OK
i_trunk int ID of the deleted trunk
request
call("deleteTrunk", {"i_trunk": 52})
response
{"result": "OK", "i_trunk": 52}

Returns one trunk.

Name Type Required Description
i_trunk int yes ID of the trunk
Name Type Description
result string OK
trunk struct The trunk, with the fields of the structure
request
call("getTrunkInfo", {"i_trunk": 52})
response
{
"result": "OK",
"trunk": {
"i_trunk": 52,
"i_account": 3092,
"name": "PBX",
"description": "Office PBX",
"policy": "ordered",
},
}

Lists the trunks of an account.

Name Type Required Description
i_account int yes ID of the account
name_pattern string no Only trunks whose name matches this case-insensitive SQL LIKE pattern: % matches any characters, _ one character
offset int no Skip this many trunks
limit int no Return at most this many trunks
Name Type Description
result string OK
trunks array Trunks, each a struct with the fields of the structure
request
call("getTrunksList", {"i_account": 3092, "name_pattern": "%pbx%"})
response
{
"result": "OK",
"trunks": [
{"i_trunk": 52, "i_account": 3092, "name": "PBX",
"description": "Office PBX", "policy": "ordered"},
],
}