We have two PBXs. One has Dahdi channels connected to POTS lines, and is connected via PJSIP to another PBX that has multiple extensions connected to it.
Inbound calls to the POTS lines are answered by the first machine and routed via the PJSIP trunk to the second machine, where they end up in a ring group. This works fine. However, I would also like to have outbound calls from the extensions on PBX 2 sent via the PJSIP trunk to PBX 1 and out via the POTS lines.
Traffic reaches PBX1, but the call does not complete. Unfortunately, I am not able to log onto that machine just now, so I cannot confirm the error, but is there anything specific I need to do (a context for the trunk?) to allow this to happen?
The context of the connection (using a trunk, for example) needs to be “from-internal” for the calls to be processed against the outbound routes. You can also create a custom context that hits the outbound routes if you’re not comfortable with the second PBX being able to dial out.
@cynjut: Thanks again for the pointer. I was able to get the calls going out to Dahdi by changing the context to “from-internal” on the machine that hosts the Dahdi channels. I would have sworn that I tried that the first time around, but you know how that goes.
Once I had that fixed, though, I was getting error recordings from the PSTN about having dialed the number incorrectly (“To dial a number in your area code, dial the seven digit number. To dial a number in another area code, dial 1, the area code, and the seven digit number.”). A little intuition on my part, combined with some digging with my friend Google pointed me to this thread, which indicated that I needed to set the trunk up to dial an outbound prefix of “w” to ensure that the dial tone was present before Asterisk sent digits.
I still have one problem, though, which is that the trunk is set up to use Dahdi group 0, but now matter how many times I set the two FXS extension ports to be in group 1, they always end up set back to group 0 if I make any changes in FreePBX. I created a new thread here for that problem.