I have installed openfire with the fastpath plugin. Using the inverse plugin i can redirect the user to the appropriate queue in a workgroup.
Now, i am trying to add converse.js to a page having the same functionality. I can see and chat with the other contacts, but when fastpath tries to put me into a conference with the respective agent (based on a question) i get an error.
Here is my js:
converse.initialize({
bosh_service_url: 'http://chat.domain.com:7070/http-bind/',
show_controlbox_by_default: true,
allow_muc_invitations: true,
keepalive: true,
debug: true,
allow_non_roster_messaging: true,
allow_contact_requests: true,
auto_join_on_invite: true,
roster_groups: true,
jid: 'user@chat.domain.com',
password: 'password',
auto_login: true,
auto_subscribe: true
});
On:
_converse.onDirectMUCInvitation = function (message) {
var x_el = message.querySelector('x[xmlns="jabber:x:conference"]'),
from = Strophe.getBareJidFromJid(message.getAttribute('from')),
room_jid = x_el.getAttribute('jid'),
reason = x_el.getAttribute('reason');}
x_el is null despite the fact that the message contains the following:
<message xmlns="jabber:client"
from="pjiw6d129@conference.chat.domain.com"
to="user@chat.domain.com/converse.js-60521038">
<workgroup xmlns="http://jabber.org/protocol/workgroup" jid="test@workgroup.chat.domain.com"/>
<session xmlns="http://jivesoftware.com/protocol/workgroup" id="pjiw6d129"/>
<x xmlns="http://jabber.org/protocol/muc#user">
<invite from="test@workgroup.chat.domain.com">
<reason>Please join me for a chat.</reason>
</invite>
</x>
<x xmlns="jabber:x:conference" jid="pjiw6d129@conference.chat.domain.com"/>
I am missing something but can't quite see it.
Thank you for the help!
The problem was at the querySelector, replaced
room_jid = x_el.getAttribute('jid'),
reason = x_el.getAttribute('reason');}
with
room_jid = message.getElementsByTagName('x')[1].getAttribute('jid'),
reason = message.getElementsByTagName('x')[0].getAttribute('reason');
in converse.js
Openfire's FastPath is an implementation of the XMPP extension XEP-0142: Workgroup Queues. To the best of my knowledge, converse.js (version 3.3.2, which is the most recent release at the time that I write this), does not support this extension.