Open ssinyagin opened 4 years ago
net.Socket is not sending "end" event on error. It sends "close" in both error and non-error cases, and that's when you need to emit esl::end
I'll send a PR
also a branch to fix it in 1.2.1: https://github.com/voxserv/node-esl/tree/v1.2.1-bugfix
Can you open a PR for that branch to the v1.x
branch?
Until this is merged you can set up the callback on your own code.
connection.socket.on('close', (hadError: boolean) => {
if (hadError) logger.warn('esl socket closed with error')
else logger.debug('esl socket closed')
endCall()
})
I'm running synchronous outbound ESL socket toward the node-esl server. If the server starts an
conn.execute(xxxx)
command, and the socket disconnects during the execution, the execute() never returns and hangs forever.by looking through the sources of Connection.js, I couldn't find any handling for such event.
Here's my code: