<div style="min-height:22px">I always use root account.</div><div style="min-height:22px"></div><span class="mail-footer">发自我的iPhone</span><div id="original-content"><br><br><div><div style="font-size:70%;padding:2px 0;">------------------ Original ------------------</div><div style="font-size:70%;background:#f0f0f0;color:#212121;padding:8px;border-radius:4px"><div><b>From:</b> Abaci B &lt;abaci64@gmail.com&gt;</div><div><b>Date:</b> 周六,3月 25,2017 03:14</div><div><b>To:</b> FreeSWITCH Users Help &lt;freeswitch-users@lists.freeswitch.org&gt;</div><div><b>Subject:</b> Re: [Freeswitch-users] Lua not working when FS start withbackground mode[freeswitch -nc]</div></div></div><br><div dir="ltr">file permission issue maybe (starting as different user)?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 24, 2017 at 10:36 AM, zzy <span dir="ltr">&lt;<a href="mailto:zzyroy@qq.com" target="_blank">zzyroy@qq.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span style="color:rgb(51,51,51);font-family:Arial,sans-serif">Debian 8&nbsp;</span><br><span style="color:rgb(51,51,51);font-family:Arial,sans-serif">FreeSWITCH (Version 1.6.15 -32-bec4538 64bit)&nbsp;</span><br><br><br><span style="color:rgb(51,51,51);font-family:Arial,sans-serif">1. Login Debian with root.&nbsp;</span><br><span style="color:rgb(51,51,51);font-family:Arial,sans-serif">2. Install the FS by apt-get.&nbsp;</span><br><span style="color:rgb(51,51,51);font-family:Arial,sans-serif">wget -O -&nbsp;</span><a href="https://files.freeswitch.org/repo/deb/debian/freeswitch_archive_g0.pub" style="color:rgb(59,115,175);text-decoration:none;font-family:Arial,sans-serif" target="_blank">https://files.freeswitch.<wbr>org/repo/deb/debian/<wbr>freeswitch_archive_g0.pub</a><span style="color:rgb(51,51,51);font-family:Arial,sans-serif">| apt-key add -&nbsp;</span><br><span style="color:rgb(51,51,51);font-family:Arial,sans-serif">echo "deb&nbsp;</span><a href="http://files.freeswitch.org/repo/deb/freeswitch-1.6/" style="color:rgb(59,115,175);text-decoration:none;font-family:Arial,sans-serif" target="_blank">http://files.freeswitch.<wbr>org/repo/deb/freeswitch-1.6/</a><span style="color:rgb(51,51,51);font-family:Arial,sans-serif">je<wbr>ssie main" &gt; /etc/apt/sources.list.d/<wbr>freeswitch.list&nbsp;</span><br><span style="color:rgb(51,51,51);font-family:Arial,sans-serif">apt-get update &amp;&amp; apt-get install -y freeswitch-meta-all&nbsp;</span><br><span style="color:rgb(51,51,51);font-family:Arial,sans-serif">3. Run fs_cli after install.&nbsp;</span><br><span style="color:rgb(51,51,51);font-family:Arial,sans-serif">4.&nbsp;</span><font color="#333333" face="Arial, sans-serif">I add a gateway in Freeswitch Portal. It will run a&nbsp;</font><span style="color:rgb(51,51,51);font-family:Arial,sans-serif">run lua script [create_gateway.lua].&nbsp;</span><font color="#333333" face="Arial, sans-serif">This lua script is from source code [/usr/src/freeswitch/scripts/<wbr>lua/portal/create_gateway.lua]<wbr>.</font><div><font color="#333333" face="Arial, sans-serif">I get an error message in fs_cli:&nbsp;</font></div><div><font color="#333333" face="Arial, sans-serif"><br></font></div><div><font color="#333333" face="Arial, sans-serif">2017-03-24 10:32:46.006528 [ERR] mod_lua.cpp:203 /usr/share/freeswitch/scripts/<wbr>portal/create_gateway.lua:13: attempt to index global 'conf_file' (a nil value)&nbsp;</font></div><div><font color="#333333" face="Arial, sans-serif">stack traceback:&nbsp;</font></div><div><font color="#333333" face="Arial, sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; /usr/share/freeswitch/scripts/<wbr>portal/create_gateway.lua:13: in main chunk</font></div><div><font color="#333333" face="Arial, sans-serif"><br></font></div><div><img src="cid:C715D0D3@75945E74.07B1D558"></div><div><br></div><span style="color:rgb(51,51,51);font-family:Arial,sans-serif">5. Stop the FS with [systemctl stop freeswitch.service] command.&nbsp;</span><br><span style="color:rgb(51,51,51);font-family:Arial,sans-serif">6. Run [freeswitch -c] command set the FS in the foreground.&nbsp;</span><br><span style="color:rgb(51,51,51);font-family:Arial,sans-serif">7.&nbsp;</span><font color="#333333" face="Arial, sans-serif">I add a gateway in Freeswitch Portal</font><span style="color:rgb(51,51,51);font-family:Arial,sans-serif">&nbsp;again</span><span style="color:rgb(51,51,51);font-family:Arial,sans-serif">&nbsp;and get the correct result.&nbsp;</span><br><span style="color:rgb(51,51,51);font-family:Arial,sans-serif">8. I also try this</span><span style="color:rgb(51,51,51);font-family:Arial,sans-serif">&nbsp;</span><span style="color:rgb(51,51,51);font-family:Arial,sans-serif">after FS startup in the background ([freeswitch -nc] and [freeswitch -ncwait]). Get the same error as before.&nbsp;</span><br><br><br><span style="color:rgb(51,51,51);font-family:Arial,sans-serif">Who can tell me why the lua script does not working when FS startup with service mode and background mode?&nbsp;</span><br><br><span style="color:rgb(51,51,51);font-family:Arial,sans-serif">Thanks a lot!&nbsp;<br></span><br>______________________________<wbr>______________________________<wbr>_____________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.<wbr>freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.<wbr>org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.<wbr>freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/<wbr>mailman/listinfo/freeswitch-<wbr>users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.<wbr>freeswitch.org/mailman/<wbr>options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br></div>

</div>