19.04.2022, 07:45
Start by logging what data the gateway is sending. Modify read function like this:
For an event session you need to change OPEN command to *99*1##
Code:
function read(sock)
local buf = {}
while true do
local ch, err = sock:receive(1)
if ch then
local pr = buf[ #buf ]
buf[ #buf + 1 ] = ch
if ch == '#' and pr == '#' then
break
end
else
return nil, err
end
end
local ret = table.concat(buf)
log(ret)
return ret
end
For an event session you need to change OPEN command to *99*1##