We have 5 PRI's from Service Provider A and 1 PRI from Service Provider B.
5 PRI's from Service provier A has to be used in sequential and if no channels are available in any of the 5 PRI's, then the call has to be routed to 1 PRI of Service provider B.
Please suggest, if this can be achieved using hunt scheme or any other command.
I would advise to define a dial-peer for every Pri (with the same destination pattern) and configure the "preference" accordingly to your needs.
Using trunk groups does often cause problems when one ore more of the Pri interfaces are out of service.
In the case you described the dial-peer pointing to pri of provider B should have the lowest priority (highest preference).
The router should start with the dial-peer(s) with the best preference and if the call can not be placed over these it will continue on the next one with best priority.
Just saying: "huntstop" must not be configured on these dial-peers...
You don't say what your configuration is (CUCM or CUCM Express) but in CUCM this is certainly possible via route groups and route lists.
You're right. I should have been more precise.
If you are using MGCP to control you PRI interfaces you could do this in CUCM with route groups and route lists.
If you are using CCME or one pstn gateway connected to cucm via sip or h.323 my choise would be dial-peers with different preference.
If you are using CUCM with more than one pstn gateway (h.323 / sip) you will have to use a combination of cucm and ios config.