powered by Jive Software

Fastpath invite and transfer issues

Hi,

I’m setting up a fastpath service based on desktop clients (just Spark).

For testing purposes I’m using a setup built on the following:

  • Server Name: im

  • 2 Users: User_A_1, User_A_2 that belong to Group_A

  • 2 Users: User_B_1, User_B_2 that belong to Group_B

  • 2 Users: User_C_1, User_C_2 that belong to Group_C

Then, we have the fastpath workgroups setup as follows:

  • WorkGroup_1 with Default_Queue -> Members Group_B

  • WorkGroup_2 with Default_Queue -> Members Group_C

Now, the test cases:

CASE A:

  • User_A_1 initiates a conversation with Workgroup_1@im:
  • User_B_1or User_B_2 receive a notification (based on what the dispatcher decides) from FastPath and the conference gets created.
  • User_B_* (Workgroup_1 member) want to transfer the conversation to WorkGroup_2, so the petition is sent, a notification window appears on the chosen WorkGroup_2 agent, the transfer is accepted, but the agent doesn’t join, as the server returns an error.

From the Spark Debug interface on the WorkGroup_2 agent I see this:

sent by the agent:

<iq id="24Gl7-110" to="WorkGroup_2@workgroup.im" type="set">
  <offer-accept xmlns="http://jabber.org/protocol/workgroup" id="kcm7ra38"/>
</iq>

server response:

<iq id="24Gl7-110" to="User_C_1@im/spark" from="WorkGroup_2@workgroup.im" type="error">
  <error code="404" type="CANCEL">
    <item-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
  </error>
</iq>

and in the Debug server logs I get this:

2011.05.13 10:38:42 Request not found by ID: kcm7ra38
2011.05.13 10:38:42 Request not found while accepting offer: org.jivesoftware.util.NotFoundException
        at org.jivesoftware.xmpp.workgroup.request.Request.getRequest(Request.java:99)
        at org.jivesoftware.xmpp.workgroup.WorkgroupIQHandler.handleIQSet(WorkgroupIQHandler.java:188)
        at org.jivesoftware.xmpp.workgroup.WorkgroupIQHandler.process(WorkgroupIQHandler.java:90)
        at org.jivesoftware.xmpp.workgroup.Workgroup.process(Workgroup.java:459)
        at org.jivesoftware.xmpp.workgroup.Workgroup.process(Workgroup.java:482)
        at org.jivesoftware.xmpp.workgroup.WorkgroupManager.processPacket(WorkgroupManager.java:684)
        at org.jivesoftware.openfire.component.InternalComponentManager$RoutableComponents.process(InternalComponentManager.java:587)
        at org.jivesoftware.openfire.spi.RoutingTableImpl.routeToComponent(RoutingTableImpl.java:352)
        at org.jivesoftware.openfire.spi.RoutingTableImpl.routePacket(RoutingTableImpl.java:237)
        at org.jivesoftware.openfire.IQRouter.handle(IQRouter.java:324)
        at org.jivesoftware.openfire.IQRouter.route(IQRouter.java:121)
        at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:76)
        at org.jivesoftware.openfire.net.StanzaHandler.processIQ(StanzaHandler.java:337)
        at org.jivesoftware.openfire.net.ClientStanzaHandler.processIQ(ClientStanzaHandler.java:93)
        at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:302)
        at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:194)
        at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandler.java:169)
        at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived(AbstractIoFilterChain.java:570)
        at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
        at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
        at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
        at org.apache.mina.common.IoFilterAdapter.messageReceived(IoFilterAdapter.java:80)
        at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
        at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
        at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
        at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimpleProtocolDecoderOutput.java:58)
        at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:185)
        at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
        at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
        at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
        at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:239)
        at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:283)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
        at java.lang.Thread.run(Thread.java:662)

Any ideas on what’s happening?

This thing is driving me crazy. It’s been almost a week trying to get it working and it’s a no go…

looking into this in high level of detail

Hi,

I have the same problem. Looking for a solution I found this situation:

offer sent by the server (transfer user to user):

< iq type="set" id="52-61" from="servicedesk@workgroup.XXXX" to="admin@XXXX/Spark 2.6.3">
         <offer xmlns="http://jabber.org/protocol/workgroup" id="6q8t5a121" jid="3700efe7@XXXX/3700efe7">
                    <metadata xmlns="http://jivesoftware.com/protocol/workgroup">
                              <value ... />
                    </metadata>
                    <timeout>20</timeout>
                    <session xmlns="http://jivesoftware.com/protocol/workgroup" id="14lgg2120" workgroup="servicedesk@workgroup.XXXX"/>
                    <transfer type="user">
                              <inviter>joao@XXXX/Spark 2.6.3</inviter><room>14lgg2120@conference.XXXX</room>
                              <metadata xmlns="http://jivesoftware.com/protocol/workgroup">
                                        <value ... />
                              </metadata>
                              <reason>Eu estou transferindo esta conversa para você.</reason>
                    </transfer>
          </offer>
</iq>

sent by the agent:

<iq id="52-61" to="admin@XXX" type="set">
  <offer-accept xmlns="http://jabber.org/protocol/workgroup" id="14lgg2120"/>
</iq>

So, when the server receive this message his try to find this request/offer to stop notifications, but do a search using a sessionID instead of PacketID.

//(WorkgroupIQHandler.java)
else if ("offer-accept".equals(queryName)) {
            try {
                InterceptorManager interceptorManager = OfferInterceptorManager.getInstance();
                String id = iq.attributeValue("id");
                String jid = iq.attributeValue("jid");
                if (id != null || jid  != null) {
                    Request request;
                    if (id != null) {
                        // Search request by its unique ID
                        request = Request.getRequest(id);
                    }
...
//(Request.java)       public static Request getRequest(String requestID) throws NotFoundException {
        Request request = requests.get(requestID);
        if (request == null) {
            Log.debug("Request not found by ID: " + requestID);
            throw new NotFoundException();
        }
        return request;
    }

I think this is related to the smack lib used by Spark, when receive transfer packet/offer Spark sends a AceeptPacket, but this packet send SessioID on place of PacketID

(Offer.java)
    /**
     * Packet for accepting an offer.
     */
    private class AcceptPacket extends IQ {          AcceptPacket(String workgroup) {
            this.setTo(workgroup);
            this.setType(IQ.Type.SET);
        }         public String getChildElementXML() {
            return "<offer-accept id=\"" + Offer.this.getSessionID() +
                    "\" xmlns=\"http://jabber.org/protocol/workgroup" + "\"/>";
        }
    }

I’m looking for a solution without change smack.jar… How you get a solution?

I have solved the problem.

TransferRequest.java–>getSessionElement()–>sessionElement.addAttribute(“id”, sessionID);

chage to:

sessionElement.addAttribute(“id”, requestID);

Where do you make that change? I haven’t figured it out yet