[asterisk-commits] marquis: branch marquis/pubsub-distributed-events r216991 - /team/marquis/pub...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 8 07:54:24 CDT 2009


Author: marquis
Date: Tue Sep  8 07:54:22 2009
New Revision: 216991

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=216991
Log:
Some compatibility fixes for ejabberd and also replace "placeholder.org" with "asterisk.org".  Eventually the xmlns needs to be decided upon, but apparently there's actually a domain placeholder.org so lets not refer to it. 

Modified:
    team/marquis/pubsub-distributed-events/res/res_jabber.c

Modified: team/marquis/pubsub-distributed-events/res/res_jabber.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/marquis/pubsub-distributed-events/res/res_jabber.c?view=diff&rev=216991&r1=216990&r2=216991
==============================================================================
--- team/marquis/pubsub-distributed-events/res/res_jabber.c (original)
+++ team/marquis/pubsub-distributed-events/res/res_jabber.c Tue Sep  8 07:54:22 2009
@@ -514,7 +514,7 @@
 	);
 
 	if (deprecation_warning++ % 10 == 0)
-		ast_log(LOG_WARNING, "JabberStatus is deprecated.  Please use the JABBER_STATUS dialplan function in the future.\n");
+	ast_log(LOG_WARNING,"JabberStatus is deprecated Please use the JABBER_STATUS dialplan function in the future.\n");
 
 	if (!data) {
 		ast_log(LOG_ERROR, "Usage: JabberStatus(<sender>,<jid>[/<resource>],<varname>\n");
@@ -543,7 +543,8 @@
 	if (!r && buddy->resources) 
 		r = buddy->resources;
 	if (!r)
-		ast_log(LOG_NOTICE, "Resource '%s' of buddy '%s' was not found\n", jid.resource, jid.screenname);
+		ast_log(LOG_NOTICE, "Resource '%s' of buddy '%s' was not found\n", jid.resource,
+jid.screenname);
 	else
 		stat = r->status;
 	snprintf(status, sizeof(status), "%d", stat);
@@ -551,7 +552,8 @@
 	return 0;
 }
 
