mod_directory: Add variable directory_search_order to allow to search by first name by default is set to "first_name"

This commit is contained in:
Marc Olivier Chouinard 2010-09-09 22:43:27 -04:00
parent f9d44d3bfd
commit 163ca31f2c
1 changed files with 12 additions and 0 deletions

View File

@ -884,6 +884,18 @@ SWITCH_STANDARD_APP(directory_function)
if (strcasecmp(profile->search_order, "last_name")) {
s_param.search_by_last_name = 0;
}
{
const char *var_search_order = switch_channel_get_variable(channel, "directory_search_order");
if (var_search_order) {
if (!strcasecmp(var_search_order, "first_name")) {
s_param.search_by_last_name = 0;
} else {
s_param.search_by_last_name = 1;
}
}
}
attempts = profile->max_menu_attempt;
s_param.try_again = 1;
while (switch_channel_ready(channel) && (s_param.try_again && attempts-- > 0)) {