I have 2 asterisk servers connected each one to a E1 trunk, so a call can be answered from each one of the servers. Both servers share the same CDR SQL database. I need to assure that no more that N calls will be answered simultanously, being N the sum of simultaneous calls on each server. Is there a way to accomplish this?
You could use a MySql command in the Dialplan to check a field in the SQL database to see how many active calls there are if it is > X then don’t take the call otherwise increment by one and take the call. Just have to remember to decrement it when a call is disconnected.