From: Malcolm Davenport Date: Thu, 8 Jan 2004 20:24:13 +0000 (+0000) Subject: Fix Bug #625: Voicemail with PostgreSQL backend called with no context puts msgs in X-Git-Tag: 0.7.0~107 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=22b3dd8c17d2418797f4cb7dd3f2a704dfd96c1a;p=thirdparty%2Fasterisk.git Fix Bug #625: Voicemail with PostgreSQL backend called with no context puts msgs in wrong place git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1905 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index dc8dbdec85..7be3152e88 100755 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -287,12 +287,8 @@ static struct ast_vm_user *find_user(struct ast_vm_user *ivm, char *context, cha { strcpy(retval->context, "default"); } - - if (*retval->context) { - sprintf(query, "SELECT password,fullname,email,pager,options FROM voicemail WHERE context='%s' AND mailbox='%s'", context, mailbox); - } else { - sprintf(query, "SELECT password,fullname,email,pager,options FROM voicemail WHERE context='default' AND mailbox='%s'", mailbox); - } + sprintf(query, "SELECT password,fullname,email,pager,options FROM voicemail WHERE context='%s' AND mailbox='%s'", retval->context, mailbox); + /* fprintf(stderr,"postgres find_user: query = %s\n",query); */ ast_mutex_lock(&postgreslock); PGSQLres=PQexec(dbhandler,query);