Company A and Company B share a PBX. Both companies each have a SIP account with the same provider but cannot make use of one another's SIP trunk.
Extensions 8xxx belong to Company A with reception at 8000. Extensions 9xxx belong to Company B with reception at 9000
Outgoing calls must be routed to the companies' SIP trunks respectively.
Incoming calls must be routed to to the companies' receptions respectively.
With flexpaths we can now manipulate the call flow to create the outcome we want. Starting with incoming calls...
Now to manage outgoing calls. We can facilitate the call flow by directing the extensions.
The above scenario will facilitate calls accordingly, the only problem we are left with is internal calling, where Company A and B can still call each other internally. Note that Inter-company calls are facilitated by default and can be accessed by directly dialling a company's extensions (e.g. the receptionist for Company B could dial 8000 to reach the receptionist for Company A.) To disable this, we need to create FlexPaths that terminates service for cross-company numbers.
There are a few ways to facilitate this termination. In this example, since we have directed outgoing calls from the extensions to the flexpaths, we have created an outbound route that leads to nowhere and the caller will receive an "All circuits are busy now" beep.
As per above any number matching 8XXX will be sent to terminate through the termination outbound route created. Any other number will be caught and sent to the flexpath created above.