Sub PBXes is for integrating other IP PBXes like local Asterisks, traditional PBXes with IP modules, or FXO gateways into your hosted PBX acting as a master.
After adding a username for a Sub PBX, you may enter that username as trunk into your local PBX. All extensions of the local PBX may then use your hosted PBX over that trunk.
Also other extensions on your hosted PBX will be able to dial into the local one. Just add an outbound dial rule pointing to the Sub PBX (the name of the Sub PBX will automatically appear within the list of your trunks to choose from). The dial rule should contain the numbers of all extensions connected to the local PBX (wildcards are allowed). Also numbers to be dialed out over the local trunks can be added to this dial rule.
You want my SPA-2002 Configuration or my pbxes configuration?
How could I post the SPA-2002 configuration? it's a lot of pages from the device. The pbxes config is a lot easier to post.
I do have to not that I had tried to connect my SPA-2002 to a trixbox with the help of a document for that and it had all that config on it already. So maybe that's why it went so easy for me. Just changed the proxy, user and password from the trixbox parameters to the pbxes parameters.
As a preview, here's what I did on pbxes.org:
1- created a sub-pbx, assigned a user name and password for it. Nothing else.
2- Used that user name and password and the proxy name pbxes.org on my PSTN configuration screen on the SPA 2002.
3- The device restarted and after a few seconds said it was registered.
4-Connected my SPA2002 to the PSTN line, that is I connected the PSTN line to the PSTN port.
5- Dial plan on the PSTN line was already xx. so it would accept any number
6-Created an outbout routing on pbxes to have it route local calls to the SPA2002.
7-Tried a call from one of the extensions so that it would match the outbound routing created.
8-I could hear it connect to the SPA and pass the digits to it as it opened the line and dialed them. :-)
What you are asking for is very subjective, and almost impossible to setup properly, unless you tell us what kind of SIP UA is connected on every extension.
You see, the ** sequence required based on the infinite wisdom of AVM's engineers, is used as an escape sequence on some SIP User Agents. For example some SIP UA might be invoking VSACs (Vertical Service Activation Code) by prefixing a two digit number with **. So the SIP UA might be trying to interpret a VSAC thus blocking the **ext# sequence from even reaching the Fritz!Box.
It might also be related to a dial plan issue, somewhere along the line that prevents the string from reaching PBXes.
So in order to try and comprehend the issue, you have to list every SIP UA on every extension, Frit!Box & PBXes. This will take some time to sort through, so patience is required.
Regarding your question for calls from local extensions to hosted extensions, remember to include the vitorouski-SubPBXname in Axon's dial-plan, for calls via this particular trunk to reach hosted extensions.
Looking at Axon's SIP traces will help you determine what the Axon SIP stack sends to PBXes and vice versa. This should also help you determine what is the Axon's SIP stack receives from PBXes on an hosted trunk's inbound call.