Outbound routes
Outbound routes select the trunk for external calls based on the dialed number, with backup trunks in case of failure. Scopes outbound_routes:read / outbound_routes:write.
Creating a route
curl -s -X POST https://centralino.exovoip.it/api/v1/outbound-routes \
-H "X-API-Key: $EXOPBX_API_KEY" -H "Content-Type: application/json" \
-d '{"name":"Cellulari","beginsWith":"3","restDigits":9,"trunkIds":[1,2]}'
curl -s -X POST https://centralino.exovoip.it/api/v1/outbound-routes/simulate \
-H "X-API-Key: $EXOPBX_API_KEY" -H "Content-Type: application/json" -d '{"number":"3331234567"}'await pbx.outboundRoutes.create({
name: 'Cellulari',
beginsWith: '3',
restDigits: 9,
trunkIds: [1, 2],
});
const sim = await pbx.outboundRoutes.simulate({ number: '3331234567' });
console.log(sim.allowed, sim.routeId, sim.dialed);$pbx->outboundRoutes->create(['name' => 'Cellulari', 'beginsWith' => '3', 'restDigits' => 9, 'trunkIds' => [1, 2]]);
$sim = $pbx->outboundRoutes->simulate(['number' => '3331234567']);pbx.outbound_routes.create({"name": "Cellulari", "beginsWith": "3", "restDigits": 9, "trunkIds": [1, 2]})
sim = pbx.outbound_routes.simulate({"number": "3331234567"})| Field | Description |
|---|---|
beginsWith, restDigits | The number begins with… and has N more digits |
trim, prepend | Leading digits to strip / prefix to add |
trunkIds | Trunks in order of preference (the following ones are backups) |
priority | Evaluation order |
The simulator (POST /v1/outbound-routes/simulate) shows, for a given number, whether the call is allowed, which route applies, the number actually dialed and the trunks used: useful for checking the configuration without placing a call.
Blocks by category
The tenant policy blocks entire categories of destinations (e.g. premium-rate, satellite, international numbers) and defines the allowed destinations for forwarding.
curl -s -X PUT https://centralino.exovoip.it/api/v1/outbound-routes/policy \
-H "X-API-Key: $EXOPBX_API_KEY" -H "Content-Type: application/json" \
-d '{"blocked":["premium","satellite","international"]}'await pbx.outboundRoutes.setPolicy({ blocked: ['premium', 'satellite', 'international'] });$pbx->outboundRoutes->setPolicy(['blocked' => ['premium', 'satellite', 'international']]);pbx.outbound_routes.set_policy({"blocked": ["premium", "satellite", "international"]})If the policy has been locked by Exobyte, changes return 403.
Endpoints
| Request | Scope | SDK method |
|---|---|---|
GET /v1/outbound-routes | outbound_routes:read | outboundRoutes.list() · py: outbound_routes.list() |
POST /v1/outbound-routes | outbound_routes:write | outboundRoutes.create() · py: outbound_routes.create() |
PUT /v1/outbound-routes/order | outbound_routes:write | outboundRoutes.reorder() · py: outbound_routes.reorder() |
GET /v1/outbound-routes/policy | outbound_routes:read | outboundRoutes.getPolicy() · py: outbound_routes.get_policy() |
PUT /v1/outbound-routes/policy | outbound_routes:write | outboundRoutes.setPolicy() · py: outbound_routes.set_policy() |
POST /v1/outbound-routes/simulate | outbound_routes:read | outboundRoutes.simulate() · py: outbound_routes.simulate() |
GET /v1/outbound-routes/:id | outbound_routes:read | outboundRoutes.get() · py: outbound_routes.get() |
PATCH /v1/outbound-routes/:id | outbound_routes:write | outboundRoutes.update() · py: outbound_routes.update() |
DELETE /v1/outbound-routes/:id | outbound_routes:write | outboundRoutes.delete() · py: outbound_routes.delete() |
