FS-10109: mod_directory - Added variable directory_voicemail_profile to specify the mod_voicemail profile to query informations

This commit is contained in:
Marc Olivier Chouinard 2017-03-08 16:18:12 -05:00
parent f8789c0130
commit ad64b78eed

View File

@ -255,6 +255,7 @@ struct search_params {
char transfer_to[255];
char domain[255];
char profile[255];
char vm_profile[255];
search_by_t search_by;
int timeout;
int try_again;
@ -751,7 +752,7 @@ static switch_status_t listen_entry(switch_core_session_t *session, dir_profile_
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));
@ -956,6 +957,7 @@ SWITCH_STANDARD_APP(directory_function)
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;
@ -1013,9 +1015,14 @@ SWITCH_STANDARD_APP(directory_function)
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"))) {