I’m sure there must be a way of setting the fxo ports individually. It depends on each gateway model. Some require that you create a separate trunk for each fxo port, using a specific udp port for the trunk, others let you use a prepended number that the gateway uses to choose the fxo port and so on. You should check your gateway’s manual to see if your gateway allows this and how to configure if it is allowed.
For the grandstream gateway that I use, the way to do it is with separate trunks for each fxo, where each trunk points to a different udp port.
So it seems I might be able to do this with some fancy dial plan shenanigans, but it’s not working properly and I can’t imagine this is the intended way to do this.
I have an outbound route that uses my Vega 60 as the trunk
Under the dial patterns, I have some basic (for now) patterns:
I have both a prefix (for dialing from the phone) and a prepend (for triggering my Vega 60):
I was able to make this work, but it included manually changing some of the settings on my Vega 60.
As a recap, I was looking to be able to dial out specific FXO ports based on the dial plan (e.g. - dialing 7 + the number would go out FXO1; dialing 8 + the number would go out FXO2, and so forth).
First I had to set up specific dial plans on my outbound routes:
It probably wasn’t necessary to set up the second group (for POTS7) as it only has one destination, but I wanted to set up call hunting for my first few FXO ports so it would choose an available port.
Finally, I manually edited the TO_FXO profile to look for the prepend number (from above) and choose the correct FXO port (or call group in this case):
It took a bunch of trial and error, but it seems to be working fine through all my testing.
I am, worried, however, that using the Vega gateway management feature in FreePBX will overwrite my custom config in my Vega 60 if and when I make changes to it via FreePBX. Hopefully that will not be necessary.