Skip to main content
Version: 0.9.13

Egress routing

Path: /admin-settings/egress

The Egress tab is a unified Trunks | Pools surface. Trunks are individual carrier or PBX destinations; pools group trunks for round-robin or priority-failover transfer routing. The same layout appears on the team Settings → Team tab for team-scoped objects — see Team overview.

Legacy deep links /admin-settings/egress-trunks and /admin-settings/egress-routes open this tab on the Trunks or Pools sub-tab respectively.

When a flow, managed LLM callback, failover policy, or AI tool requests a transfer, Kamailio uses egress state linked to the call's base number (or pool routing key) to determine carrier, transport, authentication, caller ID, codecs, and failover members.

Use Force re-sync in the tab bar only as a recovery action when Redis routing cache is suspected stale. Ordinary saves auto-sync trunks, pools, and base-number links.

How transfers use egress

Egress configuration answers one question for outbound transfers: how does Delphi reach the carrier or PBX for the outbound leg? That applies to canvas Transfer nodes, managed LLM transfer actions, failover handoffs, and provider callbacks — they all share the same runtime validation and TelPro routing path.

Before a transfer can work

  1. The call's endpoint should have an Egress Base Number when the endpoint type supports outbound transfers (Phone and Web Voice). That base number is the outbound identity Kamailio uses on the SIP leg.
  2. At least one trunk must exist, linked either directly to that base number or through a pool that references the base number.
  3. Platform or team transfer restrictions must allow the target (premium numbers, country codes, and so on).
  4. For managed LLM transfers, the flow must enable the managed transfer action and allow the requested method (sip_refer, sip_invite, and so on).

If any of these are missing, the transfer fails at runtime even when the flow graph looks correct.

How the transfer target picks a route

Target shapeEgress behavior
Phone number or tel: URIRequires egress routing. The flow can select an explicit pool (routingPool / Route ID) or fall back to the default base-number pool (trunks linked directly to the egress base number by priority).
Full sip: or sips: URIRoutes by the URI host/domain. Pool selection is not used; TelPhi/TelSys send the outbound leg toward that SIP destination directly.
Managed callback transferTargetSame rules as above — number-like targets need a pool or default trunk link; full SIP URIs bypass pool lookup. See Managed callback actions.

In the Flow Designer, the Egress route dropdown on transfer settings stores routingPool when you pick a pool. Leaving it on Default base-number pool uses trunks linked to the base number without naming a pool explicitly.

When a pool is selected for a number transfer, runtime carries the pool's Route ID (for example via X-Delphi-Egress-Route) together with the base-number context so Kamailio can resolve the correct member trunks.

What happens inside a pool

Once Kamailio resolves a pool, member trunks execute the actual outbound SIP:

  • Priority / failover — try the highest-priority trunk first; move to the next member if the carrier or PBX rejects or does not answer.
  • Round robin — spread attempts across healthy members.

Trunk-level settings (transport, digest/registration auth, caller ID mode, codecs) apply to whichever member trunk handles that attempt.

Runtime path

After validation, TelPhi hands off to TelSys, which presents the outbound INVITE (or REFER) to Kamailio with the base-number and pool context. Kamailio reads the synced Redis payload, picks the trunk (or pool member), and sends the carrier-facing SIP. Inspect the conversation Debug tab SIP ladder to confirm which trunk and headers were used.

Common failure modes

SymptomLikely cause
Transfer fails immediatelyTarget blocked by transfer restrictions, or managed transfer not enabled.
"No egress route" for a number targetNo pool selected and no trunks linked to the egress base number.
Wrong carrier or caller IDStale Redis state, incorrect pool member priority, or trunk caller-ID mode.
SIP URI transfer fails differentlyDNS/host routing issue — pool config is bypassed; check URI and carrier path.

General

FieldRequiredDescription
NameYesFriendly name (e.g. "Deutsche Telekom").
Trunk IDYesTechnical identifier (lowercase, unique).
SIP URIYesCarrier SIP URI (e.g. sip:carrier.example.com:5060).
EnabledYesMaster toggle.
PriorityNoHigher = preferred when multiple trunks are linked. Default 50.

Transport

FieldRequiredDescription
TransportYesudp / tcp / tls.

