If you want calls to be routed to another application (e.g. Voicemail or Phone call-back) based on the availability of agents, then you just need to use a Trigger that checks availability.
Here is a trigger that checks if at least 1 agent is available (i.e. is not in a call and is enabled):
Once you have that trigger, you can use it in your call flow applications. Here you see it used to decide whether what welcome message app to use - in the second case the trigger condition is inverted - see with the second green check mark, so it tests that agents are NOT available in that case:
And here you can see the same trigger used to decide when to put the call into the queue (i.e when should the call be put through to agents/users):
So if agents are not available, the call will go straight to the "After flow" for that queue (e.g. your voicemail app or another application).