in lua you call methods with a colon :

e:addBody(blah);

calling with a . implies you are going to supply the obj too

e.addBody(e, blah);


On Tue, Feb 17, 2009 at 5:11 PM, Nik Middleton <nik.middleton@noblesolutions.co.uk> wrote:

Hi Guys,

 

I'm having real problems doing something trivial, and there doesn't seem to be any docs on this issue

 

In js I do this

 

//Disposition = disp;

//Create Custom event

                                               

custom_msg =  

                                    "call_disposition: " + Disposition + "\n" +

                                    "called_number: "    + dial_num + "\n"  ; 

 

                                    e = new Event("custom", "dialer::dialer-result");

                                    e.addBody(custom_msg);

                                    e.fire();

 

And it works

 

In lua I try this

 

--Disposition = disp;

--Create Custom event

                                               

custom_msg = "call_disposition: " .. Disposition .. "\n" ..

                                    "called_number: "    .. dial_num .."\n"  ; 

 

                                    local e = freeswitch.Event("custom", "dialer::dialer-result");

                                    e.addBody(custom_msg);

                                    e:fire(e);

 

This doesn't work, I get an error :  Error in addBody expected 2..2 args, got 1

 

What are the arguments?  It seems to be looking for a pointer for the first one, but there's nothing on the wiki on this. 

 

 

Regards,


_______________________________________________
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




--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/

AIM: anthm
MSN:anthony_minessale@hotmail.com
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org
pstn:213-799-1400