Instead of building own framework to handle Asterisk AGI Commands and AMI Actions/Events we should try to use https://github.com/netty/netty.