Aqui está um exemplo de como faço isso com voz e troncos do google. Com a minha configuração eu tive que fazer um caminho para limitar gv a 1 canal, também configurei uma rotação para que o primeiro tronco gv não seja sempre martelado desde que é o primeiro. Há muito mais para isso, mas por apenas exibir failover eu pensei que isso era mais que suficiente:
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = ""]?15:)
exten => _1NXXNXXXXXX,15,Set(goto=$[${PRIORITY} + 15])
exten => _1NXXNXXXXXX,n,Set(thetrunk=feliciesmaty)
exten => _1NXXNXXXXXX,n,GotoIf($[${${thetrunk}} > 0]?${goto})
exten => _1NXXNXXXXXX,n,Set(GLOBAL(${thetrunk})=1)
exten => _1NXXNXXXXXX,n,Dial(Motif/[email protected]/${EXTEN}@voice.google.com,,r)
exten => _1NXXNXXXXXX,n,Set(GLOBAL(${thetrunk})=0)
exten => _1NXXNXXXXXX,n,Verbose(0, getting staus ${DIALSTATUS} );
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "SUCCESS"]?hangup:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "FAILED"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "NOANSWER"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "CANCEL"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "BUSY"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "CONGESTION"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "HANGUP"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "UNKNOWN"]?${goto}:)
exten => _1NXXNXXXXXX,30,Set(goto=$[${PRIORITY} + 20])
exten => _1NXXNXXXXXX,n,Set(thetrunk=bettyrobertson169gmailcom)
exten => _1NXXNXXXXXX,n,GotoIf($[${${thetrunk}} > 0]?${goto})
exten => _1NXXNXXXXXX,n,Set(GLOBAL(${thetrunk})=1)
exten => _1NXXNXXXXXX,n,Dial(Motif/bettyrobertson169gmailcom/${EXTEN}@voice.google.com,,r)
exten => _1NXXNXXXXXX,n,Set(GLOBAL(${thetrunk})=0)
exten => _1NXXNXXXXXX,n,Verbose(0, getting staus ${DIALSTATUS} );
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "SUCCESS"]?hangup:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "FAILED"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "NOANSWER"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "CANCEL"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "BUSY"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "CONGESTION"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "HANGUP"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "UNKNOWN"]?${goto}:)
exten => _1NXXNXXXXXX,50,Set(goto=$[${PRIORITY} + 25])
exten => _1NXXNXXXXXX,n,Set(thetrunk=swigartjosephgmailcom)
exten => _1NXXNXXXXXX,n,GotoIf($[${${thetrunk}} > 0]?${goto})
exten => _1NXXNXXXXXX,n,Set(GLOBAL(${thetrunk})=1)
exten => _1NXXNXXXXXX,n,Dial(Motif/swigartjosephgmailcom/${EXTEN}@voice.google.com,,r)
exten => _1NXXNXXXXXX,n,Set(GLOBAL(${thetrunk})=0)
exten => _1NXXNXXXXXX,n,Verbose(0, getting staus ${DIALSTATUS} );
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "SUCCESS"]?hangup:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "FAILED"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "NOANSWER"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "CANCEL"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "BUSY"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "CONGESTION"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "HANGUP"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "UNKNOWN"]?${goto}:)
exten => _1NXXNXXXXXX,75,Set(goto=$[${PRIORITY} + 25])
exten => _1NXXNXXXXXX,n,Set(thetrunk=bettyrobertson169gmailcom)
exten => _1NXXNXXXXXX,n,GotoIf($[${${thetrunk}} > 0]?${goto})
exten => _1NXXNXXXXXX,n,Set(GLOBAL(${thetrunk})=1)
exten => _1NXXNXXXXXX,n,Dial(Motif/bettyrobertson169gmailcom/${EXTEN}@voice.google.com,,r)
exten => _1NXXNXXXXXX,n,Set(GLOBAL(${thetrunk})=0)
exten => _1NXXNXXXXXX,n,Verbose(0, getting staus ${DIALSTATUS} );
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "SUCCESS"]?hangup:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "FAILED"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "NOANSWER"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "CANCEL"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "BUSY"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "CONGESTION"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "HANGUP"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "UNKNOWN"]?${goto}:)
exten => _1NXXNXXXXXX,100,Set(goto=$[${PRIORITY} + 25])
exten => _1NXXNXXXXXX,n,Set(thetrunk=sandralanago)
exten => _1NXXNXXXXXX,n,GotoIf($[${${thetrunk}} > 0]?${goto})
exten => _1NXXNXXXXXX,n,Set(GLOBAL(${thetrunk})=1)
exten => _1NXXNXXXXXX,n,Dial(Motif/[email protected]/${EXTEN}@voice.google.com,,r)
exten => _1NXXNXXXXXX,n,Set(GLOBAL(${thetrunk})=0)
exten => _1NXXNXXXXXX,n,Verbose(0, getting staus ${DIALSTATUS} );
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "SUCCESS"]?hangup:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "FAILED"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "NOANSWER"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "CANCEL"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "BUSY"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "CONGESTION"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "HANGUP"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "UNKNOWN"]?${goto}:)
exten => _1NXXNXXXXXX,125,Set(goto=$[${PRIORITY} + 25])
exten => _1NXXNXXXXXX,n,Set(thetrunk=sofiadugal)
exten => _1NXXNXXXXXX,n,GotoIf($[${${thetrunk}} > 0]?${goto})
exten => _1NXXNXXXXXX,n,Set(GLOBAL(${thetrunk})=1)
exten => _1NXXNXXXXXX,n,Dial(Motif/[email protected]/${EXTEN}@voice.google.com,,r)
exten => _1NXXNXXXXXX,n,Set(GLOBAL(${thetrunk})=0)
exten => _1NXXNXXXXXX,n,Verbose(0, getting staus ${DIALSTATUS} );
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "SUCCESS"]?hangup:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "FAILED"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "NOANSWER"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "CANCEL"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "BUSY"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "CONGESTION"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "HANGUP"]?${goto}:)
exten => _1NXXNXXXXXX,n,GotoIf($["${DIALSTATUS}" = "UNKNOWN"]?${goto}:)