[Asterisk-Dev] Loss of functionality with depreciation of DBGet/Put?
Chris A. Icide
chris at netgeeks.net
Mon May 16 09:32:48 MST 2005
Hey folks, just re-routing a post I caught on users. Seems some
functionality may have been lost in the internal database function.
-Chris
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?
More information about the asterisk-dev
mailing list