Configuration
sipbridge is configured in two places. Command-line flags set the listeners, TLS identities and SIP policy. Environment variables choose where state is kept. There is no configuration file, and a flag cannot be set through the environment.
Settings are read once at startup, so changing one means restarting the process. The exception is certificate and key files, which are re-read while running (see Identities and TLS).
A minimal invocation needs an instance name, an advertised address, the SIP TLS files and control authentication; Getting Started shows one.
Command-line flags
sipbridge [flags]Listeners
| Flag | Default | Description |
|---|---|---|
--sip-listen | :5061 | Public SIP over TLS listener. Always enabled. |
--sip-plain-listen | :5060 | Public SIP over UDP and TCP, on the same address. An empty value disables both. |
--control-listen | :8443 | Controller WebSocket listener. Plain transport requires an explicit loopback address. |
--admin-listen | 127.0.0.1:8800 | Plain-HTTP health and metrics listener with no authentication. See Admin Endpoints. |
--sip-interface | empty | Name of a network interface. When set, the public SIP listeners and outbound TCP/TLS dials bind its single global-unicast IPv4 address. |
Identities and credentials
| Flag | Default | Description |
|---|---|---|
--instance | none, required | Stable name for this process, for example a StatefulSet pod name such as sipbridge-0. Must match [A-Za-z0-9_.:@+-]{1,96}. sipbridge adds a random per-start ID (the "epoch") so a restarted process is never mistaken for its predecessor. |
--control-auth | mtls | mtls or explicit bearer. There is no unauthenticated mode or fallback. |
--control-transport | tls | tls or explicit plain; plain control requires bearer authentication and a loopback listener. |
--control-cert, --control-key | required with TLS | PEM server certificate and key for the control listener; omit for plain transport. |
--client-ca | required with mTLS | PEM trust bundle for controller client certificates. Not used in bearer mode. |
--allowed-client-uri | required with mTLS | Exact comma-separated controller URI SANs, without wildcards, empty entries or spaces. Not used in bearer mode. |
--control-bearer-token-file | required with bearer | File containing 32–4,096 printable non-space ASCII bytes; one terminal LF or CRLF is accepted. Renewed tokens are reloaded for new connections. |
--control-principal | required with bearer | Printable ASCII identity, 1–256 bytes, that sipbridge assigns to any controller presenting the token. Keep it stable across token rotations. |
--sip-cert, --sip-key | none, required | PEM certificate and key for the public SIP TLS listener. |
Public advertisement
| Flag | Default | Description |
|---|---|---|
--advertise | none, required unless --sip-interface is set | Public host:port used for TLS Via/Contact advertisement. With --sip-interface and no value, it defaults to the bound TLS listener address. |
--advertise-plain | TLS advertised host plus the plain listener port | Public host:port for UDP/TCP advertisement, for example a NAT or VIP address. |
--contact | sip:sipbridge@<advertise>;transport=tls | Public Contact URI template. |
These addresses are what sipbridge writes into the Via and Contact headers it generates, so they must be reachable by your SIP clients. Instances that share Redis state must all advertise the same addresses, because one of them may continue a call that another started. Changing the advertisement never moves an existing dialog to a different transport or connection.
Routing and SIP policy
| Flag | Default | Description |
|---|---|---|
--initial-controller | empty | Instance ID of the controller that should be offered new requests while it is ready. Without it, new requests rotate across ready controllers. Requests for an existing call always go to the controller that owns the call. |
--allow-register | true | false rejects every inbound REGISTER with 405 without consulting the state store or a controller. Useful on an instance that only faces carriers. |
--allow-subscribe | true | false rejects every inbound SUBSCRIBE with 405 in the same way. |
--require-auth-methods | empty | Comma-separated subset of REGISTER, INVITE, SUBSCRIBE (uppercase) that receive a local initial digest challenge when they carry no parseable credentials. Requires controller support; see Local challenges. |
--sip-capture-url | empty | Optional edge-local SIP capture collector. See Observability. |
Shutdown
| Flag | Default | Description |
|---|---|---|
--sip-withdrawal-grace | 3s | Time to keep accepting and serving SIP after withdrawing readiness on SIGTERM, 0 to 60 seconds. |
--sip-drain-timeout | 65s | Total time from SIGTERM to process exit, including completion reporting. Must exceed the grace and be at most 2 minutes. |
See Replacing a process for what happens during the drain.
Information
| Flag | Description |
|---|---|
--version | Print sipbridge <version> and exit. |
--state-schema | Print the receipt of the private storage schema this build uses, and exit. Useful for checking that Redis-sharing instances are compatible. |
Startup fails if --require-auth-methods names a method you also disabled, an unknown method or the same method twice. The 405 response's Allow header lists the methods this process still accepts.
OPTIONS requests are always answered by sipbridge itself, without asking a controller: 200 with the enabled methods while a controller is ready, 503 otherwise or while draining. There is no setting to forward them.
Validation rules
--instanceand an advertisement must be present.--sip-interfacemust name an interface with exactly one global-unicast IPv4 address. A listener with a fixed host must use that address; listeners must use fixed ports.--sip-capture-urlmust behttp://<host>/loki/api/v1/pushwithout credentials, query or fragment. When the plain listener is enabled it must be bound to a specific IP address, not:5060or0.0.0.0.--advertise-plainmust use a numeric port from 1 to 65535.- Configured TLS certificates must be valid now. mTLS also requires a nonempty client trust bundle and URI allowlist. Bearer mode rejects client CA/URI settings.
- Plain control rejects control TLS flags and non-loopback listeners. Public SIP TLS remains separately enabled and still needs its certificate and key.
Environment variables
Environment variables choose and configure the state store. With none of them set, sipbridge keeps state in memory, which is all a single instance needs. State Backends explains the trade-offs.
Common
| Variable | Default | Description |
|---|---|---|
SIPBRIDGE_STATE_BACKEND | memory | memory or redis. Any other value fails startup. |
SIPBRIDGE_STATE_IDENTITY_KEY | random per process (memory only) | Standard base64 of 32 to 256 bytes. Required for Redis, where every instance sharing a namespace must use the same key. |
SIPBRIDGE_STATE_NAMESPACE | sipbridge | Name of the state namespace; Redis-backed instances with matching settings and the same namespace share state. It is also reported to controllers as stateAuthority.service. Pattern [A-Za-z0-9_.:@+-]{1,96}. |
SIPBRIDGE_STATE_GENERATION | Redis: built-in generation (1). Memory: default. | Optional override reported as stateAuthority.generation. For Redis it selects a separate keyspace within the pool. Leave it unset to follow the image's generation. See Redis upgrades. |
SIPBRIDGE_STATE_PREFIX | sipstate:v1 | Binary Redis root prefix; full root is prefix, namespace and generation separated by colons. Pattern [A-Za-z0-9_.:-]{1,96}. |
SIPBRIDGE_STATE_PARTITIONS is no longer used; setting it fails startup.
Memory only
Setting either variable with SIPBRIDGE_STATE_BACKEND=redis fails startup.
| Variable | Default | Description |
|---|---|---|
SIPBRIDGE_MEMORY_MAX_GROUPS | 128 | Limits inbound and outbound contexts separately. Accepts 1 to 1,048,576. |
SIPBRIDGE_MEMORY_MAX_BYTES | 1073741824 (1 GiB) | Bytes of retained state plus room reserved for work already accepted, at least 8 MiB. The Go runtime adds its own overhead. See Capacity. |
Redis only
Setting any of these without SIPBRIDGE_STATE_BACKEND=redis fails startup. That is deliberate: a deployment that supplies Redis settings but forgets to select Redis stops immediately instead of quietly running on memory.
| Variable | Description |
|---|---|
SIPBRIDGE_REDIS_ADDRESS | Primary host:port. Use either this or Sentinel discovery. |
SIPBRIDGE_REDIS_SENTINELS | Comma-separated Sentinel host:port list, at most 16. |
SIPBRIDGE_REDIS_MASTER | Sentinel master name. Required with SIPBRIDGE_REDIS_SENTINELS. |
SIPBRIDGE_REDIS_USERNAME, SIPBRIDGE_REDIS_PASSWORD | Data connection credentials. |
SIPBRIDGE_REDIS_SENTINEL_USERNAME, SIPBRIDGE_REDIS_SENTINEL_PASSWORD | Sentinel discovery credentials. |
SIPBRIDGE_REDIS_CA_FILE | PEM trust bundle for Redis TLS. |
SIPBRIDGE_REDIS_SERVER_NAME | Verified Redis TLS server name. |
SIPBRIDGE_REDIS_ALLOW_PLAINTEXT | true permits plaintext, only when neither CA nor server name is set. Intended for local testing. |
Fixed values
Some limits are compiled in and cannot be changed: the number of control sessions, heartbeat timing, control timeouts, the 4,096 limit on public TCP/TLS connections, per-call state limits and the certificate reload interval. Limits and Timers lists them.