Asterisk func db

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

Created by: Corydon76, Last modification: Wed 13 of Jun, 2012 (07:40 UTC) by zhangjunhvmin


Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+

Page Changes | Comments

 

Featured -

Search: