exten => _X.,1,Set(GROUP()=provider1)
same => n,GotoIF($[${GROUP_COUNT(provider1)} > 1]?prov2)
same => n,Dial(SIP/provider1/${EXTEN},60)
same => n(prov2),Set(GROUP()=provider2)
same => n,GotoIF($[${GROUP_COUNT(provider2)} > 4]?prov3)
same => n,Dial(SIP/provider2/${EXTEN},60)
same => n(prov3),Set(GROUP()=provider3)
same => n,GotoIF($[${GROUP_COUNT(provider3)} > 10]?stop)
same => n,Dial(SIP/provider3/${EXTEN},60)
same => n(stop),Hangup()
# conf t
(conf)# dial-peer voice 201 pots
(conf-dial-peer)# <Tab><Tab>