Manage incoming routes
Цей контент ще не доступний вашою мовою.
An account has one incoming route for on-net calls and one for each of its DIDs. Each route delivers calls either to the registered account or to one of the account’s trunks. These methods do the same as the Incoming Routing screen of an account. Routes are not added or deleted through these methods.
Both methods support trusted mode with i_customer.
Incoming route structure
Section titled “Incoming route structure”| Name | Type | Description |
|---|---|---|
i_incoming_route |
int | ID of the route |
i_did |
int | Source: ID of the DID the calls come to. Nil for on-net calls |
did |
string | The DID number |
i_trunk |
int | Destination: ID of the trunk the calls go to. Nil for the registered account |
trunk_name |
string | Name of the trunk |
i_forward_did_mode |
int | Fwd DID Mode: how the DID is passed to the destination, see the table below |
self_managed |
boolean | Self Managed: the account can change the route’s destination in its self-care portal |
i_forward_did_mode |
Name |
|---|---|
1 |
Off |
2 |
Forward DID in URI |
3 |
Diversion Header |
The list is also returned by getDictionary with name forward_did_modes, see Get system dictionaries.
getIncomingRoutesList
Section titled “getIncomingRoutesList”Lists the incoming routes of an account.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
i_account |
int | yes | ID of the account |
offset |
int | no | Skip this many routes |
limit |
int | no | Return at most this many routes |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
result |
string | OK |
incoming_routes |
array | Routes, each a struct with the fields of the structure |
Example
Section titled “Example”call("getIncomingRoutesList", {"i_account": 3092}){ "result": "OK", "incoming_routes": [ {"i_incoming_route": 610, "i_did": None, "did": None, "i_trunk": None, "trunk_name": None, "i_forward_did_mode": 3, "self_managed": False}, {"i_incoming_route": 611, "i_did": 845, "did": "442071234567", "i_trunk": 52, "trunk_name": "PBX", "i_forward_did_mode": 2, "self_managed": True}, ],}updateIncomingRoute
Section titled “updateIncomingRoute”Changes the destination of a route.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
i_incoming_route |
int | yes | ID of the route |
i_trunk |
int | no | Trunk of the same account. Nil delivers the calls to the registered account |
i_forward_did_mode |
int | no | Forward DID mode. Only for DID routes |
self_managed |
boolean | no | Let the account change the destination itself |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
result |
string | OK |
Example
Section titled “Example”call("updateIncomingRoute", {"i_incoming_route": 611, "i_trunk": 52, "i_forward_did_mode": 2}){"result": "OK"}Related
Section titled “Related”- Trunks and incoming routing: the Incoming Routing screen
- Account’s features
- Manage trunks
- Manage DIDs