Search code examples
freeswitchsip-server

Freeswitch users directory using a database


I am quite new to freeswitch and want my directory currently hardcoded in XML config files on the server to be in a relational database. I found this tutorial:

https://saevolgo.blogspot.com/2012/07/freeswitch-with-sip-users-in-mysql-mod.html

But this seems very outdated as the GIT repository used does not exist anymore. Can anyone let me know the XML I have to fill so that it gets the users from database instead of other XML files? Per default it does this:

<users>
  <X-PRE-PROCESS cmd="include" data="default/*.xml"/>
</users>

But I guess there is a similar configuration to get them from database? Thanks in advance


Solution

  • The FreeSWITCH Database Handler allows you to connect to databases from your Lua script:

    https://freeswitch.org/confluence/display/FREESWITCH/Lua+FreeSWITCH+Dbh

    Here is example for using Database handler with user directory

    https://asterisk-pbx.ru/wiki/blog/freeswitch_directory_mysql_storage_with_lua_dbh