Does anybody know why the JID resource is changed Smack automatically?

I used smack lib to implement XMPP service, but when one user register XMPP, from the packet capture, the from field was added smack automatically, just like: “from: 12345indomainlocal@aaa.com/Smack”.

Does anybody know why the resource part was changed to “Smack”?

Was changed from what?

The correct “from” value should be: 12345indomainlocal@aaa.com/**vvx **

The resouce should be vvx, but i do not know why the resource was changed to Smack.

That is to say the “from” value was changed to 12345indomainlocal@aaa.com/Smack

How do you set the resource?

Following is wireshark trace, the 10.70.100.15 is XMPP server and the 10.70.100.136 is client with problem:

3000
2016-07-15 14:28:03.410095
10.70.100.136
10.70.100.15
XMPP/XML
190
IQ(set) QUERY(jabber:iq:roster)
3003
2016-07-15 14:28:03.412452
10.70.100.15
10.70.100.136
XMPP/XML
256
IQ(set) QUERY(jabber:iq:roster)
3005
2016-07-15 14:28:03.412925
10.70.100.15
10.70.100.136
XMPP/XML
123
IQ(result)
3007
2016-07-15 14:28:03.415576
10.70.100.136
10.70.100.15
XMPP/XML
196
PRESENCE > 6119809indomainLOCAL@CMA.local
3008
2016-07-15 14:28:03.419299
10.70.100.15
10.70.100.136
XMPP/XML
272
IQ(set) QUERY(jabber:iq:roster)
3009
2016-07-15 14:28:03.421803
10.70.100.15
10.61.16.70
XMPP/XML
192
PRESENCE < 6512367indomainlocal@cma.local
3027
2016-07-15 14:28:03.451301
10.70.100.15
10.70.100.136
XMPP/XML
807
**PRESENCE < 6119809indomainlocal@cma.local/Smack **
3029
2016-07-15 14:28:03.460392
10.70.100.136
10.70.100.15
XMPP/XML
89
IQ(result)
3050
2016-07-15 14:28:03.522811
10.70.100.15
10.61.16.70
XMPP/XML
234
IQ(set) QUERY(jabber:iq:roster)
3051
2016-07-15 14:28:03.532975
10.70.100.136
10.70.100.15
XMPP/XML
89
IQ(result)
3055
2016-07-15 14:28:03.577293
10.70.100.136
10.70.100.15
XMPP/XML
89
IQ(result)
3061
2016-07-15 14:28:03.613054
10.70.100.136
10.70.100.15
XMPP/XML
359
PRESENCE > 6119809indomainlocal@cma.local
3069
2016-07-15 14:28:03.621803
10.70.100.15
10.61.16.70
XMPP/XML
376
PRESENCE < 6512367indomainlocal@cma.local/VVX

That does not answer my question: How do you set the resource?

I did not set the resource, because my XMPP server is implemented using the 3rd party openfire. I just only implement related interfaces and let it listen by 5222 port and received messages, the related processes would be handled by openfire.

As Steven’s post, the XMPP client(6512367indomainlocal) on 10.70.100.136 ask to add buddy(6119809indomainlocal) by IQ(set) on Msg.3000, the XMPP server (10.70.100.15, using Openfire) responses it correctly on Msg. 3005.

The problem is Presence message. On Msg. 3027, the server returns two Presence items with nick names of /vvx and /smack to the client 6512367indomainlocal. So the client shows two nicknames finally on UI. /vvx is the right and /smack is weird.

The Msg. 3027 is below:

0 (XMPP Protocol)

1 (IQ [id=“102-199899” type=“set” to=“6512367indomainlocal@cma.local/VVX”])

2 (id: 102-199899)

2 (type: set)

2 (to: 6512367indomainlocal@cma.local/VVX)

2 (QUERY [xmlns=“jabber:iq:roster”])

3 (xmlns: jabber:iq:roster)

3 (ITEM [jid=“6119809indomainlocal@cma.local” name=“Mike Lee” subscription=“to”])

4 (jid: 6119809indomainlocal@cma.local)

4 (name: Mike Lee)

4 (subscription: to)

1 ([Response In: 695])

1 (PRESENCE [id=“OHhwC-319” type=“subscribed”])

2 (from: 6119809indomainlocal@cma.local)

2 (id: OHhwC-319)

2 (to: 6512367indomainlocal@cma.local)

2 (type: subscribed)

1 (PRESENCE [])

2 (from: 6119809indomainlocal@cma.local/VVX)

2 (to: 6512367indomainlocal@cma.local/VVX)

2 (STATUS [value=“Available”]) putline

3 (value: Available)

2 (CAPS [node=“http://xmpp.aaa.com/quasar/caps”])

3 (xmlns: http://jabber.org/protocol/caps)

3 (ext: video-v1 nochat-v1)

3 ([Expert Info (Warn/Protocol):Required attribute “hash” doesn’t appear in “c”.])

4 ([Required attribute “hash” doesn’t appear in “c”.])

4 ([Severity level: Warn])

4 ([Group: Protocol])

3 (node: http://xmpp.aaa.com/quasar/caps)

3 (ver: 4.1.1.1010)

2 (X [xmlns=“http://www.viavideo.com/xmpp/protocol/sequence” seq=“15”][UNKNOWN])

3 (xmlns: http://www.viavideo.com/xmpp/protocol/sequence)

3 (seq: 15 [UNKNOWN ATTR])

4 ([Expert Info (Note/Undecoded):Unknown attribute seq])

5 ([Unknown attribute seq])

5 ([Severity level: Note])

5 ([Group: Undecoded])

3 ([Expert Info (Note/Undecoded):Unknown element: x])

4 ([Unknown element: x])

4 ([Severity level: Note])

4 ([Group: Undecoded])

**1 (PRESENCE [id=“OHhwC-92”]) **

** 2 (from: 6119809indomainlocal@cma.local/Smack) **

** 2 (id: OHhwC-92) **

** 2 (to: 6512367indomainlocal@cma.local/VVX) **

I still don’t understand the problem. 6512367 receives a self presence from the ‘VVX’ resource and a presence from 6119809 with ‘Smack’ as resource. Obviously the connection of 6119809 did set the resource to ‘Smack’ (which is the default resource used by Smack if none is configured).

6119809indomainlocal@cma.local/Smack

6512367indomainlocal@cma.local/VVX

Thanks for answer.

3027
2016-07-15 14:28:03.451301
10.70.100.15
10.70.100.136
XMPP/XML
807
PRESENCE < 6119809indomainlocal@cma.local/Smack

For msg. 3027, the problem is 6512367 receives presence from 6119809 with ‘Smack’ as resource. That’s wrong that 6119809indomainlocal@cma.local/Smack is same as 6119809indomainlocal@cma.local/VVX. and both of them are replied to 6512367. This will show two names of VVX and Smack on the client UI that confuse users. 6119809 client does not set Smack as an alias. We think the alias of Smack is created by the server per tcp dump analysis.

If “smack” is the default resource used by Smack if none is configured, could you let us know what are fields are not configured so as to let Smack set the default value of “smack”.

Thanks.

Hi Flow,

As you mentioned, “which is the default resource used by Smack if none is configured”, can you let me know to avoid set the default resource to smack?

Thanks.