Previously, a call to ast_load_realtime_multientry could get away with
passing a NULL parameter to the function, even though it really isn't
supposed to do that. After the change over to using ast_variable instead
of variadic arguments, the realtime engine gets unhappy if you do this.
This was always an unintended function call in app_directory anyway - now,
we just don't call into the realtime function calls if we don't have anything
to query on.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388008
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
static struct ast_config *realtime_directory(char *context)
{
struct ast_config *cfg;
- struct ast_config *rtdata;
+ struct ast_config *rtdata = NULL;
struct ast_category *cat;
struct ast_variable *var;
char *mailbox;
rtdata = ast_load_realtime_multientry("voicemail", "mailbox LIKE", "%", "context", "default", SENTINEL);
context = "default";
}
- } else {
+ } else if (!ast_strlen_zero(context)) {
rtdata = ast_load_realtime_multientry("voicemail", "mailbox LIKE", "%", "context", context, SENTINEL);
}