Outgoing call load balancing

Greetings to you, colleagues!

Tell me, please, how to solve the problem in the most correct and elegant way.

I have several outgoing lines and I want to distribute outgoing calls more or less evenly between them.

At the same time, I fully admit that some lines may be busy, and some may not be served. In this case, the call should be routed to the next highest priority line.

In fact, I need an analogue of the queue of incoming calls, only for outgoing.
Need to develop some kind of functionality, or is there a ready-made solution?

Thank you in advance for the answer,
Ogogon.

All agents are outgoing as far as queues are concerned.

What do you mean by line, and why is it important to balance calls across them.

(For cirrcuit switched technologies, round robin scheduling increases the chance of race conditions (glare).

I apologize if I explained it is not clear enough.

For example, I have a SIP-GSM gateway on several SIM cards and I want outgoing calls to be distributed evenly across workable cards.