Add an Integer variable, something like "agentsLoggedIn". Then use the "Get Reporting Statistic" step. Under the "Get Reporting Statistic" step properties:
* Report Object: use "CSQ ICD"
* Field: "Logged-In Resources"
* Row Identifier: the quoted name of your CSQ or a string variable containing the CSQ name
* Statistic Variable: agentsLoggedIn (or whatever)
This will leave you with an Integer variable with the number of agents logged in in that CSQ. You can test that variable for equality to zero with an If step and then branch to whatever activity you find appropriate, including transfer to voicemail.