Matrix
Matrix (https://matrix.org) is another opensource, free option. In fact, Matrix aims to connect all the various comms services together in an open ecosystem - the ideal end-goal would be that I could talk to anybody without having to worry about which client (or comms system!) they are using.
Matrix itself is an open standard, but we also have open source implementations, licensed under the Apache 2 licence, of a homeserver and clients, both for the web and mobile. Check out a list here: https://matrix.org/docs/projects/try-matrix-now.html - or jump straight in via the guest-functionality via a client like Vector.im:
https://vector.im/develop/#/room/#matrix:matrix.org
Matrix is still being developed so please try it out and give us your feedback!
disclaimer: I work for matrix.org