Upload file in Lua background
I'm writing some IVR in Lua and trying to execute some code while the main program continues execution. I've tried ... -- aws is AWS Command Line Interface io.popen("aws s3 cp " .. s3_src .. " ".. s3_dst) os.execute("aws s3 cp " .. s3_src .. " ".. s3_dst) ... -- program execution continues Even tried passing it off to a shell script(`s3_upload`) os.execute("s3_upload " .. s3_src .." " .. s3_dst) io.popen("s3_upload " .. s3_src .. " ".. s3_dst) I've tried session:execute("bgsystem","s3_upload " .. s3_src .. " ".. s3_dst ) If i use the Lua Interactive shell to run these commands independently, it works. would appreciate any assistance.
to do it in the background it needs to run in a different thread. Sometime with bgapi executing the command to do the upload passing the right params should work.
On Feb 21, 2018, at 2:48 PM, Sonnie <basmo13@yahoo.co.uk> wrote:
I'm writing some IVR in Lua and trying to execute some code while the main program continues execution.
I've tried
... -- aws is AWS Command Line Interface io.popen("aws s3 cp " .. s3_src .. " ".. s3_dst) os.execute("aws s3 cp " .. s3_src .. " ".. s3_dst) ... -- program execution continues
Even tried passing it off to a shell script(`s3_upload`)
os.execute("s3_upload " .. s3_src .." " .. s3_dst) io.popen("s3_upload " .. s3_src .. " ".. s3_dst)
I've tried
session:execute("bgsystem","s3_upload " .. s3_src .. " ".. s3_dst )
If i use the Lua Interactive shell to run these commands independently, it works.
would appreciate any assistance.
participants (2)
-
Michael Jerris
-
Sonnie