archive Issues

Hello everyone.

I am new to Ejabberd Community.
I am trying to work with archive messages with partial success.
I was able to write the messages in to the database, but I have 2 Issues:

1. When i send a message to MUC other connected users receive the messages.
Users who are not logged-in receive the messages after the enter the room.
When I do a reboot to service (ejabberdctl stop / ejabberdctl start) and make re-entry into the room, i do not get the messages from the history, although I see them in the table.

2. When I try to get historical messages, i get an error 503:

req:

<Iq type = 'get' id = 'sync1'>
  <Modified xmlns = "urn:xmpp:archive '
            start = '2013-03-01T01:14:47Z'>
    <Set xmlns='http://jabber.org/protocol/rsm'>
      <Max>50</ Max>
    </Set>
  </ Modified>
</ Iq>

res:

<Iq from = "567c44c63e77bb1c049fbd80@il3lv6809" type="error" xml:lang="en" to="567c44c63e77bb1c049fbd80@il3lv6809/Momentos-Eli" id="sync1">
  <Modified xmlns="urn:xmpp:archive" start="2013-03-01T01:14:47Z">
    <Set xmlns="http://jabber.org/protocol/rsm" >
      <Max>50</ Max>
    </Set>
  </Modified>
<Error type="cancel" code="503">
<Service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
</Error>
</Iq>

req:

<Iq type="get" id="page1>
  <Retrieve xmlns='urn:xmpp:archive'
            with='567c44c63e77bb1c049fbd80@il3lv6809'
            start='2016-03-01T02:56:15Z'>
    <Set xmlns='http: //jabber.org/protocol/rsm'>
      <Max>100</ Max>
    </Set>
  </Retrieve>
</Iq>

res:

<Iq from="567c44c63e77bb1c049fbd80@il3lv6809" type="error" xml:lang="en" to="567c44c63e77bb1c049fbd80@il3lv6809/Momentos-Eli" id="page1">
  <Retrieve xmlns="urn:xmpp:archive" with="567c44c63e77bb1c049fbd80@il3lv6809" start="2016-03-01T02:56:15Z">
    <Set xmlns = "http://jabber.org/protocol/rsm">
      <Max>100</ Max>
    </Set>
  </Retrieve>
<Error type="cancel" code="503">
<Service-unavailable xmlns = "urn:ietf:params:xml:ns:xmpp-stanzas" />
</Error>
</Iq>

My Server Info :

