lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Dear All,
I am beginner  using Lua to communicate with FreeSWITCH via event socket library
send the below code to get some parameters from FreeSWITCH but Lua interpreter is returning runtime error message.

The response am expecting is something like this: +OK Job-UUID: f719939a-ffa1-49ca-a8b6-7f080febc2dc

lua: els_bgapi.lua:20: attempt to index global 'e_con' (a number value)
stack traceback:
        els_bgapi.lua:20: in main chunk
        [C]: in ?

Lua code
e_con= sock:events("plain","all");
target = e_con:getHeader()

job_uuid = e_con:getHeader("Job-UUID");
target = e_con:getHeader("Caller-Destination-Number")
print ("Call to""has Job-UUID of and call uuid of"..uuid.."\n");