amraa_kaze,
First of all, finding a routine or macro (e.g. like used by FreePBX) that would do this, will be almost impossible. The reason for this is that it is not how a professional business would like to run.
Using your idea of only allowing calls in if an agent is available, you would need to write a macro that disabled your ability to accept calls based on Agents available. What this would present to a caller would be an engaged signal or a call drop, which is not very professional. The caller would not know whether their phone has an issue, or you have an issue on your end....However I am sure it could be written, but as for a professional outcome, I know I would not like it....
It is well known that waiting in a Queue will cost money (even carriers or internet providers have you waiting in queue....as a caller you weigh up whether it is worth waiting (which is why position in the queue or time to be answered is useful to a caller (which you can do with a standard Elastix system). If a person who calls, cannot afford to wait (e.g. they are using a Mobile), then you would choose a landline and call for a local call cost.
Likewise, you can implement a Queue Breakout IVR, say every minute (which is again in Elastix) with a message allowing them to leave a voicemail if they wish or there are some addons which will allow call back.....that is a professional solution.
Otherwise your other solutions is to hire more agents or add a priority number with a Priority queue if you have some "special" people. Provide them with this number if they have to ring the queue often...
All these things are industry standard....and expected... I know I get frustrated when I get no feedback on my position in the queue (so I can confirm I am not wasting my time with all agents on lunch).....and more frustrated when I cannot leave a message - I come to a very quick conclusion that it is a company that I don't wish to deal with...
Regards
Bob