[asterisk-bugs] [JIRA] (ASTERISK-23510) JABBER_STATUS fails with improper code 7 for unavailable clients

Rusty Newton (JIRA) noreply at issues.asterisk.org
Thu Apr 3 18:52:18 CDT 2014


     [ https://issues.asterisk.org/jira/browse/ASTERISK-23510?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rusty Newton updated ASTERISK-23510:
------------------------------------

    Status: Open  (was: Triage)

> JABBER_STATUS fails with improper code 7 for unavailable clients
> ----------------------------------------------------------------
>
>                 Key: ASTERISK-23510
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-23510
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_xmpp
>    Affects Versions: 11.8.1
>         Environment: CentOS 6.5/AsteriskNOW 32-bit
>            Reporter: Anthony Critelli
>
> According to JABBER_STATUS documentation, a call to this function should return a value of 6 when a user is unavailable. Instead, it is returning 7. There are two scenarios to consider, both described in detail below. Relevant documentation is here: https://wiki.asterisk.org/wiki/display/AST/Function_JABBER_STATUS?src=search
> THe first scenario is when JABBER_STATUS is called using only the bare jid (username at domain). According to documentation, this should work. However, this always fails with a return of 7.
> Asterisk clearly receives presence data (debug output from xmpp set debug on):
> {noformat}
> <--- XMPP received from 'ejabberd' --->
> <presence from='tony2012 at 10.1.4.13/Desktop' to='asterisk at 10.1.4.13/asterisk-xmpp'><show>away</show><c xmlns='http://jabber.org/protocol/caps' node='http://pidgin.im/' hash='sha-1' ver='I22W7CegORwdbnu0ZiQwGpxr0Go='/><x xmlns='vcard-temp:x:update'><photo/></x></presence>
> <------------->
> {noformat}
> However, a call to JABBER_STATUS fails:
> {noformat}
> [Mar 21 00:08:21] NOTICE[24015][C-00000000]: res_xmpp.c:1631 acf_jabberstatus_read: Resource (null) of buddy tony2012 at 10.1.4.13 was not found.
>     -- Executing [1004 at HomeSets:2] Set("SIP/TonyRoom-00000000", "JSTATUS=7") in new stack
> {noformat}
> The user does appear in the buddy list:
> {noformat}
> localhost*CLI> xmpp show buddies
> XMPP buddy lists
> Client: ejabberd
>         Buddy:  tony2012 at 10.1.4.13
>                 Resource: Desktop
>                         node: http://pidgin.im/
>                         version: I22W7CegORwdbnu0ZiQwGpxr0Go=
>                         Google Talk capable: no
>                         Jingle capable: yes
> {noformat}
> Additionally, sending a message via JabberSend works fine.
> Relevant extensions.conf snippet (just a test extension 1004 to send a test message and check status):
> {noformat}
>         exten => 1004, 1, JabberSend(ejabberd,tony2012 at 10.1.4.13,Test)
>                 same => n, Set(JSTATUS=${JABBER_STATUS(ejabberd,tony2012 at 10.1.4.13)})
> {noformat}
> xmpp.conf:
> {noformat}
> [root at localhost asterisk]# cat xmpp.conf
> [general]
>         autoregister=yes
>         autoprune=no
> [ejabberd]
>         type=client
>         serverhost=10.1.4.13
>         username=asterisk at 10.1.4.13
>         secret=**********
>         priority=2
>         port=5222
>         usetls=no
>         usesasl=yes
>         status=available
>         statusmessage="It's Asterisk!"
>         timeout=5
> {noformat}
> The behavior observed above is consistent across all jabber client states (away, available, offline, etc.)
> The second scenario arises when JABBER_STATUS is called with a full jid. This will work for all values except 6 (unavailable). When a client goes unavailable, a call to JABBER_STATUS will return 7.
> Asterisk clearly receives presence data (debug output from xmpp set debug on):
> {noformat}
> <--- XMPP received from 'ejabberd' --->
> <presence from='tony2012 at 10.1.4.13/Desktop' to='asterisk at 10.1.4.13/asterisk-xmpp'><show>dnd</show><c xmlns='http://jabber.org/protocol/caps' node='http://pidgin.im/' hash='sha-1' ver='1RsmhQD7CXz0TuytinljsuOTrVU='/><x xmlns='vcard-temp:x:update'><photo/></x></presence>
> <------------->
> {noformat}
> And a call to JABBER_STATUS works for values other than unavailable (shown below with DND, a correct value of 5 is reported):
> {noformat}
>     -- Executing [1004 at HomeSets:2] Set("SIP/TonyRoom-00000000", "JSTATUS=5") in new stack
> {noformat}
> However, this will NOT work when the client goes unavailable, as articulated below.
> Asterisk clearly receives presence data (debug output from xmpp set debug on):
> {noformat}
> <--- XMPP received from 'ejabberd' --->
> <presence from='tony2012 at 10.1.4.13/Desktop' to='asterisk at 10.1.4.13/asterisk-xmpp' type='unavailable'/>
> <------------->
> {noformat}
> However, a call to JABBER_STATUS fails with code 7:
> {noformat}
> [Mar 21 00:18:03] NOTICE[24214][C-00000001]: res_xmpp.c:1631 acf_jabberstatus_read: Resource Desktop of buddy tony2012 at 10.1.4.13 was not found.
>     -- Executing [1004 at HomeSets:2] Set("SIP/TonyRoom-00000001", "JSTATUS=7") in new stack
> {noformat}
> XMPP show buddies output is far less interesting, presumably because there is no longer a resource:
> {noformat}
> localhost*CLI> xmpp show buddies
> XMPP buddy lists
> Client: ejabberd
>         Buddy:  tony2012 at 10.1.4.13
> {noformat}
> Relevant extensions.conf snippet:
> {noformat}
>         exten => 1004, 1, JabberSend(ejabberd,tony2012 at 10.1.4.13,Test)
>                 same => n, Set(JSTATUS=${JABBER_STATUS(ejabberd,tony2012 at 10.1.4.13/Desktop)})
> {noformat}
> xmpp.conf contents are THE SAME as those from the previous scenario.
> Based on these data, there are two questions:
> 1. Why does a call to JABBER_STATUS always fail when only the bare jid is used, even though documentation explicity states that a bare jid can be used?
> 2. Why does a call to JABBER_STATUS fail with code 7 when a client goes unavailable, even though Asterisk clearly receives the presence data.
> This has been tested across two different clients, namely Pidgin on Windows and Adium on Mac. However, this would seem to not matter, since xmpp debug shows Asterisk receiving the proper presence notifications.
> Asterisk version is 11.8.1 on CentOS 6.5, originally obtained as an AsteriskNOW distro.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list