TCP Protocol to asterisk


I’m looking for a PBX system that can be controlled through a protocol based on TCP.

i.e. i’d like to send a request message to the PBX with for instance ID, Command, etc… and then get a TCP response back with wether the command was completed succes full. Also messages with events should be send back in other to control the status. This way i want to control the PBX totally from outside.

I think this should be possible with Asterisk, it is actually a heavily adapted version of manager.c in some way.

I was wondering if anyone has a smart solution to build such a module in Asterisk? There exist so much API’s that i cannot really get an overview on if this is something I have to program and integrate myself or if it is easier to do with already existing program work from third parties?