You can do this pretty easily using asterisk and then just point your VoIP clients to it’s IP address
But…
Whatever you do, unless you’re an expert with network security, don’t leave it on its default port if you’ll expose it to the internet.
You’ll have that many bots trying to get in that it’ll DDoS you within a few hours of setting it up. Even if you have it on a different port, you’ll have lots of bots trying to get in.
If you ever see those “unlimited international calls” cards sold in third world countries for like $5-10, those are mostly hacked VoIP systems that have accounts or access to a phone line
Samsung messages was using RCS since 2012… Years before Google messages adopted it.
There are others out there that use it but call it by different names like “advanced messaging”, “SMS+” etc
Google was the first to add e2e encryption and push it hard though, but if you send a RCS message from Google messages to Samsungs messages app, it won’t have e2e, and most likely will be the same with messaging Apple.
But given how much Apple have fought to make it hard (or at least inconvenient) to message between them, and shut down any apps that made messaging between Apple and Android better, this is a big step for Apple