Install Datasink for Message Archiving

Datasink implements Message Archiving. This protocol enables Jabber clients such as JWChat to store chat history on the server.

This tutorial will help you to install Datasink when using ejabberd. Note that there also is a native module in development called mod_archive.

Warning!

Datasink 0.2.6 does not work with newer JWChat versions, make sure to use a version a little older.

  1. Download Datasink

    mkdir datasink
    cd datasink
    wget http://zeank.in-berlin.de/download/datasink
    wget http://zeank.in-berlin.de/download/config.xml
    wget http://zeank.in-berlin.de/download/datasink.sql
    chmod +x datasink
  2. Create MySQL Database

    mysqladmin -u root -ppassword create datasink
    mysql -u root -ppassword
    GRANT ALL PRIVILEGES ON datasink.* TO datasink@localhost IDENTIFIED BY 'secret';
    flush privileges;
    \q
    mysql -u datasink -psecret datasink < datasink.sql
  3. Install Required Perl Libraries

    perl -MCPAN -e'install Net::Jabber'
    perl -MCPAN -e'install DBI'
    perl -MCPAN -e'install Data::Dumper'
    perl -MCPAN -e'install Digest::MD5'
    perl -MCPAN -e'install Getopt::Long'
  4. Configure ejabberd

    Edit ejabberd.cfg:

    {host, "jabber.example.com"}.
    
    {listen,
      ...
      {5261, ejabberd_service, [{host, "datasink.jabber.example.com",
                              [{password, "secret"}]}]},
  5. Configure Datasink

    Edit config.xml:
    <hostname>jabber.example.com</hostname>
    <name>datasink.jabber.example.com</name>
  6. Start ejabberd and Datasink

    To Datasink:

    ./datasink

Troubleshooting

  • Datasink 0.2.6 only works with older JWChat versions.
  • Set timezone to UTC for mysql to make timestamps work correctly.
  • There may be problems with non-ASCII characters... UTF-8...
Syndicate content