[Asterisk-Users] Random outbound:

Ronald Wiplinger ronald at elmit.com
Fri Apr 1 18:22:30 MST 2005


Andres wrote:

>
>
> Tim Connolly wrote:
>
>> Can anyone suggest a way to randomly pick an outbound trunk so that 
>> all trunks are used equally? I’m all about Equal Trunk Opportunity… 
>> Seriously though, I’ve got 500 minutes per softphone account and I’d 
>> like to use an equal amount on each as to not see overages on any 
>> particular account until all have been depleted.
>>
> Use this:
>
> CLI> show application random
> CLI>
> -= Info about application 'Random' =-
>
> [Synopsis]:
> Conditionally branches, based upon a probability
>
> [Description]:
> Random([probability]:[[context|]extension|]priority)
> probability := INTEGER in the range 1 to 100
>
>


I am at the same point.
The application Random() sounds for the first moment good, but thinking 
deeper it is not that much help, because, if you have two outbound 
lines, than it is easy:

1-2-1    and you jump  either to 1 or 2   with a 50% chance, and if busy 
you go to the next line, however with 3 lines it starts to get 
complicated, with 4 it is not easy handelable and with latest 5 you are 
seeking an agi!!!!!! The problem is, that after you jump the first time 
and that particular line is busy, than you should jump again (Random), 
but without the lines you had already found as busy!!! After all tries 
are used and still a busy line, than it should send you a warning email, 
while the caller gets "congestion"..

my 2cents


bye

Ronald





More information about the asterisk-users mailing list