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

readme was unreadable


git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk/contrib@14865 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 3e6c9761
......@@ -6,23 +6,36 @@ This module can be used for doing odbc queries from the dialplan.
Usage:
<application name="odbc_query" value="SELECT some_column_name AS target_channel_variable_name FROM some_table_name WHERE 1;"/>
<application name="odbc_query" value="SELECT some_column_name AS
target_channel_variable_name FROM some_table_name WHERE 1;"/>
or:
<application name="odbc_query" value="my-query"/>
The module simply checks whether the value contains a space. If it does, then the value will be seen as an SQL query, otherwise it will be seen as a query 'name' that then has to be defined in the modules configuration in the <queries> section like this:
The module simply checks whether the value contains a space. If it
does, then the value will be seen as an SQL query, otherwise it will be
seen as a query 'name' that then has to be defined in the modules
configuration in the <queries> section like this:
<queries>
<query name="my-query" value="SELECT some_column_name AS target_channel_variable_name FROM some_table_name WHERE 1;"/>
<query name="my-query" value="SELECT some_column_name AS
target_channel_variable_name FROM some_table_name WHERE 1;"/>
</queries>
The module will do the query and store each returned column name as channel variable name together with its corresponding value.
The module will do the query and store each returned column name as
channel variable name together with its corresponding value.
Another feature is, that if only two columns are returned, which have the column names "name" and "value", then the channel variables will be set according to them. This way you can have the query return multiple rows with different channel variables. If the query returns something else than column-names "name" and "value" and it returns multiple rows, then the channel variables will be overwritten with each iteration of the rows - which is probably useless.
Another feature is, that if only two columns are returned, which have
the column names "name" and "value", then the channel variables will be
set according to them. This way you can have the query return multiple
rows with different channel variables. If the query returns something
else than column-names "name" and "value" and it returns multiple rows,
then the channel variables will be overwritten with each iteration of
the rows - which is probably useless.
The query may contain ${blah} variables that will be expanded from channel variables before the query is performed.
The query may contain ${blah} variables that will be expanded from
channel variables before the query is performed.
For example:
......@@ -61,6 +74,9 @@ c=d
---
So, the first example should only be used when you know that only zero or one row will be returned, and second one if you know zero or more rows will be returned.
So, the first example should only be used when you know that only zero
or one row will be returned, and second one if you know zero or more
rows will be returned.
If zero rows are returned (in either foo/bar or name/value case) then no channel variables will be set, overwritten or deleted.
If zero rows are returned (in either foo/bar or name/value case) then
no channel variables will be set, overwritten or deleted.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论