Function that returns availible users in roster

To better utilize the alarm notification pipeline, i would like a function that returns the number of availible users (based on the user schedule) in a roster.

See this this thread for a description of the problem: viewtopic.php?f=70&t=11414