Hello all,

I try to serve configuration via lua like it's described at https://freeswitch.org/confluence/display/FREESWITCH/Serving+Configuration+with+Lua

<configuration name="lua.conf" description="LUA Configuration">
 <settings>
   <param name="xml-handler-script" value="configuration.lua"/>
   <param name="xml-handler-bindings" value="configuration"/>
 </settings>
</configuration>

In configuration.lua script I set XML_STRING to valid xml, taken from autoload_configs.

Similar to this method, i did the same with mod_xml_curl, and all works fine.

But with mod_lua sofia profiles not loading. I think, the problem is in variables. Let me explain.
When I turn off mod_lua and then make `reload mod_sofia` in fs_cli i see something like
...
2016-02-25 13:04:03.875154 [DEBUG] sofia.c:4237 context [internal]
2016-02-25 13:04:03.875154 [DEBUG] sofia.c:4237 rfc2833-pt [101]
2016-02-25 13:04:03.875154 [DEBUG] sofia.c:4237 sip-port [5060]
2016-02-25 13:04:03.875154 [DEBUG] sofia.c:4237 dialplan [XML]
2016-02-25 13:04:03.875154 [DEBUG] sofia.c:4237 dtmf-duration [2000]
2016-02-25 13:04:03.875154 [DEBUG] sofia.c:4237 inbound-codec-prefs [OPUS,G722,PCMU,PCMA,VP8]
2016-02-25 13:04:03.875154 [DEBUG] sofia.c:4237 outbound-codec-prefs [OPUS,G722,PCMU,PCMA,VP8]
2016-02-25 13:04:03.875154 [DEBUG] sofia.c:4237 rtp-timer-name [soft]
2016-02-25 13:04:03.875154 [DEBUG] sofia.c:4237 rtp-ip [xxx.xx.x.x]
....

But when i turn on mod_lua and relod mod_sofia, in logs i see, that variables not calculated!

2016-02-25 13:04:03.875154 [DEBUG] sofia.c:4237 context [internal]
2016-02-25 13:04:03.875154 [DEBUG] sofia.c:4237 rfc2833-pt [101]
2016-02-25 13:04:03.875154 [DEBUG] sofia.c:4237 sip-port [$${internal_sip_port}]
2016-02-25 13:04:03.875154 [DEBUG] sofia.c:4237 dialplan [XML]
2016-02-25 13:04:03.875154 [DEBUG] sofia.c:4237 dtmf-duration [2000]
2016-02-25 13:04:03.875154 [DEBUG] sofia.c:4237 inbound-codec-prefs [$${global_codec_prefs}]
2016-02-25 13:04:03.875154 [DEBUG] sofia.c:4237 outbound-codec-prefs [$${global_codec_prefs}]
2016-02-25 13:04:03.875154 [DEBUG] sofia.c:4237 rtp-timer-name [soft]
2016-02-25 13:04:03.875154 [DEBUG] sofia.c:4237 rtp-ip [$${local_ip_v4}]

If i run in fs_cli `eval $${local_ip_v4}`, it prints calculated IP. Maybe I missed something? Thanks

--

Arthur
​​