]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10109: mod_directory - Added variable directory_voicemail_profile to specify the...
authorMarc Olivier Chouinard <mochouinard@moctel.com>
Wed, 8 Mar 2017 21:18:12 +0000 (16:18 -0500)
committerMarc Olivier Chouinard <mochouinard@moctel.com>
Wed, 8 Mar 2017 21:18:12 +0000 (16:18 -0500)
src/mod/applications/mod_directory/mod_directory.c

index 61a05a93a5c2a153464b8ed9333a5598d4da340e..29e46b8568b7e5ff8ced696e26fc90f745d65afd 100644 (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"))) {