浏览代码

kex: doxumentation for script and branch flags operations

Daniel-Constantin Mierla 16 年之前
父节点
当前提交
f9f5c079fb
共有 2 个文件被更改,包括 393 次插入27 次删除
  1. 200 27
      modules_k/kex/README
  2. 193 0
      modules_k/kex/doc/kex_admin.xml

+ 200 - 27
modules_k/kex/README

@@ -12,52 +12,225 @@ Daniel-Constantin Mierla
    <[email protected]>
 
    Copyright © 2009 Daniel-Constantin Mierla
-     __________________________________________________________
+     __________________________________________________________________
 
    Table of Contents
 
    1. Admin Guide
 
-        1.1. Overview
-        1.2. Dependencies
+        1. Overview
+        2. Dependencies
 
-              1.2.1. Kamailio Modules
-              1.2.2. External Libraries or Applications
+              2.1. Kamailio Modules
+              2.2. External Libraries or Applications
 
-        1.3. Exported MI Functions
+        3. Exported Functions
 
-              1.3.1. arg
-              1.3.2. kill
-              1.3.3. pwd
-              1.3.4. uptime
-              1.3.5. version
-              1.3.6. which
+              3.1. setsflag(flag)
+              3.2. issflagset(flag)
+              3.3. resetsflag(flag)
+              3.4. setbflag(flag [, branch])
+              3.5. isbflagset(flag [, branch])
+              3.6. resetsflag(flag [, branch])
+
+        4. Exported MI Functions
+
+              4.1. arg
+              4.2. kill
+              4.3. pwd
+              4.4. uptime
+              4.5. version
+              4.6. which
+
+   List of Examples
+
+   1.1. setsflag usage
+   1.2. setsflag usage
+   1.3. resetsflag usage
+   1.4. setbflag usage
+   1.5. setbflag usage
+   1.6. resetsflag usage
 
 Chapter 1. Admin Guide
 
-1.1. Overview
+   Table of Contents
+
+   1. Overview
+   2. Dependencies
+
+        2.1. Kamailio Modules
+        2.2. External Libraries or Applications
+
+   3. Exported Functions
+
+        3.1. setsflag(flag)
+        3.2. issflagset(flag)
+        3.3. resetsflag(flag)
+        3.4. setbflag(flag [, branch])
+        3.5. isbflagset(flag [, branch])
+        3.6. resetsflag(flag [, branch])
+
+   4. Exported MI Functions
+
+        4.1. arg
+        4.2. kill
+        4.3. pwd
+        4.4. uptime
+        4.5. version
+        4.6. which
+
+1. Overview
 
    This module collects extensions from Kamailio core.
 
-   Kamailio Core CookBook is available at:
-   http://kamailio.org/dokuwiki/
+   Kamailio Core CookBook is available at: http://kamailio.org/dokuwiki/
 
-1.2. Dependencies
+2. Dependencies
 
-1.2.1. Kamailio Modules
+   2.1. Kamailio Modules
+   2.2. External Libraries or Applications
+
+2.1. Kamailio Modules
 
    The following modules must be loaded before this module:
      * No dependencies on other Kamailio modules.
 
-1.2.2. External Libraries or Applications
+2.2. External Libraries or Applications
 
-   The following libraries or applications must be installed
-   before running Kamailio with this module loaded:
+   The following libraries or applications must be installed before
+   running Kamailio with this module loaded:
      * None.
 
