mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-02 19:16:15 +00:00
db: Notify user if deleted DB entry didn't exist.
Currently, if using the CLI to delete a DB entry, "Database entry removed" is always returned, regardless of whether or not the entry actually existed in the first place. This meant that users were never told if entries did not exist. The same issue occurs if trying to delete a DB key using AMI. To address this, new API is added that is more stringent in deleting values from AstDB, which will not return success if the value did not exist in the first place, and will print out specific error details if available. ASTERISK-30001 #close Change-Id: Ic84e3eddcd66c7a6ed7fea91cdfd402568378b18
This commit is contained in:
committed by
Kevin Harwell
parent
b841845453
commit
350ffcb02b
@@ -56,6 +56,17 @@ int ast_db_put(const char *family, const char *key, const char *value);
|
||||
/*! \brief Delete entry in astdb */
|
||||
int ast_db_del(const char *family, const char *key);
|
||||
|
||||
/*! \brief Same as ast_db_del, but with more stringent error checking
|
||||
*
|
||||
* \details
|
||||
* Unlike ast_db_del, if the key does not exist in the first place,
|
||||
* an error is emitted and -1 is returned.
|
||||
*
|
||||
* \retval -1 An error occured (including key not found to begin with)
|
||||
* \retval 0 Successfully deleted
|
||||
*/
|
||||
int ast_db_del2(const char *family, const char *key);
|
||||
|
||||
/*!
|
||||
* \brief Delete one or more entries in astdb
|
||||
*
|
||||
|
Reference in New Issue
Block a user