Hello!
I’m setting up FreeSWITCH for a multi-tenant softphone platform (agents on internal WSS, carrier trunks on external).
What works today
xml_curl serves agent directory auth and sofia.conf (internal + external profiles)
Carrier gateways are defined in our Laravel app from sip_accounts (SIP URI, username, password)
Outbound and inbound calling works
Gateways are included in the configuration xml_curl response under the external profile <gateways> block (we also tried directory purpose=gateways with parse="true" but had inconsistent results on rescan)
The problem When someone creates/updates/deletes a SIP account in our platform, FreeSWITCH doesn’t pick up gateway changes until we refresh the external profile.
Our current solution On SIP account create/update/delete we run SyncFreeSwitchExternalGateway via ESL:
sofia profile external killgw <gateway_name> (on update/delete when needed)
xml_flush_cache
sofia profile external rescan (we avoid full profile restart because we may have hundreds of gateways)
Gateway names are stable per account, e.g. tenant_{uuid}_account_{id}.
We do not write gateway XML files on the FS server; Laravel is the source of truth and xml_curl serves the updated config.
Questions
Is ESL + killgw + rescan the right pattern for dynamic carrier registration at scale, or is there a better way (directory purpose=gateways, per-gateway register API, etc.)?
Should gateways live in sofia.conf configuration xml_curl vs directory with parse="true" on domain name="all"?
Does rescan reliably pick up credential changes after xml_flush_cache, or do people still need rescan reloadxml / profile restart?
Any tips for debouncing many rapid DB changes so we don’t queue 10 rescans in a row?
FS version: 1.10.12
xml_curl for configuration + directory
ESL on port 8021 from the app server
Thanks!