You guys should consider a Microsoft based solution for your chat system. It should take no more than a week to implement and it's guaranteed to work out of the box as an enterprise level solution.
Please consider getting some outside help! Preferably from software developers out of southern California (USA), silicon valley. It might be expensive but it will solve your problems ONCE AND FOR ALL.
You've tried the rest, now RELY ON THE BEST.
Just some professional advice. Thanks for reading!