Probably it depends on the encoding CCGMS is using. It allows ASCII or PETSCII.
I suppose you want to use standard PETSCII, which has different code, e.g. lowercase/uppercase are reversed, and ENTER key is coded with #13 instead of #10.
Some years ago I started a Java project which is essentially a framework to build such services (BBS-like) for Commodore 64, you can find it here: https://github.com/sblendorio/petscii-bbs
Hope you'll find it useful.