[asterisk-commits] russell: trunk r322244 - /trunk/res/res_jabber.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jun 7 14:17:35 CDT 2011


Author: russell
Date: Tue Jun  7 14:17:31 2011
New Revision: 322244

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=322244
Log:
Actually check the "sendtodialplan" option setting for xmpp.

(closes issue ASTERISK-17978)
Reported by: elguero
Patches:
    stop_messages_going_to_dialplan.patch (license #5026)

Modified:
    trunk/res/res_jabber.c

Modified: trunk/res/res_jabber.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_jabber.c?view=diff&rev=322244&r1=322243&r2=322244
==============================================================================
--- trunk/res/res_jabber.c (original)
+++ trunk/res/res_jabber.c Tue Jun  7 14:17:31 2011
@@ -2295,21 +2295,23 @@
 		ast_debug(3, "message comes from %s\n", insert->from);
 	}
 
-	if ((msg = ast_msg_alloc())) {
-		int res;
-
-		res = ast_msg_set_to(msg, "xmpp:%s", client->user);
-		res |= ast_msg_set_from(msg, "xmpp:%s", insert->from);
-		res |= ast_msg_set_body(msg, "%s", insert->message);
-		res |= ast_msg_set_context(msg, "%s", client->context);
-
-		if (res) {
-			ast_msg_destroy(msg);
-		} else {
-			ast_msg_queue(msg);
-		}
-
-		msg = NULL;
+	if (client->send_to_dialplan) {
+		if ((msg = ast_msg_alloc())) {
+			int res;
+
+			res = ast_msg_set_to(msg, "xmpp:%s", client->user);
+			res |= ast_msg_set_from(msg, "xmpp:%s", insert->from);
+			res |= ast_msg_set_body(msg, "%s", insert->message);
+			res |= ast_msg_set_context(msg, "%s", client->context);
+
+			if (res) {
+				ast_msg_destroy(msg);
+			} else {
+				ast_msg_queue(msg);
+			}
+
+			msg = NULL;
+		}
 	}
 
 	/* remove old messages received from this JID




More information about the asterisk-commits mailing list