Skip to main content

mod_amqp

About

mod_amqp gives FreeSWITCH™ ability to send events through an amqp server like RabbitMQ and listen for api commands. You can configure one or more connections and filter for which events to send.

Click here to expand Table of Contents

Loading

Once you have installed FreeSWITCH from packages, configure FreeSWITCH to load mod_amqp in autoload_configs/modules.conf.xml by uncommenting the line:

<load module="mod_amqp"/>

Configuring

If need be, edit the amqp connection configuration in autoload_configs/amqp.conf.xml and set the hostname, username, password, and port as applicable.

Example for default installation where rabbitmq server is the same as the FreeSWITCH server:

<profile name="default">
<connections>
<connection name="primary">
<param name="hostname" value="localhost"/>
<param name="virtualhost" value="/"/>
<param name="username" value="guest"/>
<param name="password" value="guest"/>
<param name="port" value="5672"/>
<param name="heartbeat" value="0"/>
</connection>
...

Customize the Event Filter by editing the following lines. The default captures channel create and destroy, fs heartbeat, and dtmf.

 <!--    <param name="eventFilter" value="SWITCH_EVENT_ALL"/> -->
<param name="event_filter" value="SWITCH_EVENT_CHANNEL_CREATE,SWITCH_EVENT_CHANNEL_DESTROY,SWITCH_EVENT_HEARTBEAT,SWITCH_EVENT_DTMF"/>

From fs_cli, apply the changes:

 reloadxml
reload mod_amqp