SIP trunk/peer group. Some direction needed

So I am having trouble puting this together in my head. Perhaps because I have been starting at a screen for far too long.

Anyway I would like to be able to have a number of sip peers / trunks to be used as outbound routes. Something like this.

Right now I have…

sip.conf

extensions.conf

What I would like to have…

A way to group multiple “sip providers” sip.conf and just use whatever available channels to dial out on using one dial command. Hope that makes seance.

I should be able to figure it out so just a push in the right direction is all I am looking for.

Thanks!!

Does your carrier limit you on channels ? What kind of error do they return ? You can have the calls jump from one priority to the next until it is answered. This may cause an issue if say the call goes through with the first carrier. If the caller does not hang up after the call it will go to the next carrier. You may want to check the hangup status after each carrier.

You may want to do something like this:

Exten => _X.,1,Dial(SIP/${EXTEN}@carrier1) 
Exten => _X.,2,GotoIf($["${DIALSTATUS}" = "ANSWER"]?10)
Exten => _X.,3,Dial(SIP/${EXTEN}@carrier2) 
Exten => _X.,4,GotoIf($["${DIALSTATUS}" = "ANSWER"]?10)
Exten => _X.,5,Dial(SIP/${EXTEN}@carrier3) 
Exten => _X.,6,GotoIf($["${DIALSTATUS}" = "ANSWER"]?10)
Exten => _X.,10,Hangup

If the cal was answered it will jump to priority 10 which will hang up the clal.