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

George Joseph asteriskteam at digium.com
Wed Oct 24 07:47:58 CDT 2018


George Joseph has submitted this change and it was merged. ( 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, 28 insertions(+), 111 deletions(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved
  George Joseph: Approved for Submit



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..8366a8c 100644
--- a/res/res_xmpp.c
+++ b/res/res_xmpp.c
@@ -137,14 +137,31 @@
 		</syntax>
 		<description>
 			<para>Retrieves the numeric status associated with the buddy identified
-			by <replaceable>jid</replaceable>.
-			If the buddy does not exist in the buddylist, returns 7.</para>
-			<para>Status will be 1-7.</para>
-			<para>1=Online, 2=Chatty, 3=Away, 4=XAway, 5=DND, 6=Offline</para>
-			<para>If not in roster variable will be set to 7.</para>
-			<para>Example: ${JABBER_STATUS(asterisk,bob at domain.com)} returns 1 if
-			<replaceable>bob at domain.com</replaceable> is online. <replaceable>asterisk</replaceable> is
-			the associated XMPP account configured in xmpp.conf.</para>
+			by <replaceable>jid</replaceable>. The return value 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>
 		<see-also>
 			<ref type="function" module="res_xmpp">JABBER_RECEIVE</ref>
@@ -213,50 +230,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 +1652,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 +4663,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: merged
Gerrit-Change-Id: I1a00ca22d59d6b6d2166aa56f0e9338a33e5ac60
Gerrit-Change-Number: 10511
Gerrit-PatchSet: 2
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2 (1000185)
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181024/48bb0f3f/attachment-0001.html>


More information about the asterisk-code-review mailing list