Asterisk Server Configuration Enhancement
We have an asterisk configuration currently running on our asterisk server. This configuration is registering 5 or more extensions to a remote system. if a call comes, it randomly chooses one of the extension from mysql table and send call to that extension.
it records call date, incoming phone number(CLI) and outgoing extension to another table.
Next time if the same CLI comes, it checks that table and assigns the same extension.
It checks if call is completed and put random delay(2-4 mins) before allowing the next call on the same extension.
This is the short summary of the script.
Here is the enhancement we want to add to this script:
Current script doesn't check current active calls. For example: We have 5 extensions:
101, 102, 103, 104, 105
there is a call on 101 and 102
Another call comes in, current script randomly select one of the extension from 101-105. so call can go to 101 or 102.
We want to prevent this situation we want scripts checks current active calls and Select the extension which does not has active call on it, and the random time delay has exhausted. If 2 extensions have active calls on them and other 3 extensions are still pending to pass the random delay duration it will give busy signal and disconnect the call.