[Asterisk-Dev] Loss of functionality with depreciation of DBGet/Put?

Kevin P. Fleming kpfleming at digium.com
Wed May 18 07:38:40 MST 2005


Brian West wrote:

> While I'm not trying to argue with you here.. but you can't "database  
> put" from the cli with a value that is empty.. you can with DBPut in  
> the dial plan. You shouldn't be able to dbput if the value is empty.   I 
> see no real value in doing so.  I think Leif's example was a bit  
> flawed.. and you're right ISNULL really doesn't do anything.  I think  
> fixing the functions to work correctly in the same situation is the  
> best bet.  I expect a DB_EXISTS function to return 1 if it exists and  0 
> if it doesn't.. we don't care if it has a value or not in that case  
> just that it exists.

This is pretty much what my thinking was as well; I am having a hard 
time trying to see a difference between a non-existent db key and an 
existent db key with an empty value (but I'm willing to be shown how 
that would be valuable).

As far as DB_EXISTS: there's not really any value there, since that 
still means looking in the database two times. While the lookup/GotoIf 
solution requires two dialplan lines, it's no less efficient than DB_EXISTS.

I saw the proposal with ${x=DB(CFIM/200)}... I think that might be a 
good solution, setting a variable _and_ returning its new value.



More information about the asterisk-dev mailing list