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

Fix MODAPP-374 (ISO C90 forbids mixed decl and code) ?

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk/contrib@15786 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 4f386723
......@@ -169,21 +169,17 @@ static switch_status_t xml_odbc_do_break_to(xml_odbc_session_helper_t *helper)
static switch_status_t xml_odbc_do_set_event_header(xml_odbc_session_helper_t *helper)
{
char *name = (char *) switch_xml_attr(helper->xml_in_cur, "name"); /* the xml-odbc-do name attr */
char *if_name = (char *) switch_xml_attr(helper->xml_in_cur, "if-name");
if (if_name) { if_name = switch_event_expand_headers_by_pool(helper->pool, helper->event, if_name); }
char *if_value = (char *) switch_xml_attr(helper->xml_in_cur, "if-value");
if (if_value) { if_value = switch_event_expand_headers_by_pool(helper->pool, helper->event, if_value); }
char *to_name = (char *) switch_xml_attr(helper->xml_in_cur, "to-name");
if (to_name) { to_name = switch_event_expand_headers_by_pool(helper->pool, helper->event, to_name); }
char *to_value = (char *) switch_xml_attr(helper->xml_in_cur, "to-value");
if (to_value) { to_value = switch_event_expand_headers_by_pool(helper->pool, helper->event, to_value); }
char *old_value = NULL;
if (if_name) { if_name = switch_event_expand_headers_by_pool(helper->pool, helper->event, if_name); }
if (if_value) { if_value = switch_event_expand_headers_by_pool(helper->pool, helper->event, if_value); }
if (to_name) { to_name = switch_event_expand_headers_by_pool(helper->pool, helper->event, to_name); }
if (to_value) { to_value = switch_event_expand_headers_by_pool(helper->pool, helper->event, to_value); }
switch_status_t status = SWITCH_STATUS_FALSE;
if (if_value && !if_name) {
......
<include>
<template name="directory_swk" description="based on swk's shipment sql">
<document type="freeswitch/xml">
<xml-odbc-do name="replace_header_value" when-name="key" when-value="id" value="username"/>
<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.${key} = '${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}">
<users>
<user id="${user}" type="pointer"/>
</users>
</group>
</xml-odbc-do>
</groups>
</domain>
</section>
</document>
</template>
</include>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论