Open source solution for cloud-based multi-tenant PBX?

As sippy mentioned, you can use extension routes and all other kinds of methods to handle it.
I have a few clients that split their own company divisions A/B situation and some users have one route, one number etc which differs from the other. This can easily be done and it works.

Having said that, you shouldn’t try to put 20 companies this way because there will be limitations out of your control such as extensions are already used by another client and so on.

We provide a server for each client, it’s clean, yes a few headaches like multiple servers to manage etc, but it keeps them all independent, if they want to pull the server in-house, simply backup the cloud server and restore it on the local server.