Added onconnectListeners & onhangupListeners so applications know when connection is established or closed.