[asterisk-commits] eliel: branch eliel/data_api_providers_gsoc2010 r269931 - /team/eliel/data_ap...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 11 08:04:05 CDT 2010


Author: eliel
Date: Fri Jun 11 08:04:01 2010
New Revision: 269931

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=269931
Log:
Minor changes to the tree naming.


Modified:
    team/eliel/data_api_providers_gsoc2010/apps/app_voicemail.c

Modified: team/eliel/data_api_providers_gsoc2010/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/team/eliel/data_api_providers_gsoc2010/apps/app_voicemail.c?view=diff&rev=269931&r1=269930&r2=269931
==============================================================================
--- team/eliel/data_api_providers_gsoc2010/apps/app_voicemail.c (original)
+++ team/eliel/data_api_providers_gsoc2010/apps/app_voicemail.c Fri Jun 11 08:04:01 2010
@@ -10914,7 +10914,7 @@
  * \param[in] data_root The main result node.
  * \param[in] user The voicemail user.
  */
-static void vm_users_data_provider_get_helper(const struct ast_data_search *search,
+static int vm_users_data_provider_get_helper(const struct ast_data_search *search,
     struct ast_data *data_root, struct ast_vm_user *user)
 {
 	struct ast_data *data_user, *data_zone;
@@ -10926,7 +10926,7 @@
 
 	data_user = ast_data_add_node(data_root, "user");
 	if (!data_user) {
-		return;
+		return -1;
 	}
 
 	ast_data_add_structure(ast_vm_user, data_user, user);
@@ -10948,6 +10948,9 @@
 
 #ifdef IMAP_STORAGE
 	data_state = ast_data_add_node(data_user, "state");
+	if (!data_state) {
+		return -1;
+	}
 	ast_data_add_structure(vm_state, data_state, state);
 	ast_data_add_int(data_state, "deleted", *(state->deleted));
 	ast_data_add_int(data_state, "heard", *(state->heard));
@@ -10962,10 +10965,10 @@
 		ast_data_remove_node(data_root, data_user);
 	}
 
-	return;
-}
-
-static int vm_data_provider_get(const struct ast_data_search *search,
+	return 0;
+}
+
+static int vm_users_data_provider_get(const struct ast_data_search *search,
 	struct ast_data *data_root)
 {
 	struct ast_vm_user *user;
@@ -10979,13 +10982,25 @@
 	return 0;
 }
 
-static const struct ast_data_handler vm_data_provider = {
+static int vm_states_data_provider_get(const struct ast_data_search *search,
+	struct ast_data *data_root)
+{
+	return 0;
+}
+
+static const struct ast_data_handler vm_users_data_provider = {
 	.version = AST_DATA_HANDLER_VERSION,
-	.get = vm_data_provider_get
+	.get = vm_users_data_provider_get
 };
 
+static const struct ast_data_handler vm_states_data_provider = {
+	.version = AST_DATA_HANDLER_VERSION,
+	.get = vm_states_data_provider_get
+};
+
 static const struct ast_data_entry vm_data_providers[] = {
-	AST_DATA_ENTRY("asterisk/application/app_voicemail/voicemail", &vm_data_provider)
+	AST_DATA_ENTRY("asterisk/application/voicemail/users", &vm_users_data_provider),
+	AST_DATA_ENTRY("asterisk/application/voicemail/states", &vm_states_data_provider)
 };
 
 static void poll_subscribed_mailbox(struct mwi_sub *mwi_sub)




More information about the asterisk-commits mailing list