diff options
author | Ivan Poddubny <ivan.poddubny@gmail.com> | 2015-10-07 09:24:31 +0300 |
---|---|---|
committer | Ivan Poddubny <ivan.poddubny@gmail.com> | 2015-10-07 01:46:36 -0500 |
commit | 3357678b949ebbc2f7aa00144d19bdbcfb1896b1 (patch) | |
tree | e38194d13ea0f406ca3fd1de8e059a5bfa1a1778 /funcs/func_presencestate.c | |
parent | b714b2152d2ee2f6599e9decbe927d4215b6169d (diff) |
func_presencestate: Return "not_set" when no data is set in AstDB
Return AST_PRESENCE_NOT_SET when CustomPresence AstDB key does not
exist, i.e. when a new CustomPresence is added in the dialplan.
ASTERISK-25400 #close
Reported by: Andrew Nagy
Change-Id: I6fb17b16591b5a55fbffe96f3994ec26b1b1723a
Diffstat (limited to 'funcs/func_presencestate.c')
-rw-r--r-- | funcs/func_presencestate.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/funcs/func_presencestate.c b/funcs/func_presencestate.c index f1af8b4fd..ad452df66 100644 --- a/funcs/func_presencestate.c +++ b/funcs/func_presencestate.c @@ -255,7 +255,9 @@ static enum ast_presence_state custom_presence_callback(const char *data, char * char *_message; char *_subtype; - ast_db_get(astdb_family, data, buf, sizeof(buf)); + if (ast_db_get(astdb_family, data, buf, sizeof(buf))) { + return AST_PRESENCE_NOT_SET; + } if (parse_data(buf, &state, &_subtype, &_message, &_options)) { return AST_PRESENCE_INVALID; |