使用数据库的 Freeswitch 用户目录

Freeswitch users directory using a database

我是 freeswitch 的新手,希望我的目录当前在服务器上的 XML 配置文件中硬编码到关系数据库中。我找到了这个教程:

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

但这似乎非常过时,因为使用的 GIT 存储库不再存在。任何人都可以让我知道我必须填写的 XML 以便它从数据库而不是其他 XML 文件中获取用户吗?默认情况下它会这样做:

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

但我想有类似的配置可以从数据库中获取它们吗?提前致谢

FreeSWITCH 数据库处理程序允许您从 Lua 脚本连接到数据库:

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

这里是使用数据库处理程序和用户目录的例子

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

尽管@os11k 以很好的参考资料回答了这个问题,但我还是决定采取另一种方式:

在/etc/freeswitch/autoload_configs/xml_curl.conf.xml我放

<configuration name="xml_curl.conf" description="cURL XML Gateway">
  <bindings>
    <binding name="directory">
      <param name="method" value="GET" />
      <param name="gateway-url" value="https://example.com/my-freeswitch-directory.xml" bindings="directory"/>
    </binding>  

    <binding name="dialplan">
      <param name="gateway-url" value="https://example.com/my-freeswitch-dialplan.xml" bindings="diaplan"/>
      <param name="method" value="GET" />
    </binding>
  </bindings>
</configuration>

然后我就可以在我的网络服务器上自动生成拨号方案和目录,而无需使用我的 freeswitch 服务器连接到中央数据库。不要忘记在 /etc/freeswitch/autoload_configs/modules.xml

中激活模块 xml_curl