<div dir="ltr"><a href="https://github.com/seven1240/xui">https://github.com/seven1240/xui</a> it is outdated and stopped updating. but the lua scripts should still work.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 30, 2021 at 10:08 PM Antony Stone <<a href="mailto:Antony.Stone@freeswitch.open.source.it">Antony.Stone@freeswitch.open.source.it</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi.<br>
<br>
Sending again with a bit of clarification - my original message hasn't hit the <br>
list yet, so I'm hoping people can reply to just this one...<br>
<br>
<br>
I am trying to get Freeswitch to get its sofia configuation from lua instead of <br>
static XML files.<br>
<br>
<a href="https://freeswitch.org/confluence/display/FREESWITCH/mod_xml_curl" rel="noreferrer" target="_blank">https://freeswitch.org/confluence/display/FREESWITCH/mod_xml_curl</a> tells me for <br>
example that "Section: configuration - This is used to send back configuration <br>
files such as sofia.conf."  Yes, I know that that page refers to mod_xml_curl <br>
and not mod_xml_lua but I'm pretty certain that the principle is the same, and <br>
<a href="https://freeswitch.org/confluence/display/FREESWITCH/Serving+Configuration+with+Lua" rel="noreferrer" target="_blank">https://freeswitch.org/confluence/display/FREESWITCH/Serving+Configuration+with+Lua</a> <br>
seems to confirm this, although is it much thinner on examples.  I do not that <br>
this page also says "there is no Lua page yet, and Lua-related docs are <br>
scattered all over the place..." :(<br>
<br>
So, anyway, I'm pretty sure what I want to do should be possible, but nowhere <br>
have I so far been able to find a fully working example telling me how to do <br>
it.<br>
<br>
My understanding so far is that:<br>
<br>
1. I need to create a lua script which generates the *complete* XML as would <br>
be served from /etc/freeswitch/autoload_configs/sofia.conf.xml and all its <br>
included sub-directories/files<br>
<br>
2. This XML as output from the script should be enclosed within tags:<br>
<br>
  <document type="freeswitch/xml"><br>
    <section name="configuration"><br>
      ... XML goes here ...<br>
    </section><br>
  </document><br>
<br>
3. I should place this lua script in freeswitch's scripting directory, which <br>
on my (Debian) machine is /usr/share/freeswitch/scripts<br>
<br>
4. I need to enable this script to be run by including in <br>
/etc/freeswitch/autoload_configs/lua.conf.xml:<br>
<br>
    <param name="xml-handler-script" value="sofia.conf.lua"/><br>
    <param name="xml-handler-bindings" value="configuration"/><br>
<br>
<br>
The first thing which is not clear to me is what I should do about <br>
/etc/freeswitch/autoload_configs/sofia.conf.xml<br>
<br>
 - if I leave it as it is, it appears to be used in the normal way, and my lua <br>
script is ignored<br>
 - if I delete it (or rename it to sofia.conf.xml.noload for example) then sofia <br>
doesn't get loaded *at all* and when I go into fs_cli I do not even have a <br>
"sofia" command<br>
 - if I "touch" the filename so that <br>
/etc/reeswitch/autoload_configs/sofia.conf.xml exists but is empty, I get the <br>
same result egain - the "sofia" command does not even exist in the cli<br>
<br>
<br>
So, can anyone point me at how to join these things up correctly so that I can <br>
serve sofia configuration settings from a lua script?<br>
<br>
<br>
I've been told here that:<br>
<br>
On Friday 05 November 2021 at 12:28:55, David Villasmil wrote:<br>
<br>
> In FS there’s the embedded lua. You can do almost anything with it.<br>
<br>
I'm struggling to find the documentation telling me how, though :(<br>
<br>
<br>
Thanks in advance,<br>
<br>
<br>
Antony.<br>
<br>
-- <br>
"It would appear we have reached the limits of what it is possible to achieve <br>
with computer technology, although one should be careful with such statements; <br>
they tend to sound pretty silly in five years."<br>
<br>
 - John von Neumann (1949)<br>
<br>
                                                   Please reply to the list;<br>
                                                         please *don't* CC me.<br>
<br>
_________________________________________________________________________<br>
<br>
The FreeSWITCH project is sponsored by SignalWire <a href="https://signalwire.com" rel="noreferrer" target="_blank">https://signalwire.com</a><br>
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.<br>
Build your next product on our scalable cloud platform.<br>
<br>
Join our online community to chat in real time <a href="https://signalwire.community" rel="noreferrer" target="_blank">https://signalwire.community</a><br>
<br>
Professional FreeSWITCH Services<br>
<a href="mailto:sales@freeswitch.com" target="_blank">sales@freeswitch.com</a><br>
<a href="https://freeswitch.com" rel="noreferrer" target="_blank">https://freeswitch.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="https://freeswitch.com/oss" rel="noreferrer" target="_blank">https://freeswitch.com/oss</a><br>
<a href="https://freeswitch.org/confluence" rel="noreferrer" target="_blank">https://freeswitch.org/confluence</a><br>
<a href="https://cluecon.com" rel="noreferrer" target="_blank">https://cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="https://freeswitch.com" rel="noreferrer" target="_blank">https://freeswitch.com</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">About: <a href="http://about.me/dujinfang" target="_blank">http://about.me/dujinfang</a><br>Blog: <a href="http://www.dujinfang.com" target="_blank">http://www.dujinfang.com</a><br>Proj:  <a href="http://www.freeswitch.org.cn" target="_blank">http://www.freeswitch.org.cn</a></div>