<?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 "../../../../doc/docbook/entities.xml">
%docentities;

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

<chapter>
	<title>&develguide;</title>
	<para>
	The module provides the following functions that can be used
	in other &kamailio; modules.
	</para>
 	<section>
		<title>
		<function moreinfo="none">dmq_load_api(dmq_api_t* api)</function>
		</title>
		<para>
		This function binds the DMQ module and fills the structure
		with the exported functions below.
		</para>

		<example>
		<title><function>dmq_api_t</function> structure</title>
	<programlisting format="linespecific">
...
typedef struct dmq_api {
	register_dmq_peer_t register_dmq_peer;
	bcast_message_t bcast_message;
	send_message_t send_message;
} dmq_api_t;
...
</programlisting>
		</example>
	</section>

        <section>
                <title>
                <function moreinfo="none">register_dmq_peer(dmq_peer_t* peer)</function>
                </title>
                <para>
                Registers an entity as a DMQ peer which permits receiving/sending
                messages between nodes which support the same peer.
                </para>

                <example>
                <title><function>register_dmq_peer</function> usage</title>
                <programlisting format="linespecific">
...
	Example to follow.
...
</programlisting>
                </example>
        </section>

        <section>
                <title>
                <function moreinfo="none">bcast_message(dmq_peer_t* peer, str* body, dmq_node_t* except,
                dmq_resp_cback_t* resp_cback, int max_forwards, str* content_type)</function>
                </title>
                <para>
                Broadcast a DMQ message to all nodes in the DMQ bus excluding self,
		inactive nodes and "except" if specified.
                </para>

                <example>
                <title><function>bcast_message</function> usage</title>
                <programlisting format="linespecific">
...
        Example to follow.
...
</programlisting>
                </example>
        </section>

        <section>
                <title>
                <function moreinfo="none">send_message(dmq_peer_t* peer, str* body, dmq_node_t* node,
                dmq_resp_cback_t* resp_cback, int max_forwards, str* content_type)</function>
                </title>
                <para>
                Send a DMQ message to a single node.
                </para>

                <example>
                <title><function>send_message</function> usage</title>
                <programlisting format="linespecific">
...
        Example to follow.
...
</programlisting>
                </example>
        </section>

</chapter>

