[Home]

Summary:ASTERISK-07674: Add priority to Dial()
Reporter:Andrew Kohlsmith (akohlsmith)Labels:
Date Opened:2006-09-04 21:05:56Date Closed:2011-06-07 14:02:50
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/NewFeature
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:This is just a placeholder for a new feature I'd like to work on.

If the target channel is unavailable and a priority is given to the Dial application, it will look at its list of channel technologies and the first one with a lower priority than what is given is soft hung-up, and the new call placed.  If a priority is not given, then a default priority is assigned to the outgoing call leg.

Example:
exten => _NXXNXXXXXX,1,Dial(Zap/g1/${EXTEN},,g)
exten => _NXXNXXXXXX,n,Macro(handle-hangup)
exten => 911,1,Dial(Zap/g1/911,,R(100)M(record-call)g)
exten => 911,n,Macro(handle-hangup)

(using flag "R(x)" to set pRiority)

If 911 is requested, the next available (ascending) Zap channel in group 1 is selected and, if no channel is available, the first (ascending) Zap group 1 channel with a priority lower than 100 is dropped, and a new call placed.


****** ADDITIONAL INFORMATION ******

Of course there will be some race conditions to be aware of here, as Dial() will need to make sure that another Dial(Zap/g1) will not steal the newly released channel.  Additionally the search list will have to be expanded to deal with & (e.g. Zap/g1/${EXTEN}&SIP/${EXTEN}@foo&IAX2/user@peer/${EXTEN}).

I think an additional field will have to be added to the channel structure to deal with call leg "priority", and I know that will be strongly contested...  but outside of allowing the dialplan to snoop on arbitrary channels to see their channel variables (and including all the security implications of that) I am not sure if there is a better way of doing this, even in an AGI.
Comments:By: Clod Patry (junky) 2006-09-04 21:11:58

andrew: if u need any assistance on that one, let me know, i was discussing with Jim, and i agree that's a really cool feature.

By: jmls (jmls) 2006-10-31 12:52:45.000-0600

has any work been done on this new feature ?

By: Russell Bryant (russell) 2006-11-02 20:07:53.000-0600

I agree that this would definitely be a cool feature.  However, we really do discourage using the bug tracker as a discussion forum, or development diary.  I think the asterisk-dev mailing list would be the best place to discuss implementation details until something is ready for submission.

Thanks!