I had one simple use case: one hard phone and one outgoing trunk. Everything went fine.
In the time between I started my own little business and wanted to add a second trunk (an other SIP provider) and a second hard phone. The idea: hardphone1 outgoing/incoming via/from trunk1 and hardphone2 outgoing/incoming via/from trunk2.
Both trunks are registered, both hardphones are registered (everything via PJSIP)
Business hardphones extension is 3100 and the family has 3005. I want to take every number less than 3100 for fam and 3100 and up for business to be able to add more extensions.
If you just want to create some sort of “conceptual” division, that is you “knowing” that each extension belongs to its environment, then it is fine. If what you really want is to create a complete separation between both environments, like limiting which extension can call another extension, that would be a multi-tenant situation, for which FreePBX is not the best alternative.
Then again if you are fine with the “conceptual” approach, just direct incoming calls from each trunk to the desired extensions and create two different outbound routes, one for each trunk, setting the caller id for the two different extension groups. That would give you the separation you want, if you don’t mind that extensions 31xx can still communicate freely with 30xx
If you want to stay with FreePBX, one simple way without the need for custom code, would be to install two VMs with FreePBX on each one and use each FreePBX for each environment.
If you want to go with a truly multi-tenant solution, you can go with FusionPBX, the GUI PBX based on FreeSWITCH.
The trunk is registered, incoming calls are working well, but outgoing calls are rejected:
“Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 21”
Edit: I’m wondering, if the private IP of the FreePBX may be the problem? I run this server behind a NAT router. The connection to Sipgate as second provider works well.
You generally cannot have two trunks from the same provider in the same PoP trying to send calls to your IP on port 5060.
VoIP.ms as an example, if you try to have two trunks come from chicago2.voip.ms one will have problems. Change one trunk to chicago3.voip.ms and then everything will work.
Because it is coming from a different IP from the provider.