From: Ivan Poddubny Date: Wed, 7 Oct 2015 06:24:31 +0000 (+0300) Subject: func_presencestate: Return "not_set" when no data is set in AstDB X-Git-Tag: 14.0.0-beta1~641 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c944263e3688ab257aaf98980190f359b61d31f7;p=thirdparty%2Fasterisk.git 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 --- diff --git a/funcs/func_presencestate.c b/funcs/func_presencestate.c index 775c7dc794..d7d6b2439a 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;