[Freeswitch-users] freeswitch won't open file

mayamatakeshi mayamatakeshi at gmail.com
Sat Dec 5 22:20:06 UTC 2020


On Sun, Dec 6, 2020 at 3:42 AM Joli Martinez <mrjoli021 at gmail.com> wrote:

> Hello,
>
> It is not a permissions issue.  I have changed the permissions to rw for
> everyone and it will still not read the file.
>
> The password.json file is in the same directory as the script
> /usr/share/freeswitch/script.  I am using lua 5.2.3 and again, the same
> code works in my home directory.  I just copied the password.json file over
> and pasted the function into my code.  When I place the call freeswitch
> prints "Inside the function", so I know it gets there, but then freeswitch
> spits out  "attempt to index local 'file' (a nil value)"
>
> What else could I be missing?
>

Hi,
when I check the current folder inside the fs cli I get:

*freeswitch at lab002> system pwd*
*/*

So, if you use:



*f = "password.json"local file = io.open(f, "r")*

freeswitch would try to open "/password.json"
So I think you should pass the full file path:
f = "/usr/share/freeswitch/script/password.json"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20201206/07823592/attachment-0001.html>


More information about the FreeSWITCH-users mailing list