A SIP profile in FreeSWITCH is a self-contained Sofia-SIP user agent bound to a specific IP address and port. Each profile maintains its own listener socket, SIP registration table, TLS settings, and codec preferences.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/signalwire/freeswitch/llms.txt
Use this file to discover all available pages before exploring further.
mod_sofia — the FreeSWITCH SIP module — can run any number of profiles simultaneously, making it possible to serve registered phones, SIP trunks, and WebRTC clients all from the same instance. Profile configuration files live in conf/sip_profiles/ and are loaded by autoload_configs/sofia.conf.xml.
Default Profiles
The vanilla configuration ships with two profiles that cover the most common deployment scenario.internal
Port 5060 (UDP/TCP)Intended for SIP endpoints that register directly with FreeSWITCH — desk phones, softphones, and WebRTC clients. Authentication is required (
auth-calls=true). The profile’s default context is public, but authenticated users are routed into the default context via the user_context variable set in their directory entry.external
Port 5080 (UDP/TCP)Intended for outbound SIP trunks and PSTN gateways. Authentication is disabled on this profile (
auth-calls=false) because the remote carrier authenticates at the trunk level via gateways. Inbound DID calls arrive on this port and land in the public dialplan context.internal.xml (key settings)
Key Parameters
Addressing & Binding
Addressing & Binding
Local IP address to bind the SIP listener to. Must be an IP address — do not use hostnames.Default:
$${local_ip_v4} (auto-detected local address)UDP/TCP port to listen for SIP traffic.Internal default:
5060 | External default: 5080Local IP to use for RTP media streams. Must be an IP address — do not use hostnames.Default:
$${local_ip_v4}Public (NAT) IP advertised in SIP Contact and Via headers. Accepts an IP address,
stun:server, host:fqdn, auto, or auto-nat.Default: $${external_sip_ip} (resolved via STUN)Public (NAT) IP written into the SDP
c= and m= lines for RTP.Default: $${external_rtp_ip} (resolved via STUN)Call Routing
Call Routing
Authentication
Authentication
Whether to challenge INVITEs with a
407 Proxy Authentication Required response.Internal: true | External: falseLifetime in seconds for SIP digest authentication nonces.Default:
60Forces the SIP username and auth username to match during REGISTER.Default:
trueCodecs & Media
Codecs & Media
Ordered list of codecs offered/accepted for inbound calls.Default:
$${global_codec_prefs} → OPUS,G722,PCMU,PCMA,H264,VP8Ordered list of codecs offered/accepted for outbound calls.Default:
$${global_codec_prefs}How to resolve codec disagreements.
generous accepts the remote’s preference; greedy enforces the local list order.Default: generousWhen
true, codec negotiation is deferred until the dialplan runs, allowing the dialplan to influence codec selection.Default: trueSIP Gateways
A gateway tellsmod_sofia how to register with an upstream SIP provider (e.g., a PSTN carrier or SIP trunk). Gateways are defined inside the <gateways> block of a profile, or in individual XML files under sip_profiles/external/.
The following example is drawn from the vanilla sip_profiles/external/example.xml (which ships fully commented-out as a template):
sofia dial string in your dialplan:
Profile Management
Use these commands at thefs_cli console to inspect and control SIP profiles without restarting FreeSWITCH.
NAT Traversal
When FreeSWITCH sits behind a NAT router, the SIP and SDP packets must advertise the public IP rather than the private one. The vanilla config handles this through two mechanisms:STUN resolution at startup
vars.xml uses stun-set to query stun.freeswitch.org and store the public IP:$${external_rtp_ip} and $${external_sip_ip}.Manual override (recommended for production)
For stable servers with a fixed public IP, replace the STUN entries with a hard-coded address:Alternatively, use a DNS hostname:
TLS / SRTP
TLS transport and SRTP media encryption are disabled by default in the vanilla config. To enable them, adjustvars.xml and the relevant profile:
agent.pem (the server certificate + private key) and cafile.pem (the CA chain). FreeSWITCH will log an error at startup if the files are missing.
For SRTP, set the rtp_secure_media channel variable in the dialplan or configure rtp_sdes_suites in vars.xml to control which cipher suites are offered.