[asterisk-dev] bweschke: branch 1.4 r150816 - /branches/1.4/main/manager.c

Russell Bryant russell at digium.com
Sun Oct 19 20:39:29 CDT 2008


On Oct 17, 2008, at 8:42 PM, SVN commits to the Digium repositories  
wrote:

> Author: bweschke
> Date: Fri Oct 17 20:42:23 2008
> New Revision: 150816
>
> URL: http://svn.digium.com/view/asterisk?view=rev&rev=150816
> Log:
> Using the GetVar handler in AMI is potentially dangerous (insta- 
> crash [tm]) when you use a dialplan function that requires a channel  
> and then you don't provide one or provide an invalid one in the  
> Channel: parameter. We'll handle this situation exactly the same way  
> it was handled in pbx.c back on r61766. We'll create a bo
> gus channel for the function call and destroy it when we're done. If  
> we have trouble allocating the bogus channel then we're not going to  
> try executing the function call at all and run the risk of crashing.


I do not have a direct problem with this change, because it is the  
correct thing to do if dialplan functions are allowed to assume a  
channel is present.

However, I'd like to propose that for the sake of performance, we  
handle this the opposite way.  How about we make it so that dialplan  
functions are _not_ allowed to assume that a channel will be present.   
For any function that _must_ have a channel to do something useful  
(like the CHANNEL() function!), just make it return an error if no  
channel is provided.

Thoughts?

--
Russell Bryant
Senior Software Engineer
Open Source Team Lead
Digium, Inc.







More information about the asterisk-dev mailing list