ejabberd-contrib/mod_post_log/README.md

62 lines
1.1 KiB
Markdown
Raw Permalink Normal View History

mod_post_log - Logs messages to an HTTP API
===========================================
2015-02-25 19:43:22 +01:00
* Author: Tim Stewart, Mojo Lingo LLC
* Requirements: ejabberd 14.07 or later
2015-02-25 19:43:22 +01:00
This module implements logging of all messages sent (chat and groupchat) via an HTTP API.
Configuration
-------------
2015-02-25 19:43:22 +01:00
- `url`:
URL where the HTTP POSTs are to be sent.
- `ts_header`:
Default value: `"X-Message-Timestamp"`
- `from_header`:
Default value: `"X-Message-From"`
- `to_header`:
Default value: `"X-Message-To"`
- `headers`:
Default value: `[]`
- `content_type`:
Default value: `"text/xml"`
- `http_options`:
Default value: `[]`
- `req_options`:
Default value: `[]`
Example Configuration
---------------------
2015-02-25 19:43:22 +01:00
```yaml
modules:
mod_post_log:
url: "http://foo.bar.com/messages"
2015-02-25 19:43:22 +01:00
```
API Example
-----------
2015-02-25 19:43:22 +01:00
```
POST /messages HTTP/1.0
HTTP-X-MESSAGE-FROM: doo@dah.com
HTTP_X_MESSAGE_TO: foo@bar.com
Content-Type: application/xml
Content-Length: 122
<message to='foo@bar.com' from='doo@dah.com' type='chat'>
<body xmlns='jabber:client'>Hello there Foo!</body>
</message>
```