char transfer_to[255];
char domain[255];
char profile[255];
+ char vm_profile[255];
search_by_t search_by;
int timeout;
int try_again;
switch_stream_handle_t stream = { 0 };
SWITCH_STANDARD_STREAM(stream);
- cmd = switch_core_session_sprintf(session, "%s/%s@%s|name_path", cbt->params->profile, cbt->extension, cbt->params->domain);
+ cmd = switch_core_session_sprintf(session, "%s/%s@%s|name_path", cbt->params->vm_profile, cbt->extension, cbt->params->domain);
switch_api_execute("vm_prefs", cmd, session, &stream);
if (strncmp("-ERR", stream.data, 4)) {
switch_copy_string(recorded_name, (char *) stream.data, sizeof(recorded_name));
char *argv[6] = { 0 };
char *mydata = NULL;
const char *profile_name = NULL;
+ const char *vm_profile_name = NULL;
const char *domain_name = NULL;
const char *context_name = NULL;
const char *dialplan_name = NULL;
populate_database(session, profile, domain_name);
+ if (!(vm_profile_name = switch_channel_get_variable(channel, "directory_voicemail_profile"))) {
+ vm_profile_name = profile_name;
+ }
+
memset(&s_param, 0, sizeof(s_param));
s_param.try_again = 1;
switch_copy_string(s_param.profile, profile_name, 255);
+ switch_copy_string(s_param.vm_profile, vm_profile_name, 255);
switch_copy_string(s_param.domain, domain_name, 255);
if (!(search_by = switch_channel_get_variable(channel, "directory_search_order"))) {