-static int acf_jabberstatus_read(struct ast_channel *chan, const char *name, char *data, char *buf, size_t buflen)
+static int acf_jabberstatus_read(struct ast_channel *chan, const char *name, char *data,
+char *buf, size_t buflen)
 {
 	struct aji_client *client = NULL;
 	struct aji_buddy *buddy = NULL;
@@ -592,7 +594,8 @@
 	if (!r && buddy->resources) 
 		r = buddy->resources;
 	if (!r)
-		ast_log(LOG_NOTICE, "Resource %s of buddy %s was not found.\n", jid.resource, jid.screenname);
+		ast_log(LOG_NOTICE, "Resource %s of buddy %s was not found.\n", jid.resource,
+jid.screenname);
 	else
 		stat = r->status;
 	snprintf(buf, buflen, "%d", stat);
@@ -731,7 +734,8 @@
  * \return the number of read bytes on success, 0 on timeout expiration, 
  * -1 on  error
  */
-static int aji_io_recv(struct aji_client *client, char *buffer, size_t buf_len, int timeout)
+static int aji_io_recv(struct aji_client *client, char *buffer, size_t buf_len, int
+timeout)
 {
 	int sock;
 	fd_set fds;
@@ -930,7 +934,8 @@
 	struct aji_client *client = ASTOBJ_REF((struct aji_client *) data);
 
 	if (!ast_strlen_zero(xmpp))
-		manager_event(EVENT_FLAG_USER, "JabberEvent", "Account: %s\r\nPacket: %s\r\n", client->name, xmpp);
+		manager_event(EVENT_FLAG_USER, "JabberEvent", "Account: %s\r\nPacket: %s\r\n",
+client->name, xmpp);
 
 	if (client->debug) {
 		if (is_incoming)
@@ -957,7 +962,8 @@
  *
  * \return IKS_OK on success, IKSNET_NOTSUPP on failure.
  */
-static int aji_start_sasl(struct aji_client *client, enum ikssasltype type, char *username, char *pass)
+static int aji_start_sasl(struct aji_client *client, enum ikssasltype type, char
+*username, char *pass)
 {
 	iks *x = NULL;
 	int len;
@@ -1014,7 +1020,8 @@
 	int features = 0;
 
 	if(!node) {
-		ast_log(LOG_ERROR, "aji_act_hook was called with out a packet\n"); /* most likely cause type is IKS_NODE_ERROR lost connection */
+		ast_log(LOG_ERROR, "aji_act_hook was called with out a packet\n"); /* most likely
+cause type is IKS_NODE_ERROR lost connection */
 		ASTOBJ_UNREF(client, aji_client_destroy);
 		return IKS_HOOK;
 	}
@@ -1044,8 +1051,10 @@
 				break;
 			}
 			if (!client->usesasl) {
-				iks_filter_add_rule(client->f, aji_client_connect, client, IKS_RULE_TYPE, IKS_PAK_IQ, IKS_RULE_SUBTYPE, IKS_TYPE_RESULT, IKS_RULE_ID, client->mid, IKS_RULE_DONE);
-				auth = jabber_make_auth(client->jid, client->password, iks_find_attrib(node, "id"));
+				iks_filter_add_rule(client->f, aji_client_connect, client, IKS_RULE_TYPE,
+IKS_PAK_IQ, IKS_RULE_SUBTYPE, IKS_TYPE_RESULT, IKS_RULE_ID, client->mid, IKS_RULE_DONE);
+				auth = jabber_make_auth(client->jid, client->password,
+iks_find_attrib(node, "id"));
 				if (auth) {
 					iks_insert_attrib(auth, "id", client->mid);
 					iks_insert_attrib(auth, "to", client->jid->server);
@@ -1072,7 +1081,8 @@
 						break;
 					if (client->authorized) {
 						if (features & IKS_STREAM_BIND) {
-							iks_filter_add_rule(client->f, aji_client_connect, client, IKS_RULE_TYPE, IKS_PAK_IQ, IKS_RULE_SUBTYPE, IKS_TYPE_RESULT, IKS_RULE_DONE);
+							iks_filter_add_rule(client->f, aji_client_connect, client,
+IKS_RULE_TYPE, IKS_PAK_IQ, IKS_RULE_SUBTYPE, IKS_TYPE_RESULT, IKS_RULE_DONE);
 							auth = iks_make_resource_bind(client->jid);
 							if (auth) {
 								iks_insert_attrib(auth, "id", client->mid);
@@ -1085,7 +1095,9 @@
 							}
 						}
 						if (features & IKS_STREAM_SESSION) {
-							iks_filter_add_rule (client->f, aji_client_connect, client, IKS_RULE_TYPE, IKS_PAK_IQ, IKS_RULE_SUBTYPE, IKS_TYPE_RESULT, IKS_RULE_ID, "auth", IKS_RULE_DONE);
+							iks_filter_add_rule (client->f, aji_client_connect, client,
+IKS_RULE_TYPE, IKS_PAK_IQ, IKS_RULE_SUBTYPE, IKS_TYPE_RESULT, IKS_RULE_ID, "auth",
+IKS_RULE_DONE);
 							auth = iks_make_session();
 							if (auth) {
 								iks_insert_attrib(auth, "id", "auth");
@@ -1103,7 +1115,8 @@
 							break;
 						}
 
-						ret = aji_start_sasl(client, features, client->jid->user, client->password);
+						ret = aji_start_sasl(client, features, client->jid->user,
+client->password);
 						if (ret != IKS_OK) {
 							ASTOBJ_UNREF(client, aji_client_destroy);
 							return IKS_HOOK;
@@ -1144,7 +1157,8 @@
 					handshake = NULL;
 				}
 				client->state = AJI_CONNECTING;
-				if(aji_recv(client, 1) == 2) /*XXX proper result for iksemel library on iks_recv of <handshake/> XXX*/
+				if(aji_recv(client, 1) == 2) /*XXX proper result for iksemel library on
+iks_recv of <handshake/> XXX*/
 					client->state = AJI_CONNECTED;
 				else
 					ast_log(LOG_WARNING, "Jabber didn't seem to handshake, failed to authenticate.\n");
@@ -1275,7 +1289,8 @@
 			iks_insert_attrib(query, "xmlns", "jabber:iq:register");
 			iks_insert_attrib(error, "code" , "406");
 			iks_insert_attrib(error, "type", "modify");
-			iks_insert_attrib(notacceptable, "xmlns", "urn:ietf:params:xml:ns:xmpp-stanzas");
+			iks_insert_attrib(notacceptable, "xmlns",
+"urn:ietf:params:xml:ns:xmpp-stanzas");
 			iks_insert_node(iq, query);
 			iks_insert_node(iq, error);
 			iks_insert_node(error, notacceptable);
@@ -1428,7 +1443,8 @@
 			ASTOBJ_UNREF(client, aji_client_destroy);
 			return IKS_FILTER_EAT;
 		}
-		if (iks_find_with_attrib(pak->query, "feature", "var", "http://www.google.com/xmpp/protocol/voice/v1")) {
+		if (iks_find_with_attrib(pak->query, "feature", "var",
+"http://www.google.com/xmpp/protocol/voice/v1")) {
 			resource->cap->jingle = 1;
 		} else
 			resource->cap->jingle = 0;
@@ -1449,7 +1465,8 @@
 			iks_insert_attrib(ident, "type", "pc");
 			iks_insert_attrib(ident, "name", "asterisk");
 			iks_insert_attrib(disco, "var", "http://jabber.org/protocol/disco#info");
-			iks_insert_attrib(google, "var", "http://www.google.com/xmpp/protocol/voice/v1");
+			iks_insert_attrib(google, "var",
+"http://www.google.com/xmpp/protocol/voice/v1");
 			iks_insert_node(iq, query);
 			iks_insert_node(query, ident);
 			iks_insert_node(query, google);
@@ -1493,12 +1510,15 @@
 			ASTOBJ_UNREF(client, aji_client_destroy);
 			return IKS_FILTER_EAT;
 		}
-		if (iks_find_with_attrib(pak->query, "feature", "var", "http://www.google.com/xmpp/protocol/voice/v1")) {
+		if (iks_find_with_attrib(pak->query, "feature", "var",
+"http://www.google.com/xmpp/protocol/voice/v1")) {
 			resource->cap->jingle = 1;
 		} else
 			resource->cap->jingle = 0;
-	} else if (pak->subtype == IKS_TYPE_GET && !(node = iks_find_attrib(pak->query, "node"))) {
-		iks *iq, *query, *identity, *disco, *reg, *commands, *gateway, *version, *vcard, *search;
+	} else if (pak->subtype == IKS_TYPE_GET && !(node = iks_find_attrib(pak->query,
+"node"))) {
+		iks *iq, *query, *identity, *disco, *reg, *commands, *gateway, *version, *vcard,
+*search;
 
 		iq = iks_new("iq");
 		query = iks_new("query");
@@ -1510,8 +1530,8 @@
 		version = iks_new("feature");
 		vcard = iks_new("feature");
 		search = iks_new("feature");
-
-		if (iq && query && identity && disco && reg && commands && gateway && version && vcard && search && client) {
+		if (iq && query && identity && disco && reg && commands && gateway && version &&
+vcard && search && client) {
 			iks_insert_attrib(iq, "from", client->user);
 			iks_insert_attrib(iq, "to", pak->from->full);
 			iks_insert_attrib(iq, "id", pak->id);
@@ -1552,8 +1572,9 @@
 		iks_delete(version);
 		iks_delete(vcard);
 		iks_delete(search);
-
-	} else if (pak->subtype == IKS_TYPE_GET && !strcasecmp(node, "http://jabber.org/protocol/commands")) {
+		
+	} else if (pak->subtype == IKS_TYPE_GET && !strcasecmp(node,
+"http://jabber.org/protocol/commands")) {
 		iks *iq, *query, *confirm;
 		iq = iks_new("iq");
 		query = iks_new("query");
@@ -1692,7 +1713,8 @@
 	}
 	ASTOBJ_WRLOCK(buddy);
 	status = (pak->show) ? pak->show : 6;
-	priority = atoi((iks_find_cdata(pak->x, "priority")) ? iks_find_cdata(pak->x, "priority") : "0");
+	priority = atoi((iks_find_cdata(pak->x, "priority")) ? iks_find_cdata(pak->x,
+"priority") : "0");
 	tmp = buddy->resources;
 	descrip = ast_strdup(iks_find_cdata(pak->x,"status"));
 
@@ -1833,7 +1855,8 @@
 				iks_insert_attrib(iq,"from", client->jid->full);
 				iks_insert_attrib(iq, "id", client->mid);
 				ast_aji_increment_mid(client->mid);
-				iks_insert_attrib(query, "xmlns", "http://jabber.org/protocol/disco#info");
+				iks_insert_attrib(query, "xmlns",
+"http://jabber.org/protocol/disco#info");
 				iks_insert_node(iq, query);
 				ast_aji_send(client, iq);
 				
@@ -1909,7 +1932,8 @@
 		iks_delete(status);
 
 		if (client->component)
-			aji_set_presence(client, pak->from->full, iks_find_attrib(pak->x, "to"), client->status, client->statusmessage);
+			aji_set_presence(client, pak->from->full, iks_find_attrib(pak->x, "to"),
+client->status, client->statusmessage);
 	case IKS_TYPE_SUBSCRIBED:
 		buddy = ASTOBJ_CONTAINER_FIND(&client->buddies, pak->from->partial);
 		if (!buddy && pak->from->partial) {
@@ -2057,6 +2081,7 @@
 		res = aji_reconnect(client);
 		sleep(4);
 	}
+	
 
 	do {
 		if (res == IKS_NET_RWERR || client->timeout == 0) {
@@ -2136,7 +2161,9 @@
 			ASTOBJ_UNLOCK(iterator);
 		});
 		iks_filter_remove_hook(client->f, aji_register_transport);
-		iks_filter_add_rule(client->f, aji_register_transport2, client, IKS_RULE_TYPE, IKS_PAK_IQ, IKS_RULE_SUBTYPE, IKS_TYPE_RESULT, IKS_RULE_NS, IKS_NS_REGISTER, IKS_RULE_DONE);
+		iks_filter_add_rule(client->f, aji_register_transport2, client, IKS_RULE_TYPE,
+IKS_PAK_IQ, IKS_RULE_SUBTYPE, IKS_TYPE_RESULT, IKS_RULE_NS, IKS_NS_REGISTER,
+IKS_RULE_DONE);
 		iks_insert_attrib(send, "to", buddy->host);
 		iks_insert_attrib(send, "id", client->mid);
 		ast_aji_increment_mid(client->mid);
@@ -2203,7 +2230,8 @@
 #endif
 
 /*!
- * \brief goes through roster and prunes users not needed in list, or adds them accordingly.
+ * \brief goes through roster and prunes users not needed in list, or adds them
+accordingly.
  * \param client the configured XMPP client we use to connect to a XMPP server
  * \return void.
  * \note The messages here should be configurable.
@@ -2226,7 +2254,8 @@
 		ASTOBJ_RDLOCK(iterator);
 		/* For an aji_buddy, both AUTOPRUNE and AUTOREGISTER will never
 		 * be called at the same time */
-		if (ast_test_flag(&iterator->flags, AJI_AUTOPRUNE)) { /* If autoprune is set on jabber.conf */
+		if (ast_test_flag(&iterator->flags, AJI_AUTOPRUNE)) { /* If autoprune is set on
+jabber.conf */
 			res = ast_aji_send(client, iks_make_s10n(IKS_TYPE_UNSUBSCRIBE, iterator->name,
 								 "GoodBye. Your status is no longer needed by Asterisk the Open Source PBX"
 								 " so I am no longer subscribing to your presence.\n"));
@@ -2319,7 +2348,8 @@
 			if(ast_test_flag(&client->flags, AJI_AUTOPRUNE)) {
 				ast_set_flag(&buddy->flags, AJI_AUTOPRUNE);
 				ASTOBJ_MARK(buddy);
-			} else if (!iks_strcmp(iks_find_attrib(x, "subscription"), "none") || !iks_strcmp(iks_find_attrib(x, "subscription"), "from")) {
+			} else if (!iks_strcmp(iks_find_attrib(x, "subscription"), "none") ||
+!iks_strcmp(iks_find_attrib(x, "subscription"), "from")) {
 				/* subscribe to buddy's presence only 
 				   if we really need to */
 				ast_set_flag(&buddy->flags, AJI_AUTOREGISTER);
@@ -2374,7 +2404,8 @@
 
 	if(roster) {
 		iks_insert_attrib(roster, "id", "roster");
-		aji_set_presence(client, NULL, client->jid->full, client->status, client->statusmessage);
+		aji_set_presence(client, NULL, client->jid->full, client->status,
+client->statusmessage);
 		ast_aji_send(client, roster);
 	}
 
@@ -2396,7 +2427,8 @@
 
 	if (client) {
 		if (client->state == AJI_DISCONNECTED) {
-			iks_filter_add_rule(client->f, aji_filter_roster, client, IKS_RULE_TYPE, IKS_PAK_IQ, IKS_RULE_SUBTYPE, IKS_TYPE_RESULT, IKS_RULE_ID, "roster", IKS_RULE_DONE);
+			iks_filter_add_rule(client->f, aji_filter_roster, client, IKS_RULE_TYPE,
+IKS_PAK_IQ, IKS_RULE_SUBTYPE, IKS_TYPE_RESULT, IKS_RULE_ID, "roster", IKS_RULE_DONE);
 			client->state = AJI_CONNECTING;
 			client->jid = (iks_find_cdata(pak->query, "jid")) ? iks_id_new(client->stack, iks_find_cdata(pak->query, "jid")) : client->jid;
 			iks_filter_remove_hook(client->f, aji_client_connect);
@@ -2428,13 +2460,15 @@
 	client->stream_flags = 0;
 #endif
 	/* If it's a component, connect to user, otherwise, connect to server */
-	connected = iks_connect_via(client->p, S_OR(client->serverhost, client->jid->server), client->port, client->component ? client->user : client->jid->server);
+	connected = iks_connect_via(client->p, S_OR(client->serverhost, client->jid->server),
+client->port, client->component ? client->user : client->jid->server);
 
 	if (connected == IKS_NET_NOCONN) {
 		ast_log(LOG_ERROR, "JABBER ERROR: No Connection\n");
 		return IKS_HOOK;
 	} else 	if (connected == IKS_NET_NODNS) {
-		ast_log(LOG_ERROR, "JABBER ERROR: No DNS %s for client to  %s\n", client->name, S_OR(client->serverhost, client->jid->server));
+		ast_log(LOG_ERROR, "JABBER ERROR: No DNS %s for client to  %s\n", client->name,
+S_OR(client->serverhost, client->jid->server));
 		return IKS_HOOK;
 	}
 
@@ -2483,9 +2517,9 @@
 		ast_log(LOG_DEBUG, "Returning here\n");
 		return;
 	}
-
+	
 	struct aji_client *client = ASTOBJ_REF((struct aji_client *) data);
-
+	
 	mailbox = ast_event_get_ie_str(ast_event, AST_EVENT_IE_MAILBOX);
 	context = ast_event_get_ie_str(ast_event, AST_EVENT_IE_CONTEXT);
 	snprintf(oldmsgs, sizeof(oldmsgs), "%d",
@@ -2511,7 +2545,7 @@
 		ast_log(LOG_DEBUG, "Returning here\n");
 		return;
 	}
-
+	
 	struct aji_client *client = ASTOBJ_REF((struct aji_client *) data);
 	device = ast_event_get_ie_str(ast_event, AST_EVENT_IE_DEVICE);
 	device_state = ast_devstate_str(ast_event_get_ie_uint(ast_event, AST_EVENT_IE_STATE));
@@ -2544,7 +2578,7 @@
 		IKS_PAK_MESSAGE, IKS_RULE_FROM, client->pubsub_node, IKS_RULE_DONE);
 	iks_filter_add_rule(client->f, aji_handle_pubsub_error, client, IKS_RULE_TYPE,
 		IKS_PAK_IQ, IKS_RULE_SUBTYPE, IKS_TYPE_ERROR, IKS_RULE_DONE);
-
+	
 }
 
 /*!
@@ -2637,7 +2671,7 @@
 {
 	iks *request = aji_pubsub_iq_create(client, "set");
 	iks *pubsub, *subscribe;
-
+	
 	pubsub = iks_insert(request, "pubsub");
 	iks_insert_attrib(pubsub, "xmlns", "http://jabber.org/protocol/pubsub");
 	subscribe = iks_insert(pubsub, "subscribe");
@@ -2669,7 +2703,7 @@
  * \brief Build the skeleton of a publish
  * \param client the configured XMPP client we use to connect to a XMPP server
  * \param node Name of the node that will be published to
- * \param event_type
+ * \param event_type 
  * \return iks *
  */
 static iks* aji_build_publish_skeleton(struct aji_client *client, const char *node,
@@ -2706,7 +2740,7 @@
 	char eid_str[20];
 	ast_eid_to_str(eid_str, sizeof(eid_str), &ast_eid_default);
 	state = iks_insert(request, "state");
-	iks_insert_attrib(state, "xmlns", "http://placeholder.org");
+	iks_insert_attrib(state, "xmlns", "http://asterisk.org");
 	iks_insert_attrib(state, "eid", eid_str);
 	iks_insert_cdata(state, device_state, strlen(device_state));
 	ast_aji_send(client, iks_root(request));
@@ -2730,7 +2764,7 @@
 	iks *request = aji_build_publish_skeleton(client, full_mailbox, "message_waiting");
 	ast_eid_to_str(eid_str, sizeof(eid_str), &ast_eid_default);
 	mailbox_node = iks_insert(request, "mailbox");
-	iks_insert_attrib(mailbox_node, "xmlns", "http://placeholder.org");
+	iks_insert_attrib(mailbox_node, "xmlns", "http://asterisk.org");
 	iks_insert_attrib(mailbox_node, "eid", eid_str);
 	iks_insert_cdata(iks_insert(mailbox_node, "NEWMSGS"), newmsgs, strlen(newmsgs));
 	iks_insert_cdata(iks_insert(mailbox_node, "OLDMSGS"), oldmsgs, strlen(oldmsgs));
@@ -2747,7 +2781,7 @@
 static iks* aji_pubsub_iq_create(struct aji_client *client, const char *type)
 {
 	iks *request = iks_new("iq");
-
+	
 	iks_insert_attrib(request, "to", client->pubsub_node);
 	iks_insert_attrib(request, "from", client->jid->full);
 	iks_insert_attrib(request, "type", type);
@@ -2819,12 +2853,7 @@
 {
 	int res = 0;
 	iks *request = aji_build_node_request(client, collection);
-	iks *query;
-	query = iks_insert(request, "query");
-	iks_insert_attrib(query, "xmlns", "http://jabber.org/protocol/disco#items");
-	if (collection) {
-		iks_insert_attrib(query, "node", collection);
-	}
+
 	iks_filter_add_rule(client->f, aji_receive_node_list, client, IKS_RULE_TYPE,
 		IKS_PAK_IQ, IKS_RULE_SUBTYPE, IKS_TYPE_RESULT, IKS_RULE_ID, client->mid,
 		IKS_RULE_DONE);
@@ -2868,7 +2897,7 @@
 			iks_find_attrib(item, "node"));
 		while((item = iks_next_tag(item))) {
 			ast_verbose("Node name: %s\n", iks_find_attrib(item, "node"));
-		}
+		} 
 	}
 	iks_delete(item);
 	return IKS_FILTER_EAT;
@@ -2913,7 +2942,7 @@
 			ast_cli(a->fd, "Unable to find client '%s'!\n", name);
 			return CLI_FAILURE;
 		}
-
+		
 		ast_cli(a->fd, "Listing pubsub nodes.\n");
 		aji_request_pubsub_nodes(client, collection);
 		return CLI_SUCCESS;
@@ -2968,7 +2997,7 @@
 	ast_aji_send(client, request);
 	iks_filter_add_rule(client->f, aji_delete_node_list, client, IKS_RULE_TYPE,
 		IKS_PAK_IQ, IKS_RULE_SUBTYPE, IKS_TYPE_RESULT, IKS_RULE_ID, client->mid,
-		IKS_RULE_DONE);
+  		IKS_RULE_DONE);
 	res = ast_aji_send(client, request);
 	iks_delete(request);
 }
@@ -3106,7 +3135,8 @@
 static iks* aji_build_node_config(iks *pubsub, const char *node_type, const char *collection_name)
 {
 	iks *configure, *x, *field_owner, *field_node_type, *field_node_config,
-	*field_persist_items, *field_access_model, *field_pubsub_collection;
+	*field_deliver_payload, *field_persist_items, *field_access_model,
+	*field_pubsub_collection;
 	configure = iks_insert(pubsub, "configure");
 	x = iks_insert(configure, "x");
 	iks_insert_attrib(x, "xmlns", "jabber:x:data");
@@ -3126,6 +3156,9 @@
 	iks_insert_attrib(field_node_config, "type", "hidden");
 	iks_insert_cdata(iks_insert(field_node_config, "value"),
 		"http://jabber.org/protocol/pubsub#node_config", 45);
+	field_deliver_payload = iks_insert(x, "field");
+	iks_insert_attrib(field_deliver_payload, "var", "pubsub#deliver_payloads");
+	iks_insert_cdata(iks_insert(field_deliver_payload, "value"), "1", 1);
 	field_persist_items = iks_insert(x, "field");
 	iks_insert_attrib(field_persist_items, "var", "pubsub#persist_items");
 	iks_insert_cdata(iks_insert(field_persist_items, "value"), "1", 1);
@@ -3176,7 +3209,7 @@
 			ast_cli(a->fd, "Unable to find client '%s'!\n", name);
 			return CLI_FAILURE;
 		}
-
+		
 		ast_cli(a->fd, "Creating test PubSub node collection.\n");
 		aji_create_pubsub_collection(client, collection_name);
 		return CLI_SUCCESS;
@@ -3217,7 +3250,7 @@
 		ast_cli(a->fd, "Unable to find client '%s'!\n", name);
 		return CLI_FAILURE;
 	}
-
+		
 	ast_cli(a->fd, "Creating test PubSub node collection.\n");
 	aji_create_pubsub_leaf(client, collection_name, leaf_name);
 	return CLI_SUCCESS;
@@ -3903,7 +3936,7 @@
 				aji_init_event_distribution(iterator);
 			}
 		}
-
+	
 		ASTOBJ_UNLOCK(iterator);
 	});
 	




More information about the asterisk-commits mailing list