[Freeswitch-users] AddBody to events in lua

Nik Middleton nik.middleton at noblesolutions.co.uk
Tue Feb 17 15:11:48 PST 2009


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,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20090217/223bd566/attachment-0002.html 


More information about the FreeSWITCH-users mailing list