Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

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

[Freeswitch-users] how to call mod_commands from within a lua script


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





PostPosted: Sat Sep 05, 2009 10:41 pm    Post subject: [Freeswitch-users] how to call mod_commands from within a lu Reply with quote

Hi, the documentation says that mod_commands is available from within mod_lua. But when I try to access it like this:

  session:execute("uuid_broadcast",session_id .. " " .. filename .. " both")


  I get: Invalid Application uuid_broadcast
 
  or 


  session:execute("bgapi","uuid_broadcast " .. session_id .. " " .. filename .. " both")
  
  I get: Invalid Application bgapi


  or 
 
  session:uuid_broadcast(session_id .. " " .. filename .. " both")


  I get: attempt to call field 'uuid_broadcast' (a nil value)






Can somebody please explain how to do this?


Thanks!
Back to top
msc at freeswitch.org
Guest





PostPosted: Sun Sep 06, 2009 2:41 am    Post subject: [Freeswitch-users] how to call mod_commands from within a lu Reply with quote

On Sep 5, 2009, at 8:25 PM, Adam Wilt <wiltingtree@gmail.com> wrote:

Quote:
Hi, the documentation says that mod_commands is available from
within mod_lua. But when I try to access it like this:

session:execute("uuid_broadcast",session_id .. " " .. filename .. "
both")

I get: Invalid Application uuid_broadcast

or

session:execute("bgapi","uuid_broadcast " .. session_id .. " " ..
filename .. " both")

I get: Invalid Application bgapi

or

session:uuid_broadcast(session_id .. " " .. filename .. " both")

I get: attempt to call field 'uuid_broadcast' (a nil value)



Can somebody please explain how to do this?

Thanks!


Absolutely. Using session:execute is only for dialplan applications.
To do API commands, including all the stuff in mod_commands, you need
to create an API object:

api = freeswitch.API()

Then send a command and the variable will receive the results:

reply = api:executeString("version")

Check out this page for more examples:
http://wiki.freeswitch.org/wiki/Make_API_calls_directly_from_Lua_code

-MC
Quote:
_______________________________________________
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
Back to top
wiltingtree at gmail.com
Guest





PostPosted: Sun Sep 06, 2009 8:13 am    Post subject: [Freeswitch-users] how to call mod_commands from within a lu Reply with quote

Thank you Michael.  Sorry I missed that page.

On Sun, Sep 6, 2009 at 3:36 AM, Michael S Collins <msc@freeswitch.org (msc@freeswitch.org)> wrote:
Quote:


On Sep 5, 2009, at 8:25 PM, Adam Wilt <wiltingtree@gmail.com (wiltingtree@gmail.com)> wrote:

Quote:
Hi, the documentation says that mod_commands is available from
within mod_lua. But when I try to access it like this:

session:execute("uuid_broadcast",session_id .. " " .. filename .. "
both")

I get: Invalid Application uuid_broadcast

or

session:execute("bgapi","uuid_broadcast " .. session_id .. " " ..
filename .. " both")

I get: Invalid Application bgapi

or

session:uuid_broadcast(session_id .. " " .. filename .. " both")

I get: attempt to call field 'uuid_broadcast' (a nil value)



Can somebody please explain how to do this?

Thanks!




Absolutely. Using session:execute is only for dialplan applications.
To do API commands, including all the stuff in mod_commands, you need
to create an API object:

api = freeswitch.API()

Then send a command and the variable will receive the results:

reply = api:executeString("version")

Check out this page for more examples:
http://wiki.freeswitch.org/wiki/Make_API_calls_directly_from_Lua_code

-MC
Quote:
_______________________________________________
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


_______________________________________________
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