[Asterisk-code-review] res xmpp: Remove deprecated JabberStatus application. (asterisk[master])

Sean Bright asteriskteam at digium.com
Thu Oct 18 14:42:23 CDT 2018


Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/10511


Change subject: res_xmpp: Remove deprecated JabberStatus application.
......................................................................

res_xmpp: Remove deprecated JabberStatus application.

Change-Id: I1a00ca22d59d6b6d2166aa56f0e9338a33e5ac60
---
M UPGRADE.txt
M res/res_xmpp.c
2 files changed, 3 insertions(+), 103 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/11/10511/1

diff --git a/UPGRADE.txt b/UPGRADE.txt
index b7bbf3b..7e17b10 100644
--- a/UPGRADE.txt
+++ b/UPGRADE.txt
@@ -25,3 +25,6 @@
 === UPGRADE-16.txt  -- Upgrade info for 15 to 16
 ===========================================================
 
+From 16 to 17:
+
+* The JabberStatus application, deprecated in Asterisk 12, has been removed.
diff --git a/res/res_xmpp.c b/res/res_xmpp.c
index b72581f..d64e873 100644
--- a/res/res_xmpp.c
+++ b/res/res_xmpp.c
@@ -213,50 +213,6 @@
 			<para>Allows Asterisk to leave a chat room.</para>
 		</description>
 	</application>
-	<application name="JabberStatus" language="en_US" module="res_xmpp">
-		<synopsis>
-			Retrieve the status of a jabber list member
-		</synopsis>
-		<syntax>
-			<parameter name="Jabber" required="true">
-				<para>Client or transport Asterisk users to connect to Jabber.</para>
-			</parameter>
-			<parameter name="JID" required="true">
-				<para>XMPP/Jabber JID (Name) of recipient.</para>
-			</parameter>
-			<parameter name="Variable" required="true">
-				<para>Variable to store the status of requested user.</para>
-			</parameter>
-		</syntax>
-		<description>
-			<para>This application is deprecated. Please use the JABBER_STATUS() function instead.</para>
-			<para>Retrieves the numeric status associated with the specified buddy <replaceable>JID</replaceable>.
-			The return value in the <replaceable>Variable</replaceable>will be one of the following.</para>
-			<enumlist>
-				<enum name="1">
-					<para>Online.</para>
-				</enum>
-				<enum name="2">
-					<para>Chatty.</para>
-				</enum>
-				<enum name="3">
-					<para>Away.</para>
-				</enum>
-				<enum name="4">
-					<para>Extended Away.</para>
-				</enum>
-				<enum name="5">
-					<para>Do Not Disturb.</para>
-				</enum>
-				<enum name="6">
-					<para>Offline.</para>
-				</enum>
-				<enum name="7">
-					<para>Not In Roster.</para>
-				</enum>
-			</enumlist>
-		</description>
-	</application>
 	<manager name="JabberSend" language="en_US" module="res_xmpp">
 		<synopsis>
 			Sends a message to a Jabber Client.
@@ -1679,64 +1635,6 @@
 	return status;
 }
 
-/*
- * \internal
- * \brief Dial plan function status(). puts the status of watched user
- * into a channel variable.
- * \param chan ast_channel
- * \param data
- * \retval 0 success
- * \retval -1 error
- */
-static int xmpp_status_exec(struct ast_channel *chan, const char *data)
-{
-	RAII_VAR(struct xmpp_config *, cfg, ao2_global_obj_ref(globals), ao2_cleanup);
-	RAII_VAR(struct ast_xmpp_client_config *, clientcfg, NULL, ao2_cleanup);
-	char *s = NULL, status[2];
-	static int deprecation_warning = 0;
-	AST_DECLARE_APP_ARGS(args,
-			     AST_APP_ARG(sender);
-			     AST_APP_ARG(jid);
-			     AST_APP_ARG(variable);
-		);
-	AST_DECLARE_APP_ARGS(jid,
-			     AST_APP_ARG(screenname);
-			     AST_APP_ARG(resource);
-		);
-
-	if (deprecation_warning++ % 10 == 0) {
-		ast_log(LOG_WARNING, "JabberStatus is deprecated.  Please use the JABBER_STATUS dialplan function in the future.\n");
-	}
-
-	if (ast_strlen_zero(data)) {
-		ast_log(LOG_ERROR, "Usage: JabberStatus(<sender>,<jid>[/<resource>],<varname>\n");
-		return 0;
-	}
-	s = ast_strdupa(data);
-	AST_STANDARD_APP_ARGS(args, s);
-
-	if (args.argc != 3) {
-		ast_log(LOG_ERROR, "JabberStatus() requires 3 arguments.\n");
-		return -1;
-	}
-
-	AST_NONSTANDARD_APP_ARGS(jid, args.jid, '/');
-	if (jid.argc < 1 || jid.argc > 2) {
-		ast_log(LOG_WARNING, "Wrong JID %s, exiting\n", args.jid);
-		return -1;
-	}
-
-	if (!cfg || !cfg->clients || !(clientcfg = xmpp_config_find(cfg->clients, args.sender))) {
-		ast_log(LOG_WARNING, "Could not find sender connection: '%s'\n", args.sender);
-		return -1;
-	}
-
-	snprintf(status, sizeof(status), "%d", get_buddy_status(clientcfg, jid.screenname, jid.resource));
-	pbx_builtin_setvar_helper(chan, args.variable, status);
-
-	return 0;
-}
-
 /*!
  * \internal
  * \brief Dial plan funtcion to retrieve the status of a buddy.
@@ -4748,7 +4646,6 @@
 
 	ast_register_application_xml(app_ajisend, xmpp_send_exec);
 	ast_register_application_xml(app_ajisendgroup, xmpp_sendgroup_exec);
-	ast_register_application_xml(app_ajistatus, xmpp_status_exec);
 	ast_register_application_xml(app_ajijoin, xmpp_join_exec);
 	ast_register_application_xml(app_ajileave, xmpp_leave_exec);
 

-- 
To view, visit https://gerrit.asterisk.org/10511
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1a00ca22d59d6b6d2166aa56f0e9338a33e5ac60
Gerrit-Change-Number: 10511
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181018/02a9e14f/attachment.html>


More information about the asterisk-code-review mailing list