Skip to content

Trunks and Incoming Routing

By default a call to an account rings the device registered with the account’s credentials. A trunk is a SIP destination of the account itself, such as the customer’s PBX or gateway, with one or more addresses tried in order. Incoming Routing then decides, per DID of the account and for on-net calls, whether the call goes to the registered device or to one of the trunks.

On the Accounts screen open Actions → Services → Trunks or Incoming Routing of the account. In edit mode the account form has the same two links in its header. The URLs are /trunks.php?i_account=<id> and /incoming_routes.php?i_account=<id>.

The account manages its own trunks in its portal under Routing → Trunks and changes the destination and the DID translation rule of the incoming routes you mark Self Managed under Routing → Incoming Routing.

Screenshot "admin-panel/trunk-form" has not been generated yet — see scripts/screenshots/screens.yml.

The list shows Status, Name, Description and Destinations (the first three addresses, +N for more). Status is a green check when every destination resolves, a red dot with the names of connections whose host name does not resolve, and a yellow dot for names not resolved yet. Name filters the list with is like / is not like.

  1. Click Add New.
  2. Enter Name and an optional Description.
  3. Under Connections, enter Destination: the IP address or host name of the PBX, for example pbx.example.com.
  4. Enter Username and Password if the PBX asks the switch for SIP digest authentication.
  5. Click the arrow of the row for the advanced fields if you need them.
  6. Add more rows for backup addresses. A new empty row appears as soon as you type in the last one.
  7. Click Save & Close.
Field Meaning
Name Name of the connection inside the trunk. Connection 1, Connection 2 … when empty
Destination IP address or host name the calls are sent to. Rows without a destination are not saved
Username, Password SIP digest credentials the PBX expects
Outbound CLD Number sent to the PBX instead of the dialled one, for example the PBX extension
From Domain Domain placed in the From header instead of the switch IP
Capacity Simultaneous calls allowed to this destination. Empty means unlimited
Max CPS Call attempts per second allowed to this destination. Empty means unlimited
Outbound IP Which of your switch addresses sends the calls. [ Auto ] by default; pick one when the PBX accepts calls only from a known IP
Random Call-Id Replace the Call-ID with a random value so the PBX does not see the caller’s addresses in it

Connections are tried in the order of the rows: the second one takes the call when the first fails, and so on.

Click the name or the pen icon. Remove on a row deletes that connection when you save. The trash icon in the list deletes the trunk with all its connections.

The list has one row per source, created by the switch:

  • On-Net Calls for calls from other accounts of the switch;
  • one row per DID or DID range assigned to the account in the DID Pool, shown as DID <number> or Range <first> - <last>.
Screenshot "admin-panel/incoming-routing" has not been generated yet — see scripts/screenshots/screens.yml.
Column Meaning
Source The DID, the DID range or On-Net Calls
Destination Registered Account (the default) or one of the account’s trunks
Fwd DID Mode DID rows only: how the DID is passed on, see below
Self Managed The account may change the destination in its portal

Source and Destination filter the list. Rows cannot be added or deleted here: assign or release a DID in the DID Pool and its row follows.

  1. Create the trunk first.
  2. Click Edit in the row of the DID.
  3. Select the trunk in Destination.
  4. Select Fwd DID Mode.
  5. Check Self Managed if the customer should be able to switch the DID between the trunk and the phone.
  6. Click Save.

Fwd DID Mode sets the called number (the Request-URI) of the forwarded INVITE:

Mode To the registered account To a trunk
Off The account name is the called number The DID is the called number
Forward DID in URI The DID is the called number The DID is the called number
Diversion Header The account name is the called number; the DID is added in a Diversion header The DID is the called number; the trunk’s Outbound CLD is added in a Diversion header

Use Forward DID in URI when one PBX receives several DIDs and routes on the dialled number.

Edit the On-Net Calls row and select the trunk. Calls from other accounts to this account then go to the PBX instead of the registered device. Fwd DID Mode does not apply to this row.

Download exports the list with the columns Action [U], Id, Source, Destination (trunk ID, empty for the registered account), Forward DID Mode (1 Off, 2 Forward DID in URI, 3 Diversion Header) and Self Managed. Upload takes the file back: rows with U in the first column update the route with that Id; other actions are rejected and returned in an Incoming Routing errors file.