<iq from="il3lv6809" type="result" to="567c44c63e77bb1c049fbd80@il3lv6809/Momentos-Eli" id="disco1">
<query xmlns="http://jabber.org/protocol/disco#info">
<identity category="pubsub" type="pep"/>
<identity category="server" type="im" name="ejabberd"/>
<x xmlns="jabber:x:data" type="result">
<field type="hidden" var="FORM_TYPE">
<value>http://jabber.org/network/serverinfo</value>
</field>
</x>
<feature var="http://jabber.org/protocol/commands"/>
<feature var="http://jabber.org/protocol/disco#info"/>
<feature var="http://jabber.org/protocol/disco#items"/>
<feature var="http://jabber.org/protocol/pubsub"/>
<feature var="http://jabber.org/protocol/pubsub#access-authorize"/>
<feature var="http://jabber.org/protocol/pubsub#access-open"/>
<feature var="http://jabber.org/protocol/pubsub#access-presence"/>
<feature var="http://jabber.org/protocol/pubsub#access-whitelist"/>
<feature var="http://jabber.org/protocol/pubsub#auto-create"/>
<feature var="http://jabber.org/protocol/pubsub#auto-subscribe"/>
<feature var="http://jabber.org/protocol/pubsub#collections"/>
<feature var="http://jabber.org/protocol/pubsub#config-node"/>
<feature var="http://jabber.org/protocol/pubsub#create-and-configure"/>
<feature var="http://jabber.org/protocol/pubsub#create-nodes"/>
<feature var="http://jabber.org/protocol/pubsub#delete-items"/>
<feature var="http://jabber.org/protocol/pubsub#delete-nodes"/>
<feature var="http://jabber.org/protocol/pubsub#filtered-notifications"/>
<feature var="http://jabber.org/protocol/pubsub#get-pending"/>
<feature var="http://jabber.org/protocol/pubsub#instant-nodes"/>
<feature var="http://jabber.org/protocol/pubsub#item-ids"/>
<feature var="http://jabber.org/protocol/pubsub#last-published"/>
<feature var="http://jabber.org/protocol/pubsub#manage-subscriptions"/>
<feature var="http://jabber.org/protocol/pubsub#member-affiliation"/>
<feature var="http://jabber.org/protocol/pubsub#modify-affiliations"/>
<feature var="http://jabber.org/protocol/pubsub#multi-subscribe"/>
<feature var="http://jabber.org/protocol/pubsub#outcast-affiliation"/>
<feature var="http://jabber.org/protocol/pubsub#persistent-items"/>
<feature var="http://jabber.org/protocol/pubsub#presence-notifications"/>
<feature var="http://jabber.org/protocol/pubsub#presence-subscribe"/>
<feature var="http://jabber.org/protocol/pubsub#publish"/>
<feature var="http://jabber.org/protocol/pubsub#publish-only-affiliation"/>
<feature var="http://jabber.org/protocol/pubsub#publisher-affiliation"/>
<feature var="http://jabber.org/protocol/pubsub#purge-nodes"/>
<feature var="http://jabber.org/protocol/pubsub#retract-items"/>
<feature var="http://jabber.org/protocol/pubsub#retrieve-affiliations"/>
<feature var="http://jabber.org/protocol/pubsub#retrieve-default"/>
<feature var="http://jabber.org/protocol/pubsub#retrieve-items"/>
<feature var="http://jabber.org/protocol/pubsub#retrieve-subscriptions"/>
<feature var="http://jabber.org/protocol/pubsub#shim"/>
<feature var="http://jabber.org/protocol/pubsub#subscribe"/>
<feature var="http://jabber.org/protocol/pubsub#subscription-notifications"/>
<feature var="http://jabber.org/protocol/pubsub#subscription-options"/>
<feature var="http://jabber.org/protocol/rsm"/>
<feature var="http://jabber.org/protocol/stats"/>
<feature var="iq"/>
<feature var="jabber:iq:last"/>
<feature var="jabber:iq:privacy"/>
<feature var="jabber:iq:register"/>
<feature var="jabber:iq:version"/>
<feature var="msgoffline"/>
<feature var="presence"/>
<feature var="urn:xmpp:blocking"/>
<feature var="urn:xmpp:carbons:1"/>
<feature var="urn:xmpp:carbons:2"/>
<feature var="urn:xmpp:mam:0"/>
<feature var="urn:xmpp:mam:tmp"/>
<feature var="urn:xmpp:ping"/>
<feature var="urn:xmpp:sic:0"/>
<feature var="urn:xmpp:time"/>
<feature var="vcard-temp"/>
</query>
</iq>

My ejabberd.yml :

odbc_type: mysql
odbc_server: "127.0.0.1"
odbc_database: "ejabberd"
odbc_username: "root"
odbc_password: "XXXXXXXX"
odbc_port: 3306

mod_mam:
db_type: odbc
default: always
request_activates_archiving: false
assume_mam_usage: if_enabled
cache_size: 1000
cache_lifetime: 1728000
iqdisc: one_queue

mod_muc:
## host: "conference.@HOST@"
access: muc
access_create: muc_create
access_persistent: muc_create
access_admin: muc_admin
db_type: odbc
max_users: 200
##history_size: 20
default_room_options:
public: true
##history_size: 20
persistent: true
password_protected: false
mam: true

mod_offline:
access_max_user_messages: max_user_offline_messages
db_type: odbc

I'm working with ejabberd 15.07

eli_momentos wrote: I am

eli_momentos wrote:

I am trying to work with archive messages with partial success.
I'm working with ejabberd 15.07

Note that mod_mam got many improvements in the recent releases, including ejabberd 16.02.

eli_momentos wrote:

1. When i send a message to MUC other connected users receive the messages.
Users who are not logged-in receive the messages after the enter the room.
When I do a reboot to service (ejabberdctl stop / ejabberdctl start) and make re-entry into the room, i do not get the messages from the history, although I see them in the table.

Don't confuse mod_mam's archiving with mod_muc room history.
See the description of that feature in the option history_size in:
https://docs.ejabberd.im/admin/guide/configuration/#modmuc
That history is kept only in RAM, not in disk, so it's lost when restarting the service.

eli_momentos wrote:

2. When I try to get historical messages, i get an error 503:

req:

<Iq type = 'get' id = 'sync1'>
  <Modified xmlns = "urn:xmpp:archive '
            start = '2013-03-01T01:14:47Z'>
    <Set xmlns='http://jabber.org/protocol/rsm'>
      <Max>50</ Max>
    </Set>
  </ Modified>
</ Iq>

That query is not supported by ejabberd, see the examples:
http://xmpp.org/extensions/xep-0313.html#query

<iq type='set' id='juliet1'>
  <query xmlns='urn:xmpp:mam:1' queryid='f27' />
</iq>
Syndicate content