<?xml version="1.0" encoding='ISO-8859-1'?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [

<!-- Include general documentation entities -->
<!ENTITY % docentities SYSTEM "../../../docbook/entities.xml">
%docentities;

]>
<!-- Module User's Guide -->

<chapter>
	
	<title>&adminguide;</title>
	
	<section>
	<title>Overview</title>
	<para>
		The module exports a RPC command to execute MI commands and
        an MI command to run RPC commands.
	</para>

	</section>
	<section>
	<title>Dependencies</title>
	<section>
		<title>&kamailio; Modules</title>
		<para>
		The following modules must be loaded before this module:
			<itemizedlist>
			<listitem>
			<para>
				<emphasis>No dependencies on other &kamailio; modules</emphasis>.
			</para>
			</listitem>
			</itemizedlist>
		</para>
	</section>
	<section>
		<title>External Libraries or Applications</title>
		<para>
		The following libraries or applications must be installed before running
		&kamailio; with this module loaded:
			<itemizedlist>
			<listitem>
			<para>
				<emphasis>None</emphasis>.
			</para>
			</listitem>
			</itemizedlist>
		</para>
	</section>

	</section>
	<section>
	<title>Parameters</title>
	<section>
			<title><varname>rpc_url</varname> (string)</title>
			<para>Note: this parameter is used for MI to RPC connections.</para>
			<para>
				This parameters specifies the connection to use for running RPC commands from the mangement interface.
			</para>
			<para>
				This parameter is required if you need to run RPC commands from the MI. It must match a URL to which the RPC is bound.
			</para>
			<example>
				<title>Set <varname>rpc_url</varname> parameter</title>
				<programlisting>
...
modparam("mi_rpc","rpc_url","tcp:localhost:2046")
...
				</programlisting>
			</example>
		</section>
	</section>
	<section>
	<title>Functions</title>
	<para>none</para>
	</section>
	<section>
	<title>Exported RPC commands</title>
	<section>
		<title>
		<function moreinfo="none">mi</function>
		<function moreinfo="none">mi_dg</function>
		<function moreinfo="none">mi_fifo</function>
		<function moreinfo="none">mi_xmlrpc</function>
		</title>
		<para>
		Execute a MI command.
		</para>
		<para>
		Depending on the version (e.g. mi, mi_dg) it formats the output in a
		similar way to the corresponding kamailio mi module:
		<itemizedlist>
			<listitem>
				<function>mi</function> - uses a special, "pretty" format
				which generates nicer (more readable) output when used with
				kamcmd.
			</listitem>
			<listitem>
				<function>mi_dg</function> - uses an output format similar to
				the kamailio mi_datagram module.
			</listitem>
			<listitem>
				<function>mi_fifo</function> - uses an output format similar
				to the kamailio mi_fifo module.
			</listitem>
			<listitem>
				<function>mi_xmlrpc</function> - uses an output format similar
				to the kamailio mi_xmlrpc module.
			</listitem>
		</itemizedlist>
		</para>
		<para>
		Name: <emphasis>mi</emphasis>
		</para>
		<para>Parameters:</para>
		<para>
			<emphasis>_mi_command_</emphasis> - the MI command to execute
			(mandatory).
		</para>
		<para>
			<emphasis>_parameters_</emphasis> - the MI command parameters
			(optional).
		</para>
 		<para>
		Example using 'kamcmd':
		</para>
		<programlisting  format="linespecific">
kamcmd> mi uptime
Now:: Thu Sep 24 18:17:15 2009
Up since:: Thu Sep 24 17:35:45 2009
Up time:: 2490 [sec]
		</programlisting>
    </section>
    </section>
    
    <section>
	    <title><acronym>MI</acronym> Commands</title>
        <section>
            <title><function moreinfo="none">rpc</function></title>
            <para>
            This MI commands runs a RPC command.
            </para>
            <para>
            It must be passed the name of the RPC command, and any parameters that the RPC command requires.
            </para>
        </section>
    </section>

</chapter>

