VoIP Mailing List Archives
Mailing list archives for the VoIP community |
|
View previous topic :: View next topic |
Author |
Message |
juanbackson at gmail.com Guest
|
Posted: Sun Aug 24, 2008 8:54 am Post subject: [Freeswitch-users] firing custom event in Lua |
|
|
Hi,
I tried to fire custom event with the following example:
e = freeswitch.Event("message");
e:add_body("mymsg","abcd")
session:sendEvent(e)
But I am getting this error from freeswitch console:
2008-08-25 05:49:33 [ERR] mod_lua.cpp:176 lua_parse_and_execute() ...r/local/freeswitch/scripts/script.lua:61: attempt to call method 'add_body' (a nil value)
stack traceback:
...r/local/freeswitch/scripts/script.lua:61: in main chunk
Does anyone know what is wrong with my script?
Thanks,
JB |
|
Back to top |
|
|
brian at freeswitch.org Guest
|
|
Back to top |
|
|
juanbackson at gmail.com Guest
|
Posted: Mon Aug 25, 2008 1:59 am Post subject: [Freeswitch-users] firing custom event in Lua |
|
|
Hi Brian,
If I try
e = freeswitch.Event("message");
e:addBody("thisisatestevent","abcd")
session:sendEvent(e)
2008-08-25 23:09:30 [ERR] mod_lua.cpp:176 lua_parse_and_execute() Error in addBody expected 2..2 args, got 3
stack traceback:
[C]: in function 'addBody'
If I try
e = freeswitch.Event("message");
e:addBody("thisisatestevent")
session:sendEvent(e)
It went through, but I can't pick up any message with the name or type "message"
Thanks for your help.
JB
On Mon, Aug 25, 2008 at 12:23 AM, Brian West <brian@freeswitch.org (brian@freeswitch.org)> wrote:
|
|
Back to top |
|
|
anthony.minessale at g... Guest
|
Posted: Mon Aug 25, 2008 9:42 am Post subject: [Freeswitch-users] firing custom event in Lua |
|
|
if you want to fire the event use
e:fire()
session:sendEvent(e) will queue the event to the session which is not what you seem to want.
On Mon, Aug 25, 2008 at 1:57 AM, Juan Backson <juanbackson@gmail.com (juanbackson@gmail.com)> wrote:
--
Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400 |
|
Back to top |
|
|
juanbackson at gmail.com Guest
|
Posted: Wed Aug 27, 2008 4:49 am Post subject: [Freeswitch-users] firing custom event in Lua |
|
|
Hi Anthony,
Thanks for your help. I can now send out custom message, but I am still not able to specify the content I want, such as Event_Type etc.
I tried the following, but still it does not work:
e = freeswitch.Event("message");
e:addBody("Event-Name=TestEvent")
e:fire();
Is it possible to specify the Event-Name and Event-Type in lua?
Thanks,
JB
On Mon, Aug 25, 2008 at 10:39 PM, Anthony Minessale <anthony.minessale@gmail.com (anthony.minessale@gmail.com)> wrote:
|
|
Back to top |
|
|
brian at freeswitch.org Guest
|
Posted: Wed Aug 27, 2008 8:45 am Post subject: [Freeswitch-users] firing custom event in Lua |
|
|
local event = freeswitch.Event("message_waiting"); -- <-- This is the event NAME
event:addHeader("MWI-Messages-Waiting", "no");
event:addHeader("MWI-Message-Account", "[url=sip:1000@10.0.1.100]sip:1000@10.0.1.100[/url]");
event:fire();
/b
On Aug 27, 2008, at 4:48 AM, Juan Backson wrote:
Brian West
[url=sip:brian@freeswitch.org]sip:brian@freeswitch.org[/url] |
|
Back to top |
|
|
anthony.minessale at g... Guest
|
Posted: Wed Aug 27, 2008 9:42 am Post subject: [Freeswitch-users] firing custom event in Lua |
|
|
also,
local event = freeswitch.Event("custom", "my::event");
event:addHeader("My-Header", "test");
event:fire();
On Wed, Aug 27, 2008 at 8:41 AM, Brian West <brian@freeswitch.org (brian@freeswitch.org)> wrote:
--
Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400 |
|
Back to top |
|
|
brian at freeswitch.org Guest
|
|
Back to top |
|
|
|
|
|
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
|