diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c index e6ce3aecf0..195ac3170f 100644 --- a/src/mod/applications/mod_voicemail/mod_voicemail.c +++ b/src/mod/applications/mod_voicemail/mod_voicemail.c @@ -2582,6 +2582,7 @@ static switch_status_t deliver_vm(vm_profile_t *profile, char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1]; const char *filename; switch_xml_t x_param, x_params; + const char *vm_cc = NULL, *vm_cc_tmp = NULL; char *vm_email = NULL; char *vm_email_from = NULL; char *vm_notify_email = NULL; @@ -2641,7 +2642,9 @@ static switch_status_t deliver_vm(vm_profile_t *profile, const char *var = switch_xml_attr_soft(x_param, "name"); const char *val = switch_xml_attr_soft(x_param, "value"); - if (!strcasecmp(var, "vm-mailto")) { + if (!strcasecmp(var, "vm-cc")) { + vm_cc = switch_core_strdup(pool, val); + } else if (!strcasecmp(var, "vm-mailto")) { vm_email = switch_core_strdup(pool, val); } else if (!strcasecmp(var, "vm-notify-mailto")) { vm_notify_email = switch_core_strdup(pool, val); @@ -2922,18 +2925,34 @@ static switch_status_t deliver_vm(vm_profile_t *profile, if (session) { switch_channel_t *channel = switch_core_session_get_channel(session); - const char *vm_cc; + if (channel && (vm_cc_tmp = switch_channel_get_variable(channel, "vm_cc"))) { + vm_cc = vm_cc_tmp; + } + } - if ((vm_cc = switch_channel_get_variable(channel, "vm_cc"))) { + if (vm_cc) { + char *vm_cc_dup; + int vm_cc_num = 0; + char *vm_cc_list[256] = { 0 }; + int vm_cc_i; + + vm_cc_dup = strdup(vm_cc); + vm_cc_num = switch_separate_string(vm_cc_dup, ',', vm_cc_list, (sizeof(vm_cc_list) / sizeof(vm_cc_list[0]))); + + for (vm_cc_i=0; vm_cc_i