[Freeswitch-users] serving configuration with mod_lua, and sofia.conf

Artur Mega findmeinwland at gmail.com
Thu Feb 25 11:19:44 MSK 2016


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
​​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20160225/040e69a5/attachment.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list