Authentication

MethodHow it worksPrerequisitesUse case
ip_onlyCarrier trusts by IP.Simple trusted carriers.
digestStandard SIP digest (401 / 407 challenge).Auth User + Pass.Most carriers.
registrationPersistent SIP REGISTER with carrier.Auth User + Pass.Carriers that require register-before-invite.
ip_and_digestBoth IP and digest.Allowed IPs + Auth User + Pass.Hardened.
tls_mutualClient TLS cert.Transport=tls + TLS Cert variable.mTLS carriers.
FieldConditionalDescription
Auth Userdigest / registrationUsername.
Auth Passdigest / registrationPassword (encrypted).
Auth Realmdigest / registrationSIP realm.
TLS Cert Variabletls_mutualTeam variable (type secret) holding the client cert.

Caller ID

FieldDescription
Caller ID Modepassthrough (original caller), base_number (the base number itself), override (custom value).
Caller ID OverrideRequired when mode is override.
Per-transfer override

The agent's transfer() tool can pass a callerId parameter that takes priority over the trunk's mode.

Technical

FieldDefaultDescription
Max Concurrent Calls0 (unlimited)Cap.
Codec Preferences["PCMA", "PCMU"]Priority order.

Base number linking

FieldDescription
Base NumbersMulti-select. A base number can link multiple trunks; priority controls selection and failover order.

You can also link from the Base numbers edit form via "Outbound Trunk (Egress)".

Changes to egress trunks and base-number links auto-sync to Kamailio's Redis routing state. If a transfer still follows an old route, check TelPro operations and verify the voiceai:egress:<num> payload.

Egress pools (Pools sub-tab)

Open the Pools sub-tab to manage egress route pools. A pool groups one or more trunks under a stable Route ID that flows and managed callbacks reference.

FieldRequiredDescription
NameYesFriendly label (e.g. "Twilio staging").
Route IDYesTechnical key (twilio_staging) used in flow transfer settings and managed callback routingPool fields.
Base NumberYesOutbound identity and fallback route key for the pool.
StrategyYesround_robin or priority_failover.
EnabledYesMaster toggle.
PriorityNoPool priority when multiple pools compete. Default 50.
Member trunksYesOne to sixteen trunks, each with a member priority. No duplicate trunk per pool.
StrategyBehavior
Priority / failoverTry the highest-priority available member first, then fall through when routing fails.
Round robinRotate across healthy members to spread transfer attempts.

Managed callbacks can select a pool with transferRoutingPool / routingPool. Full sip: or sips: URI targets route by URI host instead of using a number-only pool lookup.

Create an egress pool

  1. Open PoolsNew.
  2. Set Name, Route ID, base number, and strategy.
  3. Add member trunks (create trunks first on the Trunks sub-tab if needed).
  4. Enable and save — Redis sync runs automatically.

Workflows

Create an egress trunk

Open the Trunks sub-tab, then:

Click Create → Name + Trunk ID + SIP URI → Transport → Auth Method + credentials → Caller ID Mode → optional Codec Preferences / Max Concurrent → link base numbers → enable → save. Changes auto-sync to Redis; for registration trunks, Kamailio kicks off REGISTER automatically.

Verify transfer routing

After changing a trunk or base-number link:

  1. Place a transfer test call from a published flow or managed LLM callback.
  2. Open the conversation's Debug tab and inspect the SIP ladder.
  3. Check whether the outbound leg used the expected trunk, caller ID, and transfer headers.
  4. If the ladder is missing or stale, ask the operator to inspect voiceai:egress:<num> on Redis.

Reference examples

Deutsche Telekom (digest)

SettingValue
SIP URIsip:sip-trunk.telekom.de:5060
Transportudp
Auth Methoddigest
Caller ID Modebase_number
Codec Preferences["PCMA", "PCMU"]

Twilio (IP auth + TLS)

SettingValue
SIP URIsip:your-trunk.pstn.twilio.com
Transporttls
Auth Methodip_only
Caller ID Modeoverride
Caller ID Override+14155551234

Carrier with registration

SettingValue
SIP URIsip:registrar.carrier.example.com
Transportudp
Auth Methodregistration
Caller ID Modepassthrough

See also