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

Jean-Yves Avenard jean-yves.avenard at hydrix.com
Sun May 15 19:57:20 MST 2005


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'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?

Jean-Yves

---
Jean-Yves Avenard
Hydrix Pty Ltd - Embedding the net
www.hydrix.com | fax +61 3 95722686 | office +61 3 8573 5299 | direct  
+61 3 8573 5200

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20050515/b48206c0/attachment.htm


More information about the asterisk-users mailing list