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

<chapter>
	
	<title>&adminguide;</title>
	
	<section id="overview" xreflabel="Overview">
	<title>Overview</title>
	<para>
		This is a module which provides a UNIX/UDP SOCKET transport layer 
		implementation for the Event Interface. 
	</para>
	</section>

	<section>
	<title>DATAGRAM events syntax</title>
	<para>
		The event payload is formated as a JSON-RPC notification, with the event
		name as the <emphasis>method</emphasis> field and the event parameters as
		the <emphasis>params</emphasis> field.
	</para>
	</section>
	
	<section>
	<title>DATAGRAM socket syntax</title>
	<para>
		There are two types of sockets used by this module, based on the
		sockets type. An UNIX socket should follow this syntax:
		<para><emphasis>['unix:'] unix_socket_path</emphasis></para>
	</para>
	<para>
		An UDP socket should follow this syntax:
		<para><emphasis>'udp:' address ':' port</emphasis></para>
	</para>
	</section>

	<section id="dependencies" xreflabel="Dependencies">
	<title>Dependencies</title>
	<section>
		<title>&osips; Modules</title>
		<para>
		The following modules must be loaded before this module:
			<itemizedlist>
			<listitem>
			<para>
				<emphasis>No dependencies on other &osips; 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 &osips; with this module loaded:
			<itemizedlist>
			<listitem>
			<para>
				<emphasis>none</emphasis>
			</para>
			</listitem>
			</itemizedlist>
		</para>
	</section>
	</section>

	<section id="exported_parameters" xreflabel="Exported Parameters">
	<title>Exported Parameters</title>
		<para>
		No parameter exported by this module.
		</para>
	</section>

	<section id="exported_functions" xreflabel="exported_functions">
	<title>Exported Functions</title>
		<para>
		No function exported to be used from configuration file.
		</para>
	</section>

	<section>
	<title>Example</title>
		<para>
			This is an example of an event raised by the pike module
			when it decides an ip should be blocked:
		</para>
		<example>
		<title>E_PIKE_BLOCKED event</title>
		<programlisting format="linespecific">
<![CDATA[
{
  "jsonrpc": "2.0",
  "method": "E_PIKE_BLOCKED",
  "params": {
    "ip": "192.168.2.11"
  }
}
]]>
</programlisting>
		</example>

		<example>
		<title>UNIX socket</title>
		<programlisting format="linespecific">

unix:/tmp/opensips_event.sock

</programlisting>
		</example>

		<example>
		<title>UDP socket</title>
		<programlisting format="linespecific">

udp:127.0.0.1:8081

</programlisting>
		</example>

	</section>
</chapter>

