From ad64b78eed63f47c8ec8920875b0c6131b85e7eb Mon Sep 17 00:00:00 2001 From: Marc Olivier Chouinard Date: Wed, 8 Mar 2017 16:18:12 -0500 Subject: [PATCH] FS-10109: mod_directory - Added variable directory_voicemail_profile to specify the mod_voicemail profile to query informations --- src/mod/applications/mod_directory/mod_directory.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mod/applications/mod_directory/mod_directory.c b/src/mod/applications/mod_directory/mod_directory.c index 61a05a93a5..29e46b8568 100644 --- a/src/mod/applications/mod_directory/mod_directory.c +++ b/src/mod/applications/mod_directory/mod_directory.c @@ -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"))) {