提交 8895de1b authored 作者: Travis Cross's avatar Travis Cross

let mod_directory use non-XML dialplans

上级 3b5a0ae5
...@@ -311,7 +311,7 @@ static switch_bool_t directory_execute_sql_callback(switch_mutex_t *mutex, char ...@@ -311,7 +311,7 @@ static switch_bool_t directory_execute_sql_callback(switch_mutex_t *mutex, char
} }
#define DIR_DESC "directory" #define DIR_DESC "directory"
#define DIR_USAGE "<profile_name> <domain_name> [<context_name>]" #define DIR_USAGE "<profile_name> <domain_name> [<context_name>] | [<dialplan_name> <context_name>]"
static void free_profile(dir_profile_t *profile) static void free_profile(dir_profile_t *profile)
{ {
...@@ -834,6 +834,7 @@ SWITCH_STANDARD_APP(directory_function) ...@@ -834,6 +834,7 @@ SWITCH_STANDARD_APP(directory_function)
const char *profile_name = NULL; const char *profile_name = NULL;
const char *domain_name = NULL; const char *domain_name = NULL;
const char *context_name = NULL; const char *context_name = NULL;
const char *dialplan_name = NULL;
dir_profile_t *profile = NULL; dir_profile_t *profile = NULL;
int x = 0; int x = 0;
char *sql = NULL; char *sql = NULL;
...@@ -860,6 +861,14 @@ SWITCH_STANDARD_APP(directory_function) ...@@ -860,6 +861,14 @@ SWITCH_STANDARD_APP(directory_function)
domain_name = argv[x++]; domain_name = argv[x++];
} }
if (argv[x]) {
if (!(argv[x+1])) {
context_name = argv[x++];
} else {
dialplan_name = argv[x++];
}
}
if (argv[x]) { if (argv[x]) {
context_name = argv[x++]; context_name = argv[x++];
} }
...@@ -873,6 +882,10 @@ SWITCH_STANDARD_APP(directory_function) ...@@ -873,6 +882,10 @@ SWITCH_STANDARD_APP(directory_function)
context_name = domain_name; context_name = domain_name;
} }
if (!dialplan_name) {
dialplan_name = "XML";
}
populate_database(session, profile, domain_name); populate_database(session, profile, domain_name);
memset(&s_param, 0, sizeof(s_param)); memset(&s_param, 0, sizeof(s_param));
...@@ -919,7 +932,7 @@ SWITCH_STANDARD_APP(directory_function) ...@@ -919,7 +932,7 @@ SWITCH_STANDARD_APP(directory_function)
if (!zstr(s_param.transfer_to)) { if (!zstr(s_param.transfer_to)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Directory transfering call to : %s\n", s_param.transfer_to); switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Directory transfering call to : %s\n", s_param.transfer_to);
switch_ivr_session_transfer(session, s_param.transfer_to, "XML", context_name); switch_ivr_session_transfer(session, s_param.transfer_to, dialplan_name, context_name);
} }
/* Delete all sql entry for this call */ /* Delete all sql entry for this call */
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论