login | register
Sun 12 of Oct, 2008 [11:25 UTC]

voip-info.org

Discuss [4] History

Asterisk func db

Created by: Corydon76,Last modification on Fri 12 of Jan, 2007 [09:13 UTC] by mimmus

DB

AstDB access function


Synopsis

DB(family/key)

Description

DB provides inline access to the values in the Asterisk Database without executing a separate application.
DB may be both read from and written to. On a read, this function returns the corresponding value from the database, or blank if it does not exist. Reading a database value will also set the variable DB_RESULT.
If you wish to find out if an entry exists, use the DB_EXISTS function.

Examples

Write (pre 1.2 see DBput)


  
  exten => s,1,Set(DB(family/key)=${foo})

  exten => s,1,Set(DB(office/open)=1)


Read (pre 1.2 see DBget)


  exten => s,1,Set(foo=${DB(family/key)})

  exten => s,1,GotoIf($[${DB(office/open)} = 1]?daytime:nighttime)



See Also


Go back to Asterisk - documentation of application commands


Comments

Comments Filter
222

333

by uros, Thursday 18 of January, 2007 [12:59:44 UTC]
222

333

by uros, Thursday 18 of January, 2007 [12:57:00 UTC]
222

333

by uros, Thursday 18 of January, 2007 [12:56:40 UTC]
222

333One more example please

by uros, Thursday 18 of January, 2007 [12:53:13 UTC]
Example from dialplan how to set value for family-key with possibility to set value to 1 if key does not exists would be appreciated.

Thanks