Model each profile as an independent SIP user agent
mod_sofia treats each SIP profile as an independent SIP user agent bound to an address and port, with its own transports, codec preferences, authentication policy, ACLs and target dialplan context. The familiar internal and external names come from the supplied configuration; their names do not enforce trust.
Record bind and advertised addresses, ports, transports, context, authentication and ACL behavior for the exact running profile.
Keep directory identity and dialplan authority separate
Directory users can supply authentication and channel variables, while the receiving profile selects a dialplan and context. A successfully authenticated device is not thereby entitled to every destination. Trace the identity lookup, applied variables, selected context and matched extension independently.
Broadening a context to fix one failed call can expand toll or service access, so retain a negative authorization test.
Put every gateway inside the intended profile
A gateway is a named outbound SIP trunk definition inside one profile and becomes the handle used in sofia/gateway/<name>/<number> bridge strings. It may register, or it may be deliberately configured not to register for IP-authenticated peering.
Confirm the gateway name, owning profile, proxy, realm, authentication identity, From identity and called-number format without treating any one field as proof of provider acceptance.
Read registration and ping as different state
A registering gateway can move through queued, attempting, registered, failed, backoff, expired and timeout states. A non-registering gateway can validly show NOREG; its OPTIONS ping health is a different observation. NOREG / UP can be normal for an IP-authenticated trunk, while NOREG / DOWN can identify failed reachability when ping is configured.
Do not enable registration solely to make a status label look healthier.
Choose rescan, restart and reload deliberately
reloadxml refreshes XML, a Sofia profile rescan can discover gateway changes, and a profile restart rebinds transports. Those operations have different runtime effects and can affect registrations or calls. Read the installed command help, state the expected disruption and preserve rollback before executing a broad operation.
After any change, inspect the same profile and gateway again instead of assuming a successful command changed effective state.
Accept inbound and outbound paths independently
For outbound acceptance, retain route selection, bridge string, gateway state, INVITE, final response, answer and two-way media. For inbound acceptance, retain source trust, receiving profile, context, extension match, destination, answer and media. Registration alone proves neither path.
Repeat one permitted and one restricted case after the change. No profile, gateway or call was tested for this guide.
Sources & applicability
Primary references for the technical details above. Operational examples and planning checklists are VoIP.info editorial guidance.
- FreeSWITCH SIP profiles with Sofia ↗
- FreeSWITCH gateways and trunk registration ↗
- FreeSWITCH registration troubleshooting ↗
- FreeSWITCH call-setup failures ↗
- FreeSWITCH diagnostic toolbox ↗
- FreeSWITCH SIP trace and CDR reading ↗
- FreeSWITCH CLI and API command reference ↗
Examples require adaptation to your topology. No live PBX or hardware testing is claimed.