Skip to content

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 ​

sh
sipbridge [flags]

Listeners ​

FlagDefaultDescription
--sip-listen:5061Public SIP over TLS listener. Always enabled.
--sip-plain-listen:5060Public SIP over UDP and TCP, on the same address. An empty value disables both.
--control-listen:8443Controller WebSocket listener. Plain transport requires an explicit loopback address.
--admin-listen127.0.0.1:8800Plain-HTTP health and metrics listener with no authentication. See Admin Endpoints.
--sip-interfaceemptyName 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 ​

FlagDefaultDescription
--instancenone, requiredStable 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-authmtlsmtls or explicit bearer. There is no unauthenticated mode or fallback.
--control-transporttlstls or explicit plain; plain control requires bearer authentication and a loopback listener.
--control-cert, --control-keyrequired with TLSPEM server certificate and key for the control listener; omit for plain transport.
--client-carequired with mTLSPEM trust bundle for controller client certificates. Not used in bearer mode.
--allowed-client-urirequired with mTLSExact comma-separated controller URI SANs, without wildcards, empty entries or spaces. Not used in bearer mode.
--control-bearer-token-filerequired with bearerFile containing 32–4,096 printable non-space ASCII bytes; one terminal LF or CRLF is accepted. Renewed tokens are reloaded for new connections.
--control-principalrequired with bearerPrintable ASCII identity, 1–256 bytes, that sipbridge assigns to any controller presenting the token. Keep it stable across token rotations.
--sip-cert, --sip-keynone, requiredPEM certificate and key for the public SIP TLS listener.

Public advertisement ​

FlagDefaultDescription
--advertisenone, required unless --sip-interface is setPublic host:port used for TLS Via/Contact advertisement. With --sip-interface and no value, it defaults to the bound TLS listener address.
--advertise-plainTLS advertised host plus the plain listener portPublic host:port for UDP/TCP advertisement, for example a NAT or VIP address.
--contactsip:sipbridge@<advertise>;transport=tlsPublic 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 ​

FlagDefaultDescription
--initial-controlleremptyInstance 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-registertruefalse rejects every inbound REGISTER with 405 without consulting the state store or a controller. Useful on an instance that only faces carriers.
--allow-subscribetruefalse rejects every inbound SUBSCRIBE with 405 in the same way.
--require-auth-methodsemptyComma-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-urlemptyOptional edge-local SIP capture collector. See Observability.

Shutdown ​

FlagDefaultDescription
--sip-withdrawal-grace3sTime to keep accepting and serving SIP after withdrawing readiness on SIGTERM, 0 to 60 seconds.
--sip-drain-timeout65sTotal 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 ​

FlagDescription
--versionPrint sipbridge <version> and exit.
--state-schemaPrint 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 ​

  • --instance and an advertisement must be present.
  • --sip-interface must 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-url must be http://<host>/loki/api/v1/push without credentials, query or fragment. When the plain listener is enabled it must be bound to a specific IP address, not :5060 or 0.0.0.0.
  • --advertise-plain must 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 ​

VariableDefaultDescription
SIPBRIDGE_STATE_BACKENDmemorymemory or redis. Any other value fails startup.
SIPBRIDGE_STATE_IDENTITY_KEYrandom 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_NAMESPACEsipbridgeName 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_GENERATIONRedis: 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_PREFIXsipstate:v1Binary 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.

VariableDefaultDescription
SIPBRIDGE_MEMORY_MAX_GROUPS128Limits inbound and outbound contexts separately. Accepts 1 to 1,048,576.
SIPBRIDGE_MEMORY_MAX_BYTES1073741824 (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.

VariableDescription
SIPBRIDGE_REDIS_ADDRESSPrimary host:port. Use either this or Sentinel discovery.
SIPBRIDGE_REDIS_SENTINELSComma-separated Sentinel host:port list, at most 16.
SIPBRIDGE_REDIS_MASTERSentinel master name. Required with SIPBRIDGE_REDIS_SENTINELS.
SIPBRIDGE_REDIS_USERNAME, SIPBRIDGE_REDIS_PASSWORDData connection credentials.
SIPBRIDGE_REDIS_SENTINEL_USERNAME, SIPBRIDGE_REDIS_SENTINEL_PASSWORDSentinel discovery credentials.
SIPBRIDGE_REDIS_CA_FILEPEM trust bundle for Redis TLS.
SIPBRIDGE_REDIS_SERVER_NAMEVerified Redis TLS server name.
SIPBRIDGE_REDIS_ALLOW_PLAINTEXTtrue 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.

sipbridge holds SIP connections and runs the protocol; your application decides what happens on each call.