vm_notify_email = switch_core_strdup(pool, val);
} else if (!strcasecmp(var, "email-addr")) {
email_addr = switch_core_strdup(pool, val);
- } else if (!strcasecmp(var, "vm-email-all-messages")) {
- send_main = switch_true(val);
+ } else if (!strcasecmp(var, "vm-email-all-messages") && (send_main = switch_true(val))) {
send_mail++;
- } else if (!strcasecmp(var, "vm-notify-email-all-messages")) {
- send_notify = switch_true(val);
+ } else if (!strcasecmp(var, "vm-notify-email-all-messages") && (send_notify = switch_true(val))) {
send_mail++;
} else if (!strcasecmp(var, "vm-keep-local-after-email")) {
insert_db = switch_true(val);
vm_notify_email = switch_core_session_strdup(session, val);
} else if (!strcasecmp(var, "email-addr")) {
email_addr = switch_core_session_strdup(session, val);
- } else if (!strcasecmp(var, "vm-email-all-messages")) {
- send_main = switch_true(val);
+ } else if (!strcasecmp(var, "vm-email-all-messages") && (send_main = switch_true(val))) {
send_mail++;
} else if (!strcasecmp(var, "storage-dir")) {
vm_storage_dir = switch_core_session_strdup(session, val);
- } else if (!strcasecmp(var, "vm-notify-email-all-messages")) {
- send_notify = switch_true(val);
+ } else if (!strcasecmp(var, "vm-notify-email-all-messages") && (send_notify = switch_true(val))) {
send_mail++;
} else if (!strcasecmp(var, "vm-keep-local-after-email")) {
insert_db = switch_true(val);
if (num > 0 && num <= VM_MAX_GREETINGS) {
greet_path = switch_mprintf("%s%sgreeting_%d.%s", dir_path, SWITCH_PATH_SEPARATOR, num, profile->file_ext);
}
- } else {
+ } else if (!(greet_path = (char *) switch_channel_get_variable(channel, "voicemail_greeting_path"))) {
greet_path = cbt.greeting_path;
}