[asterisk-dev] Call priority and Dial()

Jean-Michel Hiver jhiver at ykoz.net
Tue Sep 5 12:07:06 MST 2006


Andrew Kohlsmith a écrit :

>I've opened up bug 7882: http://bugs.digium.com/view.php?id=7882
>
>Now seeing as (as far as I can tell) it involves adding a variable to the 
>channel structure, I'd like to get some input from the developers before I 
>put a lot of blood, sweat and tears into solving this particular issue.
>
>I know that messing around with ast_channel can only be done when all other 
>options are evaluated; that's what this thread has been started for.
>
>Essentially what I am trying to do is allow Dial() to terminate a 
>lower-priority call in order to place a higher-priority one if and only if 
>there are no available channels.  This can currently be done in a hackish way 
>with an AGI or perhaps even the Manager interface, but race conditions 
>abound.  If I can put this in app_dial I can eliminate a lot of headaches.
>  
>
Maybe one generic way to implement this is to have a penality model.

If a link is saturated (i.e. you get a fast busy), and you are obliged 
to disconnect, apply a temporary penality (with a half life) to the link 
before disconnecting one of the low priority call, so that you let the 
high priority call in.

a) Increase the penality level. For instance with PENALITY_LEVEL *= 2;
    The penality stops all further calls with a priority < PENALITY_LEVEL

b) Disconnect the call with the lowest priority for this peer

c) Connect your call

Decay the penality with <configurable amount of seconds> "half life".

You need to have a special priority which always ignores the penality 
(but still increases the penality level), for example for emergency calls.

Just my 2c!

Cheers,
Jean-Michel.



More information about the asterisk-dev mailing list