UCBC
Admin Guide

Trunks and Gateways

18 min read

A Trunk (also called a Gateway) is your connection to a telephone carrier (an "ITSP," or Internet Telephony Service Provider) for sending and receiving outside phone calls. Without at least one working trunk, your system can only make internal calls between extensions — it cannot reach the public phone network, and the public phone network cannot reach you.

UCBC gives you two related places to manage this:

  • Trunk ITSP — the main, carrier-facing management screen. Use this for your organization's shared carrier connections, the phone numbers that ride on them, and per-customer call limits.
  • Gateways — a general-purpose list of custom SIP connections. Carrier trunks created on the Trunk ITSP screen are hidden from this list on purpose (they're managed only from Trunk ITSP), so anything you see on the Gateways screen is a connection someone created by hand for a specific purpose.

This article covers both.

Overview#

Trunk ITSP is organized into tabs:

  • Trunk — the list of your carrier trunks (connections to your telephone providers), with a Channels (CC) sub-tab for setting per-customer call limits.
  • DID/DOD — the phone numbers associated with your trunks: inbound numbers customers can be reached at, and outbound routing/caller-ID rules.
  • IP Permissions — extra trusted IP addresses for carriers that send traffic from more than one address.
  • Number Store — your inventory of every DID number you own, with a usage bar showing how many are already assigned to customers and how many are still free.

A Gateway (on the plain Gateways screen) is the same underlying idea — a SIP connection to some other system — but created and managed individually, outside the Trunk ITSP workflow.

The Gateways list
The Gateways list

How to Create a Gateway (Gateways screen)#

  1. Go to Gateways and click Add.
  2. Fill in the required fields:
    • Gateway — a name to identify this connection.
    • Proxy — the hostname or IP address (and optionally port) of the other side, in the form host:port.
    • Register — set to True if this connection must log in with a username and password; set to False if the other side trusts your server's IP address directly (no login).
    • If Register is True, also enter Username and Password.
    • Expire Seconds and Retry Seconds — how long a registration lasts before renewing, and how long to wait before retrying a failed connection.
  3. Click Advanced to reveal optional fields if you need them (see Field Reference below) — most connections never need these.
  4. Set Context and Profile (leave at their defaults unless you have a specific reason to change them) and make sure Enabled is True.
  5. Implicit Use ITSP (console users only, default False) — leave it at False if this customer's calls should go only through this gateway. See the next section.
  6. Click Save.

vPBX Customers With Their Own Gateway (Implicit Use ITSP)#

By default every customer uses your shared ITSP trunk: the Default Route and any other outbound rules on the DID/DOD tab apply to every domain automatically, so a new customer can make and receive outside calls without any extra setup. SIP Trunk customers always work this way.

A vPBX customer who likes UCBC's features but already has their own carrier can instead bring that carrier: add it as a Gateway assigned to their domain, then create their own Outbound Routes to it, and point their numbers at it with their own Inbound Routes. Their calls in and out then go over their own provider.

As soon as a vPBX domain has a gateway of its own, UCBC stops using the shared ITSP routes for that domain — its outbound calls go only through its own Outbound Routes. This is controlled by the gateway's Implicit Use ITSP setting:

Implicit Use ITSPWhat happens
False (default)The domain uses only its own gateway. The shared ITSP DID/DOD outbound rules are skipped for it.
TrueThe domain also uses the shared ITSP routes and trunk, like a customer without a gateway — set this when the customer asks to use your ITSP as well.
  • Only console users see and can change Implicit Use ITSP. Anyone else who creates or edits a gateway never sees it, and a new gateway always starts at False.
  • If a domain has several gateways, setting True on any one of them is enough.
  • A disabled gateway still counts — switching their own gateway off does not silently move the customer's calls (and their cost) onto your ITSP. Delete the gateway, or set Implicit Use ITSP to True, to put them back on the ITSP.
  • Outbound rules on the DID/DOD tab that are assigned to one specific domain are an explicit choice for that domain and always apply.

How to Create an ITSP Trunk (Trunk ITSP screen)#

Search bars: the Trunk, DID/DOD, IP Permissions, and Number Store tabs each have a search bar above their list — Trunk searches name, proxy, and description; IP Permissions searches the IP address and description. On the CC tab, type in the box next to Domain to narrow the domain list (press Enter to open the first match).

  1. Go to Trunk ITSP (defaults to the Trunk tab) and click Add.
  2. Enter a Trunk Name.
  3. Enter the Proxy — your carrier's SIP hostname or IP address, e.g. sip.my-carrier.com.
  4. Set Register:
    • True — your carrier requires you to log in with a username/password. Enter Username, Password, and optionally Auth Username and Realm.
    • False — your carrier authenticates you by IP address instead (no login). This is the most common setup for business-grade carrier trunks.
  5. Optionally set Channels (maximum simultaneous calls this trunk itself allows) and Codec Preferences (e.g. PCMA,PCMU,G722).
  6. Optionally add PSTN Number Manipulation rows if your carrier needs dialed numbers reformatted (see Tips below).
  7. Make sure Enabled is True, then click Save.
An ITSP trunk's DID/DOD tab
An ITSP trunk's DID/DOD tab

DID/DOD Tab — Phone Numbers#

This tab manages two kinds of numbers:

  • Inbound (DID) — a real phone number your carrier gave you, which rings into a specific customer.
  • Outbound (DOD) — a rule that decides which trunk an outbound call goes out on, based on the number being dialed.

Searching: use the search bar above the DID/DOD list to find an entry by number, ITSP trunk name, assigned domain, or description. Numbers are matched on their digits, so 0308048951, 308048951 and +233 30 804 8951 all find +233308048951. Click Reset to show everything again.

How to add an inbound DID#

  1. Go to Trunk ITSP > DID/DOD and click Add.
  2. Set Direction to Inbound.
  3. Enter the DID Number. You can enter a single number, a comma-separated list, or a range (e.g. +15551230000-+15551230010) — every number in it becomes its own entry. A live counter shows how many numbers you just entered.
  4. Choose the ITSP Trunk this number arrives on.
  5. Choose the Assigned Domain — the customer this number belongs to. Leave unassigned until a customer needs it.
  6. Save.

How to add an outbound routing rule (DOD)#

  1. Click Add, set Direction to Outbound.
  2. Enter a Destination Pattern (a regex matching dialed numbers, e.g. ^1800) or, optionally, a Source Pattern to also require a specific caller.
  3. Choose the ITSP Trunk this rule should send matching calls out on.
  4. If this should be the catch-all used whenever a dialed number doesn't match any more specific rule, set Default Route to True (only one default route can be enabled at a time, and it applies platform-wide).
  5. Save.

What is a "Default Route"? If you only have one carrier trunk, you don't need per-number outbound rules — just mark one outbound entry as the Default Route, and every outbound call that doesn't match a more specific pattern will use it automatically.

These rules are shared: one Default Route serves every domain on the server — there is no separate copy per customer, and nothing to set up when you add a new customer. The only domains that skip them are vPBX customers using their own gateway with Implicit Use ITSP set to False (see above).

IP Permissions Tab#

Some carriers send signaling traffic from more than one IP address (for example, a backup or secondary address). Each trunk's own Proxy address is already trusted automatically — use this tab only to add extra trusted addresses.

  1. Go to Trunk ITSP > IP Permissions, click Add.
  2. Enter the carrier's IP Address / CIDR (e.g. 102.22.20.162 or 102.22.20.0/24).
  3. Add a Description and save.

Number Store Tab — Your DID Inventory#

The Number Store holds every DID number you own, so you can see at a glance whether you are running out. You never have to update it by hand: as soon as a number is assigned to a customer on the DID/DOD tab, it shows here as Assigned, with that customer's domain; every other number shows as Available.

At the top of the tab:

  • Total Numbers, Assigned, Available, and Usage (the percentage assigned).
  • A usage bar — green below 70%, orange from 70%, red from 90%. At 90% or more a "running out of DID numbers" warning appears.
  • If your numbers come from more than one trunk, a separate bar for each trunk.

How to add numbers#

  1. Go to Trunk ITSP > Number Store and click Add.
  2. In Numbers, type or paste your numbers — one number, a comma-separated list, one per line, or a range such as +233308048900-+233308048999 (both ends need the same number of digits; up to 1,000 per range). A live counter shows how many numbers you entered. Up to 10,000 numbers per save.
  3. Or, under Import File, choose a CSV or TXT file with the numbers in its first column (a row may also hold a list or a range; a header row is ignored). You can use both at once.
  4. Optionally choose the ITSP Trunk the numbers come from and add a Description (for example the carrier's order reference).
  5. Click Save. Numbers already in the store are skipped, and the message tells you how many were added and skipped.

How to import numbers from Excel#

Use Import to load a whole list from a spreadsheet, either adding to the store or replacing it.

  1. Go to Trunk ITSP > Number Store and click Import (next to Export).
  2. Click Download Template to get number_store_template.xlsx. Fill in the Numbers sheet:
    • Column A - DID Number (required): one number per row, or a range (+233308048900-+233308048999) or comma-separated list in one cell. The column is formatted as text, so a leading + or 0 is kept.
    • Column B - ITSP Trunk (optional): choose from the drop-down of this server's ITSP trunks, or leave blank.
    • Column C - Description (optional).
    • Keep the header row. The Instructions sheet repeats these rules and lists the trunks.
  3. Back on the Import page, choose the file (.xlsx or .csv, up to 10 MB). For an old .xls file, open it in Excel and use Save As > Excel Workbook (.xlsx) first.
  4. Choose the Import Mode:
    • Append adds the file's numbers to the numbers already in the store. Numbers already in the store, or repeated in the file, are skipped.
    • Overwrite removes every number from the store and keeps only the numbers in the file. Tick the confirmation box to use it.
  5. Click Import.

The whole file is checked before anything changes. If any row is wrong (not a valid number or range, or a trunk name that doesn't exist), nothing is imported, and the page lists each row to fix. Up to 50,000 numbers per file.

Overwrite only changes the Number Store list. It never changes the DID/DOD tab, routing, or which domain a number is assigned to. A number assigned on the DID/DOD tab shows as Assigned again as soon as it is back in the store.

Numbers already on the DID/DOD tab#

If some numbers on the DID/DOD tab aren't in the store yet, the tab tells you how many and offers Add Them to the Store — one click copies them in, with their trunk.

Finding, exporting, and removing numbers#

  • Filter the list by Available / Assigned, or search by number, domain, trunk, or description.
  • Export downloads the whole store as a CSV, including each number's status and domain.
  • Import loads numbers from an Excel or CSV file. See How to import numbers from Excel above.
  • Select numbers and click Delete to remove them from the store. This only removes them from the inventory — it does not touch the DID/DOD tab or any customer's routing.

Numbers are matched on their last 9 digits, so the same number written in international and national form (+233 30 804 8966 and 030 804 8966) counts as one number.

Channels (CC) Tab — Per-Customer Call Limits#

This tab controls how many simultaneous outbound calls one customer (domain) is allowed to place out through your shared carrier trunk at the same time.

How to set a channel limit#

  1. Go to Trunk ITSP > Trunk, then open the Channels sub-tab.
  2. Choose the Domain (the customer) from the dropdown.
  3. Choose the Main Trunk (the shared carrier trunk) — if only one exists, it's selected automatically.
  4. The system shows how this domain reaches that trunk:
    • Shared ITSP Route — the usual case: the domain has no outbound route of its own and uses the shared DID/DOD rules (e.g. Any (Default Route)). Set the limit directly; it applies to this domain only.
    • Outbound Route — the domain has its own outbound route to this trunk; its name is shown and the limit is set on that route.
    • This domain does not use the ITSP trunk — a vPBX customer on its own gateway with Implicit Use ITSP set to False. There is nothing to limit here; their own gateway's Channels field applies instead.
  5. Enter the Channels value — the maximum number of simultaneous outbound calls this customer may place through this trunk. Leave at 0 for unlimited.
  6. Click Save.

What happens when the limit is reached: once a customer has that many outbound calls active at the same time on this trunk, any additional outbound call attempt is rejected as busy, exactly as if the line were engaged. It does not affect inbound calls or calls on other trunks.

How to Edit a Trunk/Gateway#

  • Gateways screen: click a row to open it, change any field, and save.
  • Trunk ITSP > Trunk tab: click a trunk to edit its connection details, or use the row's action links to toggle Enabled, toggle Register, or Retry a connection that isn't currently registered.

Changes take effect immediately. Saving a trunk or gateway (on Trunk ITSP, Gateways, or Customer Trunks, including an import) restarts that one connection with the settings you just saved — there is no separate "apply" or restart step. Only the connection you saved is restarted; a new call placed at the exact moment of the save may need to be retried.

How to Delete a Trunk/Gateway#

  • Gateways screen: select the row's checkbox and click Delete. A trunk created through Trunk ITSP cannot be deleted here — it shows a lock icon instead of a checkbox and must be removed from the Trunk ITSP screen.
  • Trunk ITSP > Trunk tab: select the trunk and click Delete.
  • DID/DOD tab: select one or more numbers/rules and click Delete.
  • IP Permissions tab: select the entry and click Delete.

Field Reference#

Gateway (Gateways screen)#

FieldDescription
GatewayName identifying this connection.
Username / PasswordLogin credentials — only needed if Register is True.
ProxyHostname or IP address (and port) of the other side.
RegisterTrue: this connection logs in with a password. False: trusted by IP address only.
Expire SecondsHow long a registration lasts before it must renew.
Retry SecondsHow long to wait before retrying after a failed connection.
Auth Username / RealmAdvanced authentication identity fields some carriers require.
ChannelsMaximum simultaneous calls on this connection (0 = unlimited).
Codec PreferencesPreferred audio codecs, e.g. PCMA,PCMU,G722.
Context / ProfileInternal routing/technical settings — leave at default unless instructed otherwise.
EnabledTurns the connection on or off.
Implicit Use ITSPConsole users only. False (default): the domain this gateway belongs to uses only its own gateway and skips the shared ITSP routes. True: the domain also uses the ITSP routes and trunk.
DescriptionFree-text notes.

ITSP Trunk#

FieldDescription
Trunk NameName identifying this carrier trunk.
ProxyCarrier's SIP hostname or IP address.
RegisterTrue: logs in with Username/Password. False: carrier trusts your IP address.
Username / PasswordOnly used when Register is True.
Auth Username / RealmOptional authentication identity fields.
ChannelsMaximum simultaneous calls on this trunk overall.
Codec PreferencesPreferred audio codecs list.
PSTN Number ManipulationStrip/Prepend rules to reformat dialed numbers for this carrier (applies only to this trunk's own DID/DOD routing).
EnabledTurns the trunk on or off.

DID/DOD Entry#

FieldDescription
DirectionInbound (a real number) or Outbound (a routing rule).
DID Number (inbound)The phone number provided by the carrier — single, list, or range.
Destination Pattern (outbound)A number pattern that routes matching calls via this trunk.
Source Pattern (outbound)Optional — also requires the caller's number to match.
ITSP TrunkWhich carrier trunk this entry belongs to.
Assigned Domain (inbound only)Which customer this number is assigned to.
Default Route (outbound only)Catch-all rule used when no more specific pattern matches. Only one may be active at a time.
EnabledTurns the entry on or off.

Number Store#

FieldDescription
NumbersNumbers to add: single, comma-separated, one per line, or ranges.
Import FileOptional CSV/TXT file with the numbers in the first column.
ITSP TrunkOptional — the trunk these numbers come from (used for the per-trunk bars).
DescriptionOptional note saved on every number added in this batch.
Import File (Import page)An .xlsx (first sheet) or .csv file: column A DID number, column B ITSP trunk, column C description. Use Download Template for a ready-made sheet.
Import ModeAppend adds to the store and skips numbers already there; Overwrite replaces the whole store with the file (needs confirmation).
Status (list)Assigned — assigned to a domain on the DID/DOD tab; Available — not assigned. Worked out automatically.

IP Permission Entry#

FieldDescription
IP Address / CIDRThe carrier's additional trusted address or network.
EnabledTurns the entry on or off.
DescriptionFree-text notes.

Channel Limit (CC tab)#

FieldDescription
DomainThe customer this limit applies to.
Main TrunkThe shared carrier trunk the limit applies to.
ChannelsMaximum simultaneous outbound calls this customer may place through the trunk. 0 = unlimited. Calls beyond this limit are rejected as busy.

Tips & Common Issues#

  • A trunk shows "Stopped" but should be working: check that it's Enabled, and if it registers, check the registration status; if it's IP-authenticated, confirm the carrier's address matches the Proxy field (or is listed under IP Permissions).
  • CC tab says "No outbound route to this trunk exists yet": the domain has no route of its own and no shared DID/DOD rule sends calls to this trunk — check that the trunk has an enabled outbound rule (for example the Default Route) on the DID/DOD tab.
  • CC tab says "This domain does not use the ITSP trunk": the customer is a vPBX domain on its own gateway. If they should use your ITSP too, a console user sets Implicit Use ITSP to True on their gateway.
  • A customer with their own gateway can't call out: with Implicit Use ITSP at False their calls only use their own Outbound Routes — make sure they have one pointing at their gateway.
  • A number shows Available but a customer is using it: check its DID/DOD entry has an Assigned Domain — the Number Store only counts a number as Assigned when the DID/DOD tab assigns it to a domain.
  • Only one Default Route allowed: if you need to switch which outbound rule is the catch-all, disable or un-default the old one first.
  • A carrier uses more than one signaling IP: add the extra address(es) under IP Permissions — you do not need to change the trunk's own Proxy field.
  • Can't delete a trunk from the Gateways screen: trunks created through Trunk ITSP are locked there on purpose — delete them from Trunk ITSP > Trunk instead.
💬 Chat with Ace: SIITS AI