lua-users home
lua-l archive

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

Hello there. I'm in trouble with connecting to FreeSWITCH by the ESL.ESLconnection() and it's blocking me to do more progress with my work... and further exploring FreeSwitch platform.

The problem is in ESL.ESLconnection() function - its first argument has to be (int) socket, so as I suppose it's right to use the lua's getfd() function in this case. But... as it can be observed in Wireshark, the execution of ESL.ESLconnection() function looks like that:

* send "conenct" message
* send RST packet that reset current Socket Connection

I wonder if I made mistake while compiling ESL library, or maybe there is a problem with configuration of Socket at Lua's side? Is there any bug, in code below - althrought I regularly programming, I'm newbie in Lua and maybe there is some kind of specific lua construction of socket?

#! /usr/bin/lua

-- socket set-up
ServerPort = 8086
server = assert(socket.bind("*", ServerPort))

-- waiting, in the loop, for the client
while true do
  client, err = server:accept()
  con = ESL.ESLconnection(client:getfd())
  print (con:connected())

Tomek Łabacki,