Freepbx endpoint manager - Prepend a code before dialing from an fxo line

Why do you want to use a code at all? Codes are error prone and don’t work well when calling from contacts, device call history, etc.

You can define an Outbound Route that lists the four trunks in whatever order you like. Or, you can define a group.