mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-07-16 11:52:01 +00:00
fix domain param lookup
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11369 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
a226a4f756
commit
6bc24b8c98
@ -148,7 +148,7 @@ static switch_status_t http_stream_write(switch_stream_handle_t *handle, const c
|
|||||||
return ret ? SWITCH_STATUS_FALSE : SWITCH_STATUS_SUCCESS;
|
return ret ? SWITCH_STATUS_FALSE : SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static abyss_bool http_directory_auth(TSession * r, char *domain_name)
|
static abyss_bool http_directory_auth(TSession *r, char *domain_name)
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
char *x;
|
char *x;
|
||||||
@ -210,7 +210,7 @@ static abyss_bool http_directory_auth(TSession * r, char *domain_name)
|
|||||||
switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS);
|
switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS);
|
||||||
switch_assert(params);
|
switch_assert(params);
|
||||||
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "mailbox", "check");
|
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "mailbox", "check");
|
||||||
|
|
||||||
if (switch_xml_locate_user("id", user, domain_name, NULL, &x_domain_root, &x_domain, &x_user, NULL, params) != SWITCH_STATUS_SUCCESS) {
|
if (switch_xml_locate_user("id", user, domain_name, NULL, &x_domain_root, &x_domain, &x_user, NULL, params) != SWITCH_STATUS_SUCCESS) {
|
||||||
switch_event_destroy(¶ms);
|
switch_event_destroy(¶ms);
|
||||||
goto fail;
|
goto fail;
|
||||||
@ -218,17 +218,20 @@ static abyss_bool http_directory_auth(TSession * r, char *domain_name)
|
|||||||
|
|
||||||
switch_event_destroy(¶ms);
|
switch_event_destroy(¶ms);
|
||||||
box = switch_xml_attr_soft(x_user, "mailbox");
|
box = switch_xml_attr_soft(x_user, "mailbox");
|
||||||
|
|
||||||
for (x_param = switch_xml_child(x_domain, "param"); x_param; x_param = x_param->next) {
|
|
||||||
const char *var = switch_xml_attr_soft(x_param, "name");
|
|
||||||
const char *val = switch_xml_attr_soft(x_param, "value");
|
|
||||||
|
|
||||||
if (!strcasecmp(var, "password")) {
|
if ((x_params = switch_xml_child(x_domain, "params"))) {
|
||||||
mypass1 = val;
|
|
||||||
} else if (!strcasecmp(var, "vm-password")) {
|
for (x_param = switch_xml_child(x_params, "param"); x_param; x_param = x_param->next) {
|
||||||
mypass2 = val;
|
const char *var = switch_xml_attr_soft(x_param, "name");
|
||||||
} else if (!strncasecmp(var, "http-", 5)) {
|
const char *val = switch_xml_attr_soft(x_param, "value");
|
||||||
ResponseAddField(r, (char *) var, (char *) val);
|
|
||||||
|
if (!strcasecmp(var, "password")) {
|
||||||
|
mypass1 = val;
|
||||||
|
} else if (!strcasecmp(var, "vm-password")) {
|
||||||
|
mypass2 = val;
|
||||||
|
} else if (!strncasecmp(var, "http-", 5)) {
|
||||||
|
ResponseAddField(r, (char *) var, (char *) val);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -240,7 +243,7 @@ static abyss_bool http_directory_auth(TSession * r, char *domain_name)
|
|||||||
for (x_param = switch_xml_child(x_params, "param"); x_param; x_param = x_param->next) {
|
for (x_param = switch_xml_child(x_params, "param"); x_param; x_param = x_param->next) {
|
||||||
const char *var = switch_xml_attr_soft(x_param, "name");
|
const char *var = switch_xml_attr_soft(x_param, "name");
|
||||||
const char *val = switch_xml_attr_soft(x_param, "value");
|
const char *val = switch_xml_attr_soft(x_param, "value");
|
||||||
|
|
||||||
if (!strcasecmp(var, "password")) {
|
if (!strcasecmp(var, "password")) {
|
||||||
mypass1 = val;
|
mypass1 = val;
|
||||||
} else if (!strcasecmp(var, "vm-password")) {
|
} else if (!strcasecmp(var, "vm-password")) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user