We were not properly reporting the auth error, or closing the connection for an invalid password in the inbound ESL connection. This MR Also ensures we send the exit command where it logically makes sense to ensure that we try our best to inform FreeSWITCH of us stopping the connection.
Resolves #5
Overview
Buffer the authentication request channel to ensure we do not miss the request at all
Never has been an issue but it was technically racey before this change.
Add in an exported ExitAndClose helper function on eslgo.Conn that does exactly what it sounds like. It will send the exit command to FreeSWITCH before closing the network connections.
Some Closes were switched to ExitAndCloses to inform FreeSWITCH gracefully of the closing.
Fix inbound Dial to return the auth error when it fails and to ExitAndClose the connection
Also close the inbound connection if subsequent authentication checks fail.
Add a checks to ensure the onDisconnect function pointer isn't nil
Fix the locking in the receive message loop in Conn
Context
We were not properly reporting the auth error, or closing the connection for an invalid password in the inbound ESL connection. This MR Also ensures we send the exit command where it logically makes sense to ensure that we try our best to inform FreeSWITCH of us stopping the connection.
Resolves #5
Overview
ExitAndClose
helper function oneslgo.Conn
that does exactly what it sounds like. It will send the exit command to FreeSWITCH before closing the network connections.Close
s were switched toExitAndClose
s to inform FreeSWITCH gracefully of the closing.Dial
to return the auth error when it fails and toExitAndClose
the connectionConn