[Freeswitch-users] firing custom event in Lua

Brian West brian at freeswitch.org
Wed Aug 27 06:41:26 PDT 2008


local event = freeswitch.Event("message_waiting");  -- <-- This is the  
event NAME
event:addHeader("MWI-Messages-Waiting", "no");
event:addHeader("MWI-Message-Account", "sip:1000 at 10.0.1.100");
event:fire();

/b



On Aug 27, 2008, at 4:48 AM, Juan Backson wrote:

> 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 at gmail.com 
> > wrote:
> 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 at gmail.com> wrote:
> 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 at freeswitch.org>  
> wrote:
> Try e:addBody
> /b
>
> On Aug 24, 2008, at 8:51 AM, Juan Backson wrote:
>
> >  e:add_body("mymsg","abcd")
>
> Brian West
> sip:brian at freeswitch.org
>
>
>
>
> _______________________________________________
> Freeswitch-users mailing list
> Freeswitch-users at 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 at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
>
>
> -- 
> Anthony Minessale II
>
> FreeSWITCH http://www.freeswitch.org/
> ClueCon http://www.cluecon.com/
>
> AIM: anthm
> MSN:anthony_minessale at hotmail.com
> GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com
> IRC: irc.freenode.net #freeswitch
>
> FreeSWITCH Developer Conference
> sip:888 at conference.freeswitch.org
> iax:guest at conference.freeswitch.org/888
> googletalk:conf+888 at conference.freeswitch.org
> pstn:213-799-1400
>
> _______________________________________________
> Freeswitch-users mailing list
> Freeswitch-users at 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 at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org

Brian West
sip:brian at freeswitch.org



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20080827/4e201a16/attachment-0002.html 


More information about the FreeSWITCH-users mailing list