]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Fix DBDelTree error codes for AMI, CLI and AGI
authorDavid M. Lee <dlee@digium.com>
Thu, 4 Oct 2012 15:25:50 +0000 (15:25 +0000)
committerDavid M. Lee <dlee@digium.com>
Thu, 4 Oct 2012 15:25:50 +0000 (15:25 +0000)
commit2075c52a31991f5b596c14200091013afe4f6b9b
tree3a6f9ea1ab291e77c30b6f41d43689553c5215f5
parent57e403e023416d33be2201938a711a7ea1e67607
Fix DBDelTree error codes for AMI, CLI and AGI

The AMI DBDelTree command will return Success/Key tree deleted successfully even
if the given key does not exist. The CLI command 'database deltree' had a
similar problem, but was saved because it actually responded with '0 database
entries removed'. AGI had a slightly different error, where it would return
success if the database was unavailable.

This came from confusion about the ast_db_deltree retval, which is -1 in the
event of a database error, or number of entries deleted (including 0 for
deleting nothing).

* Adds a Doxygen comment to process_db_keys explaining its retval
* Changed some poorly named res variables to num_deleted
* Specified specific errors when calling ast_db_deltree (database unavailable
  vs. entry not found vs. success)
* Fixed similar bug in AGI database deltree, where 'Database unavailable'
  results in successful result

(closes issue AST-967)
Reported by: John Bigelow
Review: https://reviewboard.asterisk.org/r/2138/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@374426 65c4cc65-6c06-0410-ace0-fbb531ad65f3
main/db.c
res/res_agi.c