pgstath / Sharp.Xmpp

Sharp.Xmpp is looking for a maintainer! Unfortunatelly I do not have currently the time needed to maintain the library. Luckily a small but vibrant community has evolved around Sharp.Xmpp. If you would like to be the project's maintainer please sent an email to pgstath@gmail.com. This should include issues, tickets and commits that you have done for Sharp.Xmpp or other similar project. Sharp.Xmpp is a multiplatform, Windows and Android, .NET XMPP client assembly.Sharp.Xmpp supports IM functionality & a variety of XMPP extensions, is simple and is extensively tested against Android Xamarin. It is a fork of the currently frozen excellent S22.Xmpp project. Sharp.Xmpp will be at the FOSSDEM 2016 Real time DevRoom!
Other
84 stars 51 forks source link

Message not being delivered #12

Open ssteiner opened 8 years ago

ssteiner commented 8 years ago

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>lsste@chdevuccx105.nxodev.intra/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="lsste@chdevuccx105.nxodev.intra/d1fdf036"/><iq from='lsste@chdevuccx105.nxodev.intra/d1fdf036' type='get' id='2'><query xmlns='jabber:iq:roster'/></iq><iq type="result" id="2" to="lsste@chdevuccx105.nxodev.intra/d1fdf036"><query xmlns="jabber:iq:roster"><item jid="finesse@chdevuccx105.nxodev.intra" subscription="both"/><item jid="cuicpresenceuser@chdevuccx105.nxodev.intra" subscription="both"/><item jid="admin@chdevuccx105.nxodev.intra" subscription="both"/><item jid="cuicnodewatchuser@chdevuccx105.nxodev.intra" subscription="both"/><item jid="presencelistener@chdevuccx105.nxodev.intra" subscription="both"/></query></iq><presence><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='Sharp.Xmpp' ver='MlFpXs7lqFyWUkeYGjP2fLFnDc8='/></presence><presence from="lsste@chdevuccx105.nxodev.intra/desktop" to="lsste@chdevuccx105.nxodev.intra/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="finesse@chdevuccx105.nxodev.intra/web_framework" to="lsste@chdevuccx105.nxodev.intra/d1fdf036"/><presence id="rePFN-5" from="cuicpresenceuser@chdevuccx105.nxodev.intra/7eafb26c" to="lsste@chdevuccx105.nxodev.intra/d1fdf036"/><presence id="rePFN-35" from="admin@chdevuccx105.nxodev.intra/Smack-events-8" to="lsste@chdevuccx105.nxodev.intra/d1fdf036"/><presence id="rePFN-55" from="admin@chdevuccx105.nxodev.intra/Smack-events-13" to="lsste@chdevuccx105.nxodev.intra/d1fdf036"/><presence id="rePFN-31" from="admin@chdevuccx105.nxodev.intra/Smack-events-7" to="lsste@chdevuccx105.nxodev.intra/d1fdf036"/><presence id="rePFN-67" from="admin@chdevuccx105.nxodev.intra/Smack-events-16" to="lsste@chdevuccx105.nxodev.intra/d1fdf036"/><presence id="rePFN-39" from="admin@chdevuccx105.nxodev.intra/Smack-events-9" to="lsste@chdevuccx105.nxodev.intra/d1fdf036"/><presence id="rePFN-15" from="admin@chdevuccx105.nxodev.intra/Smack-events-3" to="lsste@chdevuccx105.nxodev.intra/d1fdf036"/><presence id="rePFN-7" from="admin@chdevuccx105.nxodev.intra/Smack-events-1" to="lsste@chdevuccx105.nxodev.intra/d1fdf036"/><presence id="cCoBN-3" from="admin@chdevuccx105.nxodev.intra/desktop" to="lsste@chdevuccx105.nxodev.intra/d1fdf036"/><presence id="rePFN-47" from="admin@chdevuccx105.nxodev.intra/Smack-events-11" to="lsste@chdevuccx105.nxodev.intra/d1fdf036"/><presence id="rePFN-11" from="admin@chdevuccx105.nxodev.intra/Smack-events-2" to="lsste@chdevuccx105.nxodev.intra/d1fdf036"/><presence id="rePFN-59" from="admin@chdevuccx105.nxodev.intra/Smack-events-14" to="lsste@chdevuccx105.nxodev.intra/d1fdf036"/><presence id="rePFN-71" from="admin@chdevuccx105.nxodev.intra/Smack-events-17" to="lsste@chdevuccx105.nxodev.intra/d1fdf036"/><presence id="rePFN-79" from="admin@chdevuccx105.nxodev.intra/Smack-events-19" to="lsste@chdevuccx105.nxodev.intra/d1fdf036"/><presence id="rePFN-51" from="admin@chdevuccx105.nxodev.intra/Smack-events-12" to="lsste@chdevuccx105.nxodev.intra/d1fdf036"/><presence id="rePFN-19" from="admin@chdevuccx105.nxodev.intra/Smack-events-4" to="lsste@chdevuccx105.nxodev.intra/d1fdf036"/><presence id="rePFN-23" from="admin@chdevuccx105.nxodev.intra/Smack-events-5" to="lsste@chdevuccx105.nxodev.intra/d1fdf036"/><presence id="rePFN-63" from="admin@chdevuccx105.nxodev.intra/Smack-events-15" to="lsste@chdevuccx105.nxodev.intra/d1fdf036"/><presence id="rePFN-43" from="admin@chdevuccx105.nxodev.intra/Smack-events-10" to="lsste@chdevuccx105.nxodev.intra/d1fdf036"/><presence id="rePFN-83" from="admin@chdevuccx105.nxodev.intra/Smack-events-20" to="lsste@chdevuccx105.nxodev.intra/d1fdf036"/><presence id="rePFN-75" from="admin@chdevuccx105.nxodev.intra/Smack-events-18" to="lsste@chdevuccx105.nxodev.intra/d1fdf036"/><presence id="rePFN-27" from="admin@chdevuccx105.nxodev.intra/Smack-events-6" to="lsste@chdevuccx105.nxodev.intra/d1fdf036"/><presence id="rePFN-88" from="cuicnodewatchuser@chdevuccx105.nxodev.intra/2cb16d01" to="lsste@chdevuccx105.nxodev.intra/d1fdf036"/>
<message from="pubsub.chdevuccx105.nxodev.intra" to="lsste@chdevuccx105.nxodev.intra" id="/finesse/api/User/lsste__lsste@chdevuccx105.nxodev.intra__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 commented 8 years ago

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.

pgstath commented 8 years ago

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!