cmeng
August 2, 2019, 12:24am
1
In aTalk Jingle class, in the override method:
IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder xml)
When the statement below
xml.attribute(ACTION_ATTR_NAME, getAction());
call with getAction() as Enum to method
XmlStringBuilder#attribute(String name, Enum<?> value)
aTalk media call will failed. instead has to force to use:
xml.attribute(ACTION_ATTR_NAME, getAction().toString()); // must use toString()
Both aTalk and smack JingleAction class does not implement method name()?
Flow
August 2, 2019, 6:25am
2
That post is missing one important piece of information: A description how the “aTalk media call … failed” actually failed. You usually want to include
what did happen
what you expect to happen instead
in any of your reports.
Every Enum
implements name()
:
https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#name()
cmeng
August 2, 2019, 9:19am
3
There is a slight difference in aTalk and smack JingleAction enum implementation:
Each aTalk enum element is specified as e.g.:
SESSION_INITIATE("session-initiate"),
whereas smack enum is specified as:
session_initiate,
The return value of enum.name() is
“SESSION_INITIATE” and “session_initiate” for aTalk and smack respectively
However the value of enum.toString() for both gives
“session-initiate”
which will only produce the correct action attribute in the jingle stanza.
<jingle xmlns='urn:xmpp:jingle:1' initiator='swordfish@atalk.org/atalk' action='session-initiate' sid='29p13n0spj735'>
When method enum.name() is used, the following stanza is being generated, and therefore cannot be understood by the recipient.
<jingle xmlns='urn:xmpp:jingle:1' initiator='swordfish@atalk.org/atalk' action='SESSION_INITIATE' sid='3qv5a1rfv8nof'>
Flow
August 3, 2019, 8:45pm
4
Thanks, now I understood what you are talking about
Should be fixed with:
committed 08:15PM - 03 Aug 19 UTC
as toString() is often overriden by Enums to yield the expected XMPP
wire protocol representation.
system
Closed
November 11, 2019, 8:45pm
5
This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.