Sharp.Xmpp icon indicating copy to clipboard operation
Sharp.Xmpp copied to clipboard

Message not being delivered

Open ssteiner opened this issue 9 years ago • 2 comments

Hi

I'm trying to connect this to a Cisco CCX Express. When I connect, I get a bunch of status updates, then nothing. In wireshark, I see XMPP MESSAGE packets inbound, but they never get to any event handler.. neither message, nor status, nor error,, just silence.

Everything from the connect looks like this in XML Format.. the last message is not being delivered and subsequent messages neither. Any idea what's blocking there? I suppose the parsing given Cisco's extensions. If so, is there a hook that allows me just to get the raw XML and I then worry about parsing?

<?xml version='1.0' encoding='UTF-8'?>
<stream:stream xmlns='jabber:client' to='chdevuccx105.nxodev.intra' version='1.0' xmlns:stream='http://etherx.jabber.org/streams' xml:lang='de-CH'><?xml version='1.0' encoding='UTF-8'?>
<stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="chdevuccx105.nxodev.intra" id="d1fdf036" xml:lang="de-CH" version="1.0">
<stream:features><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism></mechanisms><auth xmlns="http://jabber.org/features/iq-auth"/><register xmlns="http://jabber.org/features/iq-register"/>
</stream:features><auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>mysecrethere</auth><success xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/><?xml version='1.0' encoding='UTF-8'?>
<stream:stream xmlns='jabber:client' to='chdevuccx105.nxodev.intra' version='1.0' xmlns:stream='http://etherx.jabber.org/streams' xml:lang='de-CH'><?xml version='1.0' encoding='UTF-8'?>
<stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="chdevuccx105.nxodev.intra" id="d1fdf036" xml:lang="de-CH" version="1.0">
<stream:features><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/>
</stream:features>
<iq type='set' id='bind-0'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/></iq><iq type="result" id="bind-0" to="chdevuccx105.nxodev.intra/d1fdf036"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><jid>[email protected]/d1fdf036</jid></bind></iq><iq to='chdevuccx105.nxodev.intra' type='set' id='1'><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></iq><iq type="result" id="1" from="chdevuccx105.nxodev.intra" to="[email protected]/d1fdf036"/><iq from='[email protected]/d1fdf036' type='get' id='2'><query xmlns='jabber:iq:roster'/></iq><iq type="result" id="2" to="[email protected]/d1fdf036"><query xmlns="jabber:iq:roster"><item jid="[email protected]" subscription="both"/><item jid="[email protected]" subscription="both"/><item jid="[email protected]" subscription="both"/><item jid="[email protected]" subscription="both"/><item jid="[email protected]" subscription="both"/></query></iq><presence><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='Sharp.Xmpp' ver='MlFpXs7lqFyWUkeYGjP2fLFnDc8='/></presence><presence from="[email protected]/desktop" to="[email protected]/d1fdf036"><c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://jabber.cisco.com/caxl" ver="VNC6fNwvCxe6FJfDJIpLryVJRwM="/></presence><presence id="48AAV-7" from="[email protected]/web_framework" to="[email protected]/d1fdf036"/><presence id="rePFN-5" from="[email protected]/7eafb26c" to="[email protected]/d1fdf036"/><presence id="rePFN-35" from="[email protected]/Smack-events-8" to="[email protected]/d1fdf036"/><presence id="rePFN-55" from="[email protected]/Smack-events-13" to="[email protected]/d1fdf036"/><presence id="rePFN-31" from="[email protected]/Smack-events-7" to="[email protected]/d1fdf036"/><presence id="rePFN-67" from="[email protected]/Smack-events-16" to="[email protected]/d1fdf036"/><presence id="rePFN-39" from="[email protected]/Smack-events-9" to="[email protected]/d1fdf036"/><presence id="rePFN-15" from="[email protected]/Smack-events-3" to="[email protected]/d1fdf036"/><presence id="rePFN-7" from="[email protected]/Smack-events-1" to="[email protected]/d1fdf036"/><presence id="cCoBN-3" from="[email protected]/desktop" to="[email protected]/d1fdf036"/><presence id="rePFN-47" from="[email protected]/Smack-events-11" to="[email protected]/d1fdf036"/><presence id="rePFN-11" from="[email protected]/Smack-events-2" to="[email protected]/d1fdf036"/><presence id="rePFN-59" from="[email protected]/Smack-events-14" to="[email protected]/d1fdf036"/><presence id="rePFN-71" from="[email protected]/Smack-events-17" to="[email protected]/d1fdf036"/><presence id="rePFN-79" from="[email protected]/Smack-events-19" to="[email protected]/d1fdf036"/><presence id="rePFN-51" from="[email protected]/Smack-events-12" to="[email protected]/d1fdf036"/><presence id="rePFN-19" from="[email protected]/Smack-events-4" to="[email protected]/d1fdf036"/><presence id="rePFN-23" from="[email protected]/Smack-events-5" to="[email protected]/d1fdf036"/><presence id="rePFN-63" from="[email protected]/Smack-events-15" to="[email protected]/d1fdf036"/><presence id="rePFN-43" from="[email protected]/Smack-events-10" to="[email protected]/d1fdf036"/><presence id="rePFN-83" from="[email protected]/Smack-events-20" to="[email protected]/d1fdf036"/><presence id="rePFN-75" from="[email protected]/Smack-events-18" to="[email protected]/d1fdf036"/><presence id="rePFN-27" from="[email protected]/Smack-events-6" to="[email protected]/d1fdf036"/><presence id="rePFN-88" from="[email protected]/2cb16d01" to="[email protected]/d1fdf036"/>
<message from="pubsub.chdevuccx105.nxodev.intra" to="[email protected]" id="/finesse/api/User/[email protected]__Q3N8W"><event xmlns="http://jabber.org/protocol/pubsub#event"><items node="/finesse/api/User/lsste"><item id="47e72e72-41fd-4841-91a3-71fa1d3285822692"><notification xmlns="http://jabber.org/protocol/pubsub">&lt;Update&gt;
  &lt;data&gt;
    &lt;user&gt;
      &lt;dialogs&gt;/finesse/api/User/lsste/Dialogs&lt;/dialogs&gt;
      &lt;extension&gt;7881&lt;/extension&gt;
      &lt;firstName&gt;Stephan&lt;/firstName&gt;
      &lt;lastName&gt;Steiner&lt;/lastName&gt;
      &lt;loginId&gt;lsste&lt;/loginId&gt;
      &lt;loginName&gt;lsste&lt;/loginName&gt;
      &lt;pendingState&gt;&lt;/pendingState&gt;
      &lt;roles&gt;
        &lt;role&gt;Agent&lt;/role&gt;
      &lt;/roles&gt;
      &lt;settings&gt;
        &lt;wrapUpOnIncoming&gt;&lt;/wrapUpOnIncoming&gt;
      &lt;/settings&gt;
      &lt;state&gt;READY&lt;/state&gt;
      &lt;stateChangeTime&gt;2016-01-27T16:58:00.614Z&lt;/stateChangeTime&gt;
      &lt;teamId&gt;1&lt;/teamId&gt;
      &lt;teamName&gt;Default&lt;/teamName&gt;
      &lt;uri&gt;/finesse/api/User/lsste&lt;/uri&gt;
    &lt;/user&gt;
  &lt;/data&gt;
  &lt;event&gt;PUT&lt;/event&gt;
  &lt;requestId&gt;dae452c1-19cb-4d1b-88f6-e91093122599&lt;/requestId&gt;
  &lt;source&gt;/finesse/api/User/lsste&lt;/source&gt;
&lt;/Update&gt;</notification></item></items></event></message>
</stream:stream>
</stream:stream>

ssteiner avatar Jan 27 '16 17:01 ssteiner

Good thing we have the source - I swapped the nuget package for my own build, and sure enough I quickly identified what prevented my messages from being delivered. In XmppIm.cs method OnMessage, there's a check

if (message.Data["body"] != null)
    Message.Raise(this, new MessageEventArgs(message.From, message));

Leave that out and the data arrives just fine.

ssteiner avatar Jan 27 '16 17:01 ssteiner

Yeap, it is surely a good thing! I will check the spec and if message body can be null, then please make a pull request!

pgstath avatar Jan 28 '16 13:01 pgstath