From 1fb8be8d888f994dec9ecfbe62d68b96736cc9b4 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 10 Sep 2008 21:18:51 +0000 Subject: [PATCH] update git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9523 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- .../mod_voicemail/mod_voicemail.c | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c index 75f1ba56df..786a78a64e 100644 --- a/src/mod/applications/mod_voicemail/mod_voicemail.c +++ b/src/mod/applications/mod_voicemail/mod_voicemail.c @@ -1923,10 +1923,7 @@ static void voicemail_check_main(switch_core_session_t *session, const char *pro } } - if (!(x_params = switch_xml_child(x_user, "params"))) { - auth++; - mypass = "OK"; - } + x_params = switch_xml_child(x_user, "params"); thepass = NULL; switch_snprintf(sql, sizeof(sql), "select * from voicemail_prefs where username='%s' and domain='%s'", myid, domain_name); @@ -1950,8 +1947,20 @@ static void voicemail_check_main(switch_core_session_t *session, const char *pro switch_xml_free(x_domain_root); x_domain_root = NULL; - if (auth || !thepass || (thepass && mypass && !strcmp(thepass, mypass)) || - (!switch_strlen_zero(cbt.password) && !strcmp(cbt.password, mypass))) { + if (!auth) { + if (switch_strlen_zero(cbt.password) && !strcmp(cbt.password, mypass)) { + auth++; + } else if (!thepass) { + auth++; + } + + if (!auth && (thepass && mypass && !strcmp(thepass, mypass))) { + auth++; + } + } + + + if (auth) { if (!dir_path) { if (!switch_strlen_zero(vm_storage_dir)) { dir_path = switch_core_session_sprintf(session, "%s%s%s", vm_storage_dir, SWITCH_PATH_SEPARATOR, myid);