Re: [Freeswitch-users] Lua: io.popen/read blocking in other incoming calls
I would, but I need to post a a wav file that gets recorded, I didn't see a way to supply the location of a file to use as the post data. It looks like you have to url encode the data in the script and pass it all in the call. Thanks Dan- ----- Original Message ----- From: "Rupa Schomaker" <rupa@rupa.com> To: "freeswitch-users" <freeswitch-users@lists.freeswitch.org> Sent: Tuesday, January 19, 2010 4:06:36 PM Subject: Re: [Freeswitch-users] Lua: io.popen/read blocking in other incoming calls On Tue, Jan 19, 2010 at 3:03 PM, Dan < freeswitch-users@digitaldan.com > wrote: My lua script is calling wget through lua's io.popen to send and receive data from a web service. While the f:read to wget is running, other incoming calls will block on the same io.popen call until the first call closes the pipe (with f:close()). You might want to look at the api that mod_curl exposes to do what you want. No need to do an expensive system call just to call a webservice. -- -Rupa _______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Ah... yes you do. Patches / Bounty to implement that accepted. On Tue, Jan 19, 2010 at 5:17 PM, Dan <freeswitch-users@digitaldan.com>wrote:
I would, but I need to post a a wav file that gets recorded, I didn't see a way to supply the location of a file to use as the post data. It looks like you have to url encode the data in the script and pass it all in the call.
Thanks Dan-
----- Original Message ----- From: "Rupa Schomaker" <rupa@rupa.com> To: "freeswitch-users" <freeswitch-users@lists.freeswitch.org> Sent: Tuesday, January 19, 2010 4:06:36 PM Subject: Re: [Freeswitch-users] Lua: io.popen/read blocking in other incoming calls
On Tue, Jan 19, 2010 at 3:03 PM, Dan <freeswitch-users@digitaldan.com>wrote:
My lua script is calling wget through lua's io.popen to send and receive data from a web service. While the f:read to wget is running, other incoming calls will block on the same io.popen call until the first call closes the pipe (with f:close()).
You might want to look at the api that mod_curl exposes to do what you want. No need to do an expensive system call just to call a webservice.
-- -Rupa
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- -Rupa
You may consider use lua socket.http package as an alternative to popen+wget. Check: https://web.tecgraf.puc-rio.br/luasocket/ http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/http.html Maybe you can be interested also in http://github.com/fertesta/restinlua Em 19/01/2010, às 21:17, Dan escreveu:
I would, but I need to post a a wav file that gets recorded, I didn't see a way to supply the location of a file to use as the post data. It looks like you have to url encode the data in the script and pass it all in the call.
Thanks Dan- ----- Original Message ----- From: "Rupa Schomaker" <rupa@rupa.com> To: "freeswitch-users" <freeswitch-users@lists.freeswitch.org> Sent: Tuesday, January 19, 2010 4:06:36 PM Subject: Re: [Freeswitch-users] Lua: io.popen/read blocking in other incoming calls
On Tue, Jan 19, 2010 at 3:03 PM, Dan <freeswitch-users@digitaldan.com> wrote: My lua script is calling wget through lua's io.popen to send and receive data from a web service. While the f:read to wget is running, other incoming calls will block on the same io.popen call until the first call closes the pipe (with f:close()).
You might want to look at the api that mod_curl exposes to do what you want. No need to do an expensive system call just to call a webservice.
-- -Rupa
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org _______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Fernando Gregianin Testa testa@voicetechnology.com.br +55 11 35882166
participants (3)
-
Dan
-
Fernando Gregianin Testa
-
Rupa Schomaker