-1.3. Exported MI Functions
+3. Exported Functions
+
+   3.1. setsflag(flag)
+   3.2. issflagset(flag)
+   3.3. resetsflag(flag)
+   3.4. setbflag(flag [, branch])
+   3.5. isbflagset(flag [, branch])
+   3.6. resetsflag(flag [, branch])
+
+3.1. setsflag(flag)
+
+   Set the script flag.
+
+   Meaning of the parameters is as follows:
+     * flag - the index of the script flag to be set. Can be integer or
+       pseudo-variable with integer value.
+
+   This function can be used from ANY_ROUTE.
+
+   Example 1.1. setsflag usage
+...
+setsflag("1");
+...
+$var(flag) = 11;
+setsflag("$var(flag)");
+...
+
+3.2. issflagset(flag)
+
+   Return true of the script flag is set.
+
+   Meaning of the parameters is as follows:
+     * flag - the index of the script flag to be tested. Can be integer or
+       pseudo-variable with integer value.
+
+   This function can be used from ANY_ROUTE.
+
+   Example 1.2. setsflag usage
+...
+if(issflagset("1"))
+{
+    ...
+}
+...
+
+3.3. resetsflag(flag)
+
+   Reset the script flag.
+
+   Meaning of the parameters is as follows:
+     * flag - the index of the script flag to be reset. Can be integer or
+       pseudo-variable with integer value.
+
+   This function can be used from ANY_ROUTE.
+
+   Example 1.3. resetsflag usage
+...
+resetsflag("1");
+...
+
+3.4. setbflag(flag [, branch])
+
+   Set the branch flag.
+
+   Meaning of the parameters is as follows:
+     * flag - the index of the branch flag to be set. Can be integer or
+       pseudo-variable with integer value.
+     * branch - the index of the branch whose flag to be set. Can be
+       integer or pseudo-variable with integer value. If omitted, then
+       branch 0 is used (R-URI).
+
+   This function can be used from ANY_ROUTE.
+
+   Example 1.4. setbflag usage
+...
+setbflag("1");
+...
+$var(flag) = 11;
+setbflag("$var(flag)", "1");
+...
+
+3.5. isbflagset(flag [, branch])
+
+   Return true of the branch flag is set.
+
+   Meaning of the parameters is as follows:
+     * flag - the index of the branch flag to be tested. Can be integer or
+       pseudo-variable with integer value.
+     * branch - the index of the branch whose flag to be set. Can be
+       integer or pseudo-variable with integer value. If omitted, then
+       branch 0 is used (R-URI).
+
+   This function can be used from ANY_ROUTE.
+
+   Example 1.5. setbflag usage
+...
+if(isbflagset("1"))
+{
+    ...
+}
+...
+
+3.6. resetsflag(flag [, branch])
+
+   Reset the script flag.
+
+   Meaning of the parameters is as follows:
+     * flag - the index of the script flag to be reset. Can be integer or
+       pseudo-variable with integer value.
+     * branch - the index of the branch whose flag to be set. Can be
+       integer or pseudo-variable with integer value. If omitted, then
+       branch 0 is used (R-URI).
+
+   This function can be used from ANY_ROUTE.
+
+   Example 1.6. resetsflag usage
+...
+resetbflag("1");
+...
+
+4. Exported MI Functions
+
+   4.1. arg
+   4.2. kill
+   4.3. pwd
+   4.4. uptime
+   4.5. version
+   4.6. which
 
-1.3.1.  arg
+4.1.  arg
 
    Print command line arguments.
 
@@ -69,7 +242,7 @@ Chapter 1. Admin Guide
                 :arg:_reply_fifo_file_
                 _empty_line_
 
-1.3.2.  kill
+4.2.  kill
 
    Kill the application.
 
@@ -81,7 +254,7 @@ Chapter 1. Admin Guide
                 :kill:_reply_fifo_file_
                 _empty_line_
 
-1.3.3.  pwd
+4.3.  pwd
 
    Print working directory.
 
@@ -93,7 +266,7 @@ Chapter 1. Admin Guide
                 :pwd:_reply_fifo_file_
                 _empty_line_
 
-1.3.4.  uptime
+4.4.  uptime
 
    Print uptime.
 
@@ -105,7 +278,7 @@ Chapter 1. Admin Guide
                 :uptime:_reply_fifo_file_
                 _empty_line_
 
-1.3.5.  version
+4.5.  version
 
    Print version information.
 
@@ -117,7 +290,7 @@ Chapter 1. Admin Guide
                 :version:_reply_fifo_file_
                 _empty_line_
 
-1.3.6.  which
+4.6.  which
 
    Print list of available MI commands.
 

+ 193 - 0
modules_k/kex/doc/kex_admin.xml

@@ -56,6 +56,199 @@
 	</section>
 	</section>
 
