# &develguide;

The module provides the following functions that can be used in other &kamailio; modules.

## `dmq_load_api(dmq_api_t* api)`

This function binds the DMQ module and fills the structure with the exported functions below.

### `dmq_api_t` structure

    ...
    typedef struct dmq_api {
    	register_dmq_peer_t register_dmq_peer;
    	bcast_message_t bcast_message;
    	send_message_t send_message;
    } dmq_api_t;
    ...

## `register_dmq_peer(dmq_peer_t* peer)`

Registers an entity as a DMQ peer which permits receiving/sending messages between nodes which support the same peer.

### `register_dmq_peer` usage

    ...
    	Example to follow.
    ...

## `bcast_message(dmq_peer_t* peer, str* body, dmq_node_t* except, dmq_resp_cback_t* resp_cback, int max_forwards, str* content_type)`

Broadcast a DMQ message to all nodes in the DMQ bus excluding self, inactive nodes and "except" if specified.

### `bcast_message` usage

    ...
            Example to follow.
    ...

## `send_message(dmq_peer_t* peer, str* body, dmq_node_t* node, dmq_resp_cback_t* resp_cback, int max_forwards, str* content_type)`

Send a DMQ message to a single node.

### `send_message` usage

    ...
            Example to follow.
    ...