<p>George Joseph <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/10511">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Richard Mudgett: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved
George Joseph: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_xmpp: Remove deprecated JabberStatus application.<br><br>Change-Id: I1a00ca22d59d6b6d2166aa56f0e9338a33e5ac60<br>---<br>M UPGRADE.txt<br>M res/res_xmpp.c<br>2 files changed, 28 insertions(+), 111 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/UPGRADE.txt b/UPGRADE.txt</span><br><span>index b7bbf3b..7e17b10 100644</span><br><span>--- a/UPGRADE.txt</span><br><span>+++ b/UPGRADE.txt</span><br><span>@@ -25,3 +25,6 @@</span><br><span> === UPGRADE-16.txt -- Upgrade info for 15 to 16</span><br><span> ===========================================================</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+From 16 to 17:</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+* The JabberStatus application, deprecated in Asterisk 12, has been removed.</span><br><span>diff --git a/res/res_xmpp.c b/res/res_xmpp.c</span><br><span>index b72581f..8366a8c 100644</span><br><span>--- a/res/res_xmpp.c</span><br><span>+++ b/res/res_xmpp.c</span><br><span>@@ -137,14 +137,31 @@</span><br><span> </syntax></span><br><span> <description></span><br><span> <para>Retrieves the numeric status associated with the buddy identified</span><br><span style="color: hsl(0, 100%, 40%);">- by <replaceable>jid</replaceable>.</span><br><span style="color: hsl(0, 100%, 40%);">- If the buddy does not exist in the buddylist, returns 7.</para></span><br><span style="color: hsl(0, 100%, 40%);">- <para>Status will be 1-7.</para></span><br><span style="color: hsl(0, 100%, 40%);">- <para>1=Online, 2=Chatty, 3=Away, 4=XAway, 5=DND, 6=Offline</para></span><br><span style="color: hsl(0, 100%, 40%);">- <para>If not in roster variable will be set to 7.</para></span><br><span style="color: hsl(0, 100%, 40%);">- <para>Example: ${JABBER_STATUS(asterisk,bob@domain.com)} returns 1 if</span><br><span style="color: hsl(0, 100%, 40%);">- <replaceable>bob@domain.com</replaceable> is online. <replaceable>asterisk</replaceable> is</span><br><span style="color: hsl(0, 100%, 40%);">- the associated XMPP account configured in xmpp.conf.</para></span><br><span style="color: hsl(120, 100%, 40%);">+ by <replaceable>jid</replaceable>. The return value will be one of the</span><br><span style="color: hsl(120, 100%, 40%);">+ following.</para></span><br><span style="color: hsl(120, 100%, 40%);">+ <enumlist></span><br><span style="color: hsl(120, 100%, 40%);">+ <enum name="1"></span><br><span style="color: hsl(120, 100%, 40%);">+ <para>Online</para></span><br><span style="color: hsl(120, 100%, 40%);">+ </enum></span><br><span style="color: hsl(120, 100%, 40%);">+ <enum name="2"></span><br><span style="color: hsl(120, 100%, 40%);">+ <para>Chatty</para></span><br><span style="color: hsl(120, 100%, 40%);">+ </enum></span><br><span style="color: hsl(120, 100%, 40%);">+ <enum name="3"></span><br><span style="color: hsl(120, 100%, 40%);">+ <para>Away</para></span><br><span style="color: hsl(120, 100%, 40%);">+ </enum></span><br><span style="color: hsl(120, 100%, 40%);">+ <enum name="4"></span><br><span style="color: hsl(120, 100%, 40%);">+ <para>Extended Away</para></span><br><span style="color: hsl(120, 100%, 40%);">+ </enum></span><br><span style="color: hsl(120, 100%, 40%);">+ <enum name="5"></span><br><span style="color: hsl(120, 100%, 40%);">+ <para>Do Not Disturb</para></span><br><span style="color: hsl(120, 100%, 40%);">+ </enum></span><br><span style="color: hsl(120, 100%, 40%);">+ <enum name="6"></span><br><span style="color: hsl(120, 100%, 40%);">+ <para>Offline</para></span><br><span style="color: hsl(120, 100%, 40%);">+ </enum></span><br><span style="color: hsl(120, 100%, 40%);">+ <enum name="7"></span><br><span style="color: hsl(120, 100%, 40%);">+ <para>Not In Roster</para></span><br><span style="color: hsl(120, 100%, 40%);">+ </enum></span><br><span style="color: hsl(120, 100%, 40%);">+ </enumlist></span><br><span> </description></span><br><span> <see-also></span><br><span> <ref type="function" module="res_xmpp">JABBER_RECEIVE</ref></span><br><span>@@ -213,50 +230,6 @@</span><br><span> <para>Allows Asterisk to leave a chat room.</para></span><br><span> </description></span><br><span> </application></span><br><span style="color: hsl(0, 100%, 40%);">- <application name="JabberStatus" language="en_US" module="res_xmpp"></span><br><span style="color: hsl(0, 100%, 40%);">- <synopsis></span><br><span style="color: hsl(0, 100%, 40%);">- Retrieve the status of a jabber list member</span><br><span style="color: hsl(0, 100%, 40%);">- </synopsis></span><br><span style="color: hsl(0, 100%, 40%);">- <syntax></span><br><span style="color: hsl(0, 100%, 40%);">- <parameter name="Jabber" required="true"></span><br><span style="color: hsl(0, 100%, 40%);">- <para>Client or transport Asterisk users to connect to Jabber.</para></span><br><span style="color: hsl(0, 100%, 40%);">- </parameter></span><br><span style="color: hsl(0, 100%, 40%);">- <parameter name="JID" required="true"></span><br><span style="color: hsl(0, 100%, 40%);">- <para>XMPP/Jabber JID (Name) of recipient.</para></span><br><span style="color: hsl(0, 100%, 40%);">- </parameter></span><br><span style="color: hsl(0, 100%, 40%);">- <parameter name="Variable" required="true"></span><br><span style="color: hsl(0, 100%, 40%);">- <para>Variable to store the status of requested user.</para></span><br><span style="color: hsl(0, 100%, 40%);">- </parameter></span><br><span style="color: hsl(0, 100%, 40%);">- </syntax></span><br><span style="color: hsl(0, 100%, 40%);">- <description></span><br><span style="color: hsl(0, 100%, 40%);">- <para>This application is deprecated. Please use the JABBER_STATUS() function instead.</para></span><br><span style="color: hsl(0, 100%, 40%);">- <para>Retrieves the numeric status associated with the specified buddy <replaceable>JID</replaceable>.</span><br><span style="color: hsl(0, 100%, 40%);">- The return value in the <replaceable>Variable</replaceable>will be one of the following.</para></span><br><span style="color: hsl(0, 100%, 40%);">- <enumlist></span><br><span style="color: hsl(0, 100%, 40%);">- <enum name="1"></span><br><span style="color: hsl(0, 100%, 40%);">- <para>Online.</para></span><br><span style="color: hsl(0, 100%, 40%);">- </enum></span><br><span style="color: hsl(0, 100%, 40%);">- <enum name="2"></span><br><span style="color: hsl(0, 100%, 40%);">- <para>Chatty.</para></span><br><span style="color: hsl(0, 100%, 40%);">- </enum></span><br><span style="color: hsl(0, 100%, 40%);">- <enum name="3"></span><br><span style="color: hsl(0, 100%, 40%);">- <para>Away.</para></span><br><span style="color: hsl(0, 100%, 40%);">- </enum></span><br><span style="color: hsl(0, 100%, 40%);">- <enum name="4"></span><br><span style="color: hsl(0, 100%, 40%);">- <para>Extended Away.</para></span><br><span style="color: hsl(0, 100%, 40%);">- </enum></span><br><span style="color: hsl(0, 100%, 40%);">- <enum name="5"></span><br><span style="color: hsl(0, 100%, 40%);">- <para>Do Not Disturb.</para></span><br><span style="color: hsl(0, 100%, 40%);">- </enum></span><br><span style="color: hsl(0, 100%, 40%);">- <enum name="6"></span><br><span style="color: hsl(0, 100%, 40%);">- <para>Offline.</para></span><br><span style="color: hsl(0, 100%, 40%);">- </enum></span><br><span style="color: hsl(0, 100%, 40%);">- <enum name="7"></span><br><span style="color: hsl(0, 100%, 40%);">- <para>Not In Roster.</para></span><br><span style="color: hsl(0, 100%, 40%);">- </enum></span><br><span style="color: hsl(0, 100%, 40%);">- </enumlist></span><br><span style="color: hsl(0, 100%, 40%);">- </description></span><br><span style="color: hsl(0, 100%, 40%);">- </application></span><br><span> <manager name="JabberSend" language="en_US" module="res_xmpp"></span><br><span> <synopsis></span><br><span> Sends a message to a Jabber Client.</span><br><span>@@ -1679,64 +1652,6 @@</span><br><span> return status;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-/*</span><br><span style="color: hsl(0, 100%, 40%);">- * \internal</span><br><span style="color: hsl(0, 100%, 40%);">- * \brief Dial plan function status(). puts the status of watched user</span><br><span style="color: hsl(0, 100%, 40%);">- * into a channel variable.</span><br><span style="color: hsl(0, 100%, 40%);">- * \param chan ast_channel</span><br><span style="color: hsl(0, 100%, 40%);">- * \param data</span><br><span style="color: hsl(0, 100%, 40%);">- * \retval 0 success</span><br><span style="color: hsl(0, 100%, 40%);">- * \retval -1 error</span><br><span style="color: hsl(0, 100%, 40%);">- */</span><br><span style="color: hsl(0, 100%, 40%);">-static int xmpp_status_exec(struct ast_channel *chan, const char *data)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- RAII_VAR(struct xmpp_config *, cfg, ao2_global_obj_ref(globals), ao2_cleanup);</span><br><span style="color: hsl(0, 100%, 40%);">- RAII_VAR(struct ast_xmpp_client_config *, clientcfg, NULL, ao2_cleanup);</span><br><span style="color: hsl(0, 100%, 40%);">- char *s = NULL, status[2];</span><br><span style="color: hsl(0, 100%, 40%);">- static int deprecation_warning = 0;</span><br><span style="color: hsl(0, 100%, 40%);">- AST_DECLARE_APP_ARGS(args,</span><br><span style="color: hsl(0, 100%, 40%);">- AST_APP_ARG(sender);</span><br><span style="color: hsl(0, 100%, 40%);">- AST_APP_ARG(jid);</span><br><span style="color: hsl(0, 100%, 40%);">- AST_APP_ARG(variable);</span><br><span style="color: hsl(0, 100%, 40%);">- );</span><br><span style="color: hsl(0, 100%, 40%);">- AST_DECLARE_APP_ARGS(jid,</span><br><span style="color: hsl(0, 100%, 40%);">- AST_APP_ARG(screenname);</span><br><span style="color: hsl(0, 100%, 40%);">- AST_APP_ARG(resource);</span><br><span style="color: hsl(0, 100%, 40%);">- );</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if (deprecation_warning++ % 10 == 0) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_WARNING, "JabberStatus is deprecated. Please use the JABBER_STATUS dialplan function in the future.\n");</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if (ast_strlen_zero(data)) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_ERROR, "Usage: JabberStatus(<sender>,<jid>[/<resource>],<varname>\n");</span><br><span style="color: hsl(0, 100%, 40%);">- return 0;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- s = ast_strdupa(data);</span><br><span style="color: hsl(0, 100%, 40%);">- AST_STANDARD_APP_ARGS(args, s);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if (args.argc != 3) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_ERROR, "JabberStatus() requires 3 arguments.\n");</span><br><span style="color: hsl(0, 100%, 40%);">- return -1;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- AST_NONSTANDARD_APP_ARGS(jid, args.jid, '/');</span><br><span style="color: hsl(0, 100%, 40%);">- if (jid.argc < 1 || jid.argc > 2) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_WARNING, "Wrong JID %s, exiting\n", args.jid);</span><br><span style="color: hsl(0, 100%, 40%);">- return -1;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if (!cfg || !cfg->clients || !(clientcfg = xmpp_config_find(cfg->clients, args.sender))) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_WARNING, "Could not find sender connection: '%s'\n", args.sender);</span><br><span style="color: hsl(0, 100%, 40%);">- return -1;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- snprintf(status, sizeof(status), "%d", get_buddy_status(clientcfg, jid.screenname, jid.resource));</span><br><span style="color: hsl(0, 100%, 40%);">- pbx_builtin_setvar_helper(chan, args.variable, status);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- return 0;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> /*!</span><br><span> * \internal</span><br><span> * \brief Dial plan funtcion to retrieve the status of a buddy.</span><br><span>@@ -4748,7 +4663,6 @@</span><br><span> </span><br><span> ast_register_application_xml(app_ajisend, xmpp_send_exec);</span><br><span> ast_register_application_xml(app_ajisendgroup, xmpp_sendgroup_exec);</span><br><span style="color: hsl(0, 100%, 40%);">- ast_register_application_xml(app_ajistatus, xmpp_status_exec);</span><br><span> ast_register_application_xml(app_ajijoin, xmpp_join_exec);</span><br><span> ast_register_application_xml(app_ajileave, xmpp_leave_exec);</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10511">change 10511</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/10511"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I1a00ca22d59d6b6d2166aa56f0e9338a33e5ac60 </div>
<div style="display:none"> Gerrit-Change-Number: 10511 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 (1000185) </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>