[Asterisk-Users] Old DBGet/DBPut vs. new Set(var=${DB(...

Chris A. Icide chris at netgeeks.net
Sun May 15 22:10:16 MST 2005


On 07:57 PM 5/15/2005, Jean-Yves Avenard wrote:

>Hello
>
>I upgraded to CVS head yesterday (due to the lack of zaptel drivers 
>working with 2.6.10)
>And noticed that now DBGet and DBPut have been deprecated in favour of the 
>new Set/DB one.
>
>In the UPGRADING.txt in Asterisk it says:
>* The applications DBGet and DBPut have been deprecated in favor of
>   functions.  Here is a table of their replacements:
>
>   DBGet(foo=family/key)        Set(foo=${DB(family/key)})
>   DBPut(family/key=${foo})     Set(${DB(family/key)}=${foo})
>
>
>I fail to see how DBGet and DBPut can be replaced by those two commands
>
>If I want to create a new database entry:
>DBPut(CFIM/200=300)
>I will create the entry if it doesn't exist
>
>With the new Set(${DB(CFIM/200)}=300) I get:
>May 16 12:39:39 WARNING[11111]: func_db.c:54 function_db_read: DB: 
>CFIM/200 not found in database.
>     -- Executing Set("SIP/ipp100-1d45", "=300") in new stack
>     -- Executing Playback("SIP/ipp100-1d45", "auth-thankyou") in new stack
>
>as abviously DB(CFIM/200) always get replaced by its value which in this 
>instance doesn't exist yet
>
>the other serious problem is that DBGet used to automatically jump to 
>prioriy n+101 if the entry didn't exist. Now I will do things like:
>Set(temp=${DB(CFIM/200)})
>which will set temp to "" instead of jumping to an error.
>
>I wish DBGet and DBPut weren'”\Ãw”ë t removed their replacements are no 
>good and can't be made to behave the same without serious re-work (like 
>testing the returned entry is not null etc...)
>
>Any ideas on work-around or did I miss anything?

First, either go post on -dev about the differences between the old way and 
the new.  Functionality was NOT supposed to change.  You can continue to 
use the old functions for now, if they have been removed (they should still 
be there for the time being) then fall back a little in time.  The May 2nd 
CVS HEAD should be working the way you are used to.

Definately, post this bug to -dev if it's not already there

-Chris 




More information about the asterisk-users mailing list