Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] LUA execute response question


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
mike at jerris.com
Guest





PostPosted: Tue Dec 30, 2008 3:58 pm    Post subject: [Freeswitch-users] LUA execute response question Reply with quote

you can execute the freeswitch api command like any other api command or use any loadable lua module available to do this.



Mike

On Dec 30, 2008, at 3:36 PM, jonathan augenstine wrote:
Quote:
I am developing a Freeswitch/LUA script. From the script, I have a requirement to retrieve information via HTTP from an app server. I have utilized the HTTP application from the Freeswitch CLI. It works great. My question is how can I call the "http get http://www......." from within the LUA script and retrieve the HTTP response? Is this feasible? Or is there a way to make an HTTP request directly from LUA?
Back to top
jaugenstine at gmail.com
Guest





PostPosted: Tue Dec 30, 2008 4:23 pm    Post subject: [Freeswitch-users] LUA execute response question Reply with quote

Mike,

I executed the following:

From CLI:
http get http://www.google.com {}

This comes back with the HTTP response and prints it to the console. I tried to execute the following:

response = session:execute("http", "get http://www.google.com {}");

What I am unable to figure out how to do is retrieve HTTP response. That is my dilemma.

Jonathan

On Tue, Dec 30, 2008 at 12:57 PM, Michael Jerris <mike@jerris.com (mike@jerris.com)> wrote:
Quote:
you can execute the freeswitch api command like any other api command or use any loadable lua module available to do this.



Mike

On Dec 30, 2008, at 3:36 PM, jonathan augenstine wrote:

Quote:
I am developing a Freeswitch/LUA script. From the script, I have a requirement to retrieve information via HTTP from an app server. I have utilized the HTTP application from the Freeswitch CLI. It works great. My question is how can I call the "http get http://www......." from within the LUA script and retrieve the HTTP response? Is this feasible? Or is there a way to make an HTTP request directly from LUA?






_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (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

Back to top
mike at jerris.com
Guest





PostPosted: Tue Dec 30, 2008 4:41 pm    Post subject: [Freeswitch-users] LUA execute response question Reply with quote

session:execute runs a freeswitch app, you want to be executing the fsapi command using API:executeMike


On Dec 30, 2008, at 4:16 PM, jonathan augenstine wrote:
Quote:
Mike,

I executed the following:

From CLI:
http get http://www.google.com {}

This comes back with the HTTP response and prints it to the console. I tried to execute the following:

response = session:execute("http", "get http://www.google.com {}");

What I am unable to figure out how to do is retrieve HTTP response. That is my dilemma.

Jonathan

On Tue, Dec 30, 2008 at 12:57 PM, Michael Jerris <mike@jerris.com (mike@jerris.com)> wrote:
Quote:
you can execute the freeswitch api command like any other api command or use any loadable lua module available to do this.



Mike

On Dec 30, 2008, at 3:36 PM, jonathan augenstine wrote:

Quote:
I am developing a Freeswitch/LUA script. From the script, I have a requirement to retrieve information via HTTP from an app server. I have utilized the HTTP application from the Freeswitch CLI. It works great. My question is how can I call the "http get http://www......." from within the LUA script and retrieve the HTTP response? Is this feasible? Or is there a way to make an HTTP request directly from LUA?





Back to top
jaugenstine at gmail.com
Guest





PostPosted: Tue Dec 30, 2008 6:42 pm    Post subject: [Freeswitch-users] LUA execute response question Reply with quote

Mike,

Thank you. I was confused and it is working now.

Jonathan


On Tue, Dec 30, 2008 at 1:40 PM, Michael Jerris <mike@jerris.com (mike@jerris.com)> wrote:
Quote:
session:execute runs a freeswitch app, you want to be executing the fsapi command using API:execute Mike


On Dec 30, 2008, at 4:16 PM, jonathan augenstine wrote:

Quote:
Mike,

I executed the following:

From CLI:
http get http://www.google.com {}

This comes back with the HTTP response and prints it to the console. I tried to execute the following:

response = session:execute("http", "get http://www.google.com {}");

What I am unable to figure out how to do is retrieve HTTP response. That is my dilemma.

Jonathan

On Tue, Dec 30, 2008 at 12:57 PM, Michael Jerris <mike@jerris.com (mike@jerris.com)> wrote:
Quote:
you can execute the freeswitch api command like any other api command or use any loadable lua module available to do this.



Mike

On Dec 30, 2008, at 3:36 PM, jonathan augenstine wrote:

Quote:
I am developing a Freeswitch/LUA script. From the script, I have a requirement to retrieve information via HTTP from an app server. I have utilized the HTTP application from the Freeswitch CLI. It works great. My question is how can I call the "http get http://www......." from within the LUA script and retrieve the HTTP response? Is this feasible? Or is there a way to make an HTTP request directly from LUA?












_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (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

Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services