Skip to content

Update mod_amqp_9635078.mdx with additional information #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ Status: abandonware
* [Website Here](https://github.com/2600hz/bluebox)
* IRC: #2600hz on freenode

### DjangoPBX

DjangoPBX is a full-featured domain based multi-tenant PBX driven by [Django](https://www.djangoproject.com/) and [FreeSWITCH™](https://freeswitch.com/). The objective of this project is to provide a GUI wrap around FreeSWITCH™ using Django and the Python language. To minimise the number of .lua support scripts by utilising the FreeSWITCH modules mod_xml_curl, mod_httapi and mod_amqp, and also provide a platform that is easy to learn and code owing to it's use of just one programming language.

* License: MIT License
* [Website Here](https://www.djangopbx.com)
* [Screenshots Here](https://www.djangopbx.com/screenshots/)
* [Documentation Here](https://www.djangopbx.com/static/documentation/)
* IRC: irc.libera.chat on the #djangopbx channel

### FusionPBX

FusionPBX is a feature rich, multi-platform, highly customizable, scalable and fast web interface to manage FreeSWITCH as a PBX or as a voice SWITCH. The project started as the FreeSWITCH package on pfSense. Development was done to make it work with multiple operating systems this includes various version of Linux, BSD, Windows, Mac OS X, and others. The data storage was moved from pfSense's XML data storage to PHP Data Objects (PDO) which provides ability to use SQLite, PostgreSQL, MySQL and other data storage engines. It can use any web server that supports PHP5 this includes Apache, Lighttpd, nginx, IIS and many others.
Expand Down
56 changes: 55 additions & 1 deletion docs/FreeSWITCH-Explained/Modules/mod_amqp_9635078.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ If need be, edit the amqp connection configuration in autoload\_configs/amqp.con
Example for default installation where rabbitmq server is the same as the FreeSWITCH server:

```xml
<profile name="default">
<producers>
<profile name="default">
<connections>
<connection name="primary">
<param name="hostname" value="localhost"/>
Expand All @@ -40,13 +41,66 @@ Example for default installation where rabbitmq server is the same as the FreeSW
...
```

Various parameters can be set depending on the services required. For example, to send FreeSWITCH events to rabbitmq, the
following parameters could be added to the profile:

```xml
<params>
<param name="exchange-name" value="TAP.Events"/>
<param name="exchange-type" value="topic"/>
<param name="circuit_breaker_ms" value="10000"/>
<param name="reconnect_interval_ms" value="1000"/>
<param name="send_queue_size" value="5000"/>
<param name="enable_fallback_format_fields" value="1"/>
<param name="format_fields" value="#FreeSWITCH,FreeSWITCH-Hostname,Event-Name,Event-Subclass,Unique-ID"/>
...
```

The routing key is made from the format string, using the header values in the event specified in the format_fields.
Fields that are prefixed with a # are treated as literals rather than doing a header lookup.

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

```xml
<!-- <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"/>
```

It is also possible to send commands to FreeSWITCH via a rabbitmq connection by adding a commangs section to the configuration:

```xml
<commands>
<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>
</connections>
<params>
<param name="exchange-name" value="TAP.Commands"/>
<param name="binding_key" value="$${hostname}_command"/>
<param name="reconnect_interval_ms" value="1000"/>
<param name="queue-passive" value="false"/>
<param name="queue-durable" value="false"/>
<param name="queue-exclusive" value="false"/>
<param name="queue-auto-delete" value="true"/>
<param name="queue-name" value="$${hostname}_command"/>
</params>
</profile>
</commands>
```

When publishing a command via rabbitmq, it is necessary to set two header values:

x-fs-api-resp-exchange and x-fs-api-resp-key

These will contain the exchange and the route key to which you require the command output sending to.

From fs\_cli, apply the changes:

```xml
Expand Down