+	<section>
+	<title>Exported Functions</title>
+		<section>
+		<title><function moreinfo="none">setsflag(flag)</function></title>
+		<para>
+			Set the script flag.
+		</para>
+		<para>Meaning of the parameters is as follows:</para>
+		<itemizedlist>
+		<listitem>
+			<para>
+				<emphasis>flag</emphasis> - the index of the script flag to
+				be set. Can be integer or pseudo-variable with integer value.
+			</para>
+		</listitem>
+		</itemizedlist>
+		<para>
+		This function can be used from ANY_ROUTE.
+		</para>
+		<example>
+		<title><function>setsflag</function> usage</title>
+		<programlisting format="linespecific">
+...
+setsflag("1");
+...
+$var(flag) = 11;
+setsflag("$var(flag)");
+...
+</programlisting>
+		</example>
+		</section>
+		<section>
+		<title><function moreinfo="none">issflagset(flag)</function></title>
+		<para>
+			Return true of the script flag is set.
+		</para>
+		<para>Meaning of the parameters is as follows:</para>
+		<itemizedlist>
+		<listitem>
+			<para>
+				<emphasis>flag</emphasis> - the index of the script flag to
+				be tested. Can be integer or pseudo-variable with integer value.
+			</para>
+		</listitem>
+		</itemizedlist>
+		<para>
+		This function can be used from ANY_ROUTE.
+		</para>
+		<example>
+		<title><function>setsflag</function> usage</title>
+		<programlisting format="linespecific">
+...
+if(issflagset("1"))
+{
+    ...
+}
+...
+</programlisting>
+		</example>
+		</section>
+		<section>
+		<title><function moreinfo="none">resetsflag(flag)</function></title>
+		<para>
+			Reset the script flag.
+		</para>
+		<para>Meaning of the parameters is as follows:</para>
+		<itemizedlist>
+		<listitem>
+			<para>
+				<emphasis>flag</emphasis> - the index of the script flag to
+				be reset. Can be integer or pseudo-variable with integer value.
+			</para>
+		</listitem>
+		</itemizedlist>
+		<para>
+		This function can be used from ANY_ROUTE.
+		</para>
+		<example>
+		<title><function>resetsflag</function> usage</title>
+		<programlisting format="linespecific">
+...
+resetsflag("1");
+...
+</programlisting>
+		</example>
+		</section>
+		<section>
+		<title><function moreinfo="none">setbflag(flag [, branch])</function></title>
+		<para>
+			Set the branch flag.
+		</para>
+		<para>Meaning of the parameters is as follows:</para>
+		<itemizedlist>
+		<listitem>
+			<para>
+				<emphasis>flag</emphasis> - the index of the branch flag to
+				be set. Can be integer or pseudo-variable with integer value.
+			</para>
+		</listitem>
+		<listitem>
+			<para>
+				<emphasis>branch</emphasis> - the index of the branch whose
+				flag to be set. Can be integer or pseudo-variable with integer
+				value. If omitted, then branch 0 is used (R-URI).
+			</para>
+		</listitem>
+		</itemizedlist>
+		<para>
+		This function can be used from ANY_ROUTE.
+		</para>
+		<example>
+		<title><function>setbflag</function> usage</title>
+		<programlisting format="linespecific">
+...
+setbflag("1");
+...
+$var(flag) = 11;
+setbflag("$var(flag)", "1");
+...
+</programlisting>
+		</example>
+		</section>
+		<section>
+		<title><function moreinfo="none">isbflagset(flag [, branch])</function></title>
+		<para>
+			Return true of the branch flag is set.
+		</para>
+		<para>Meaning of the parameters is as follows:</para>
+		<itemizedlist>
+		<listitem>
+			<para>
+				<emphasis>flag</emphasis> - the index of the branch flag to
+				be tested. Can be integer or pseudo-variable with integer value.
+			</para>
+		</listitem>
+		<listitem>
+			<para>
+				<emphasis>branch</emphasis> - the index of the branch whose
+				flag to be set. Can be integer or pseudo-variable with integer
+				value. If omitted, then branch 0 is used (R-URI).
+			</para>
+		</listitem>
+		</itemizedlist>
+		<para>
+		This function can be used from ANY_ROUTE.
+		</para>
+		<example>
+		<title><function>setbflag</function> usage</title>
+		<programlisting format="linespecific">
+...
+if(isbflagset("1"))
+{
+    ...
+}
+...
+</programlisting>
+		</example>
+		</section>
+		<section>
+		<title><function moreinfo="none">resetsflag(flag [, branch])</function></title>
+		<para>
+			Reset the script flag.
+		</para>
+		<para>Meaning of the parameters is as follows:</para>
+		<itemizedlist>
+		<listitem>
+			<para>
+				<emphasis>flag</emphasis> - the index of the script flag to
+				be reset. Can be integer or pseudo-variable with integer value.
+			</para>
+		</listitem>
+		<listitem>
+			<para>
+				<emphasis>branch</emphasis> - the index of the branch whose
+				flag to be set. Can be integer or pseudo-variable with integer
+				value. If omitted, then branch 0 is used (R-URI).
+			</para>
+		</listitem>
+		</itemizedlist>
+		<para>
+		This function can be used from ANY_ROUTE.
+		</para>
+		<example>
+		<title><function>resetsflag</function> usage</title>
+		<programlisting format="linespecific">
+...
+resetbflag("1");
+...
+</programlisting>
+		</example>
+		</section>
+	</section>
+
 	<section>
 	<title>Exported MI Functions</title>
 	<section>