Egress trunks
Path: /admin-settings → Egress Trunks tab
Egress trunks route outbound SIP calls to external carriers. When an AI agent calls transfer(), Kamailio uses the trunk linked to the call's base number to determine carrier, transport, authentication, caller ID, and codecs.
Runtime model
General
| Field | Required | Description |
|---|---|---|
| Name | Yes | Friendly name (e.g. "Deutsche Telekom"). |
| Trunk ID | Yes | Technical identifier (lowercase, unique). |
| SIP URI | Yes | Carrier SIP URI (e.g. sip:carrier.example.com:5060). |
| Enabled | Yes | Master toggle. |
| Priority | No | Higher = preferred when multiple trunks are linked. Default 50. |
Transport
| Field | Required | Description |
|---|---|---|
| Transport | Yes | udp / tcp / tls. |
Authentication
| Method | How it works | Prerequisites | Use case |
|---|---|---|---|
ip_only | Carrier trusts by IP. | — | Simple trusted carriers. |
digest | Standard SIP digest (401 / 407 challenge). | Auth User + Pass. | Most carriers. |
registration | Persistent SIP REGISTER with carrier. | Auth User + Pass. | Carriers that require register-before-invite. |
ip_and_digest | Both IP and digest. | Allowed IPs + Auth User + Pass. | Hardened. |
tls_mutual | Client TLS cert. | Transport=tls + TLS Cert variable. | mTLS carriers. |
| Field | Conditional | Description |
|---|---|---|
| Auth User | digest / registration | Username. |
| Auth Pass | digest / registration | Password (encrypted). |
| Auth Realm | digest / registration | SIP realm. |
| TLS Cert Variable | tls_mutual | Team variable (type secret) holding the client cert. |
Caller ID
| Field | Description |
|---|---|
| Caller ID Mode | passthrough (original caller), base_number (the base number itself), override (custom value). |
| Caller ID Override | Required 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
| Field | Default | Description |
|---|---|---|
| Max Concurrent Calls | 0 (unlimited) | Cap. |
| Codec Preferences | ["PCMA", "PCMU"] | Priority order. |
Base number linking
| Field | Description |
|---|---|
| Base Numbers | Multi-select. A base number can link multiple trunks; highest priority wins. |
You can also link from the Base numbers edit form via "Outbound Trunk (Egress)".
Workflows
Create an egress trunk
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.
Reference examples
Deutsche Telekom (digest)
| Setting | Value |
|---|---|
| SIP URI | sip:sip-trunk.telekom.de:5060 |
| Transport | udp |
| Auth Method | digest |
| Caller ID Mode | base_number |
| Codec Preferences | ["PCMA", "PCMU"] |
Twilio (IP auth + TLS)
| Setting | Value |
|---|---|
| SIP URI | sip:your-trunk.pstn.twilio.com |
| Transport | tls |
| Auth Method | ip_only |
| Caller ID Mode | override |
| Caller ID Override | +14155551234 |
Carrier with registration
| Setting | Value |
|---|---|
| SIP URI | sip:registrar.carrier.example.com |
| Transport | udp |
| Auth Method | registration |
| Caller ID Mode | passthrough |
See also
- SIP trunks — inbound counterpart.
- Base numbers — link from the base-number side.
- TelPro operations — runtime.