]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
patch from MODAPP-156 with mods
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 24 Oct 2008 00:28:10 +0000 (00:28 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 24 Oct 2008 00:28:10 +0000 (00:28 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10137 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_voicemail/mod_voicemail.c

index 5053d87d1e76c39d11c8e4aa89406b3032eb7818..94337a674547f6ce6a514fea7ef8872a6a012641 100644 (file)
@@ -1983,22 +1983,33 @@ static void voicemail_check_main(switch_core_session_t *session, const char *pro
                                                thehash = val;
                                        } else if (!strcasecmp(var, "vm-a1-hash")) {
                                                vmhash = val;
-                                       } else if (!strcasecmp(var, "password")) {
-                                               thepass = val;
-                                       } else if (!strcasecmp(var, "vm-password")) {
+                                       } else if (!auth && !thepass && !strcasecmp(var, "password")) {
                                                thepass = val;
+                                       } else if (!auth && !strcasecmp(var, "vm-password")) {
+                                               if (!switch_strlen_zero(val) && !strcasecmp(val, "user-choose")) {
+                                                       if (switch_strlen_zero(cbt.password)) {
+                                                               auth = 1;
+                                                       } else {
+                                                               thepass = val;
+                                                       }
+                                               } else {
+                                                       thepass = val;
+                                               }
                                        } else if (!strcasecmp(var, "vm-mailto")) {
                                                vm_email = switch_core_session_strdup(session, val);
                                        } else if (!strcasecmp(var, "storage-dir")) {
                                                vm_storage_dir = switch_core_session_strdup(session, val);
-                                       } else if (!switch_strlen_zero(cbt.password) && !thepass) {
-                                               thepass = cbt.password;
-                                       }
+                                       } 
+
                                }
                                
                                if (vmhash) {
                                        thehash = vmhash;
                                }
+                               
+                               if (!auth && !thepass && !switch_strlen_zero(cbt.password)) {
+                                       thepass = cbt.password;
+                               }
 
                                if (!auth) {
                                        if (!switch_strlen_zero(cbt.password) && !strcmp(cbt.password, mypass)) {