Inbound routes
Inbound routes determine the path of an incoming call based on the dialed number, trunk and caller. Each route is a chain of steps: if the first step does not answer within the specified time, the call moves to the next. Scopes inbound_routes:read / inbound_routes:write.
Creating a route
curl -s -X POST https://centralino.exovoip.it/api/v1/inbound-routes \
-H "X-API-Key: $EXOPBX_API_KEY" -H "Content-Type: application/json" \
-d '{"name":"Orario d'\''ufficio","numberId":7,"priority":10,"steps":[
{"timeoutS":20,"destination":{"type":"extension","extensionId":12}},
{"timeoutS":20,"destination":{"type":"mobile","number":"+393331234567","confirm":true}},
{"timeoutS":60,"destination":{"type":"voicemail","extensionId":12}}]}'await pbx.inboundRoutes.create({
name: "Orario d'ufficio",
numberId: 7,
priority: 10,
steps: [
{ timeoutS: 20, destination: { type: 'extension', extensionId: 12 } },
{ timeoutS: 20, destination: { type: 'mobile', number: '+393331234567', confirm: true } },
{ timeoutS: 60, destination: { type: 'voicemail', extensionId: 12 } },
],
});$pbx->inboundRoutes->create([
'name' => "Orario d'ufficio",
'numberId' => 7,
'priority' => 10,
'steps' => [
['timeoutS' => 20, 'destination' => ['type' => 'extension', 'extensionId' => 12]],
['timeoutS' => 20, 'destination' => ['type' => 'mobile', 'number' => '+393331234567', 'confirm' => true]],
['timeoutS' => 60, 'destination' => ['type' => 'voicemail', 'extensionId' => 12]],
],
]);pbx.inbound_routes.create({
"name": "Orario d'ufficio",
"numberId": 7,
"priority": 10,
"steps": [
{"timeoutS": 20, "destination": {"type": "extension", "extensionId": 12}},
{"timeoutS": 20, "destination": {"type": "mobile", "number": "+393331234567", "confirm": True}},
{"timeoutS": 60, "destination": {"type": "voicemail", "extensionId": 12}},
],
})| Field | Description |
|---|---|
numberId, trunkId | Filters on the dialed number and trunk (optional) |
callerPattern | Filter on the caller's number (optional) |
priority | Evaluation order (lower values first) |
steps[] | Steps: destination and timeoutS |
The first route matching the call is applied. Routes are evaluated before the number's default destination.
Route order
PUT /v1/inbound-routes/order sets the order using the full list of ids:
curl -s -X PUT https://centralino.exovoip.it/api/v1/inbound-routes/order \
-H "X-API-Key: $EXOPBX_API_KEY" -H "Content-Type: application/json" -d '{"ids":[4,2,9]}'await pbx.inboundRoutes.reorder({ ids: [4, 2, 9] });$pbx->inboundRoutes->reorder(['ids' => [4, 2, 9]]);pbx.inbound_routes.reorder({"ids": [4, 2, 9]})With PATCH /v1/inbound-routes/:id, the steps field replaces the entire chain.
Endpoints
| Request | Scope | SDK method |
|---|---|---|
GET /v1/inbound-routes | inbound_routes:read | inboundRoutes.list() · py: inbound_routes.list() |
POST /v1/inbound-routes | inbound_routes:write | inboundRoutes.create() · py: inbound_routes.create() |
PUT /v1/inbound-routes/order | inbound_routes:write | inboundRoutes.reorder() · py: inbound_routes.reorder() |
GET /v1/inbound-routes/:id | inbound_routes:read | inboundRoutes.get() · py: inbound_routes.get() |
PATCH /v1/inbound-routes/:id | inbound_routes:write | inboundRoutes.update() · py: inbound_routes.update() |
DELETE /v1/inbound-routes/:id | inbound_routes:write | inboundRoutes.delete() · py: inbound_routes.delete() |
