提交 9f96596e authored 作者: Leon de Rooij's avatar Leon de Rooij

Added Makefile again, created directory template compatible with swk's sql schema


git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk/contrib@13974 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 05059ef5
BASE=../../..
include $(BASE)/build/modmake.rules
...@@ -174,14 +174,10 @@ static switch_status_t xml_odbc_render_tag(switch_xml_t xml_in, switch_event_t * ...@@ -174,14 +174,10 @@ static switch_status_t xml_odbc_render_tag(switch_xml_t xml_in, switch_event_t *
new_value = switch_event_expand_headers(params, value); new_value = switch_event_expand_headers(params, value);
if (!strcasecmp(name, "break-to")) { if (!strcasecmp(name, "break-to")) {
// if (xml_odbc_render_template(new_value, params, xml_out, off) == SWITCH_STATUS_FALSE) {
// if (!switch_strlen_zero(no_template_break_to)) {
/* have a look at this again, not too happy about this next_template_name thing.. */ /* have a look at this again, not too happy about this next_template_name thing.. */
switch_event_del_header(params, "next_template_name"); switch_event_del_header(params, "next_template_name");
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "next_template_name", value); switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "next_template_name", value);
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
// }
// }
} else if (!strcasecmp(name, "query")) { } else if (!strcasecmp(name, "query")) {
query_helper.xml_in = xml_in; query_helper.xml_in = xml_in;
query_helper.xml_out = xml_out; query_helper.xml_out = xml_out;
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
--> -->
<binding name="directory"> <binding name="directory">
<param name="odbc-dsn" value="freeswitch:freeswitch:secret"/> <param name="odbc-dsn" value="freeswitch:freeswitch:secret"/>
<!-- <param name="template" value="directory_swk"/> -->
<param name="template" value="directory"/> <param name="template" value="directory"/>
</binding> </binding>
<!-- <!--
......
<include>
<template name="directory_swk" description="based on swk's shipment sql">
<document type="freeswitch/xml">
<xml-odbc-do name="query" on-empty-result-break-to="not_found" value="
SELECT
domains.uid AS domains_uid,
users.uid AS users_uid,
users.cidr,
users.mailbox
FROM
domains,
users
WHERE
users.username = '${user}' AND
domains.name = '${domain}' AND
users.domains_uid = domains.uid AND
domains.enabled = '1' AND
users.enabled = '1';"/>
<section name="directory">
<domain name="${domain}">
<params>
<xml-odbc-do name="query" value="
SELECT
name, value
FROM
domain_params
WHERE
domains_uid = '${domains_uid}';">
<param name="${name}" value="${value}"/>
</xml-odbc-do>
</params>
<variables>
<xml-odbc-do name="query" value="
SELECT
name, value
FROM
domain_variables
WHERE
domains_uid = '${domains_uid}';">
<variable name="${name}" value="${value}"/>
</xml-odbc-do>
</variables>
<groups>
<group name="default">
<users>
<user id="${user}" mailbox="${mailbox}" cidr="${cidr}">
<params>
<xml-odbc-do name="query" on-empty-result-break-to="not_found" value="
SELECT
name, value
FROM
user_params
WHERE
users_uid = '${users_uid}';">
<param name="${name}" value="${value}"/>
</xml-odbc-do>
</params>
<variables>
<xml-odbc-do name="query" value="
SELECT
name, value
FROM
user_variables
WHERE
users_uid = '${users_uid}';">
<variable name="${name}" value="${value}"/>
</xml-odbc-do>
</variables>
</user>
</users>
</group>
<xml-odbc-do name="query" value="
SELECT
name AS group_name
FROM
groups,
group_members
WHERE
group_members.groups_uid = groups.uid AND
users_uid = '${users_uid}';">
<group name="${group_name}">
<user id="${user}" type="pointer"/>
</group>
</xml-odbc-do>
</groups>
</domain>
</section>
</document>
</template>
</include>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论