[asterisk-commits] eliel: branch eliel/data_api_providers_gsoc2010 r270077 - in /team/eliel/data...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sat Jun 12 13:51:08 CDT 2010
Author: eliel
Date: Sat Jun 12 13:51:04 2010
New Revision: 270077
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=270077
Log:
- Changed tree paths.
- Add voicemail status (urgent msg, new msg and old msgs).
Modified:
team/eliel/data_api_providers_gsoc2010/apps/app_meetme.c
team/eliel/data_api_providers_gsoc2010/apps/app_queue.c
team/eliel/data_api_providers_gsoc2010/apps/app_voicemail.c
team/eliel/data_api_providers_gsoc2010/channels/chan_iax2.c
team/eliel/data_api_providers_gsoc2010/channels/chan_sip.c
Modified: team/eliel/data_api_providers_gsoc2010/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/team/eliel/data_api_providers_gsoc2010/apps/app_meetme.c?view=diff&rev=270077&r1=270076&r2=270077
==============================================================================
--- team/eliel/data_api_providers_gsoc2010/apps/app_meetme.c (original)
+++ team/eliel/data_api_providers_gsoc2010/apps/app_meetme.c Sat Jun 12 13:51:04 2010
@@ -6802,7 +6802,7 @@
};
static const struct ast_data_entry meetme_data_providers[] = {
- AST_DATA_ENTRY("asterisk/application/app_meetme/list", &meetme_data_provider),
+ AST_DATA_ENTRY("asterisk/application/meetme/list", &meetme_data_provider),
};
#ifdef TEST_FRAMEWORK
@@ -6812,7 +6812,7 @@
struct ast_conference *cnf;
struct ast_data *node;
struct ast_data_query query = {
- .path = "/asterisk/application/app_meetme/list",
+ .path = "/asterisk/application/meetme/list",
.search = "list/meetme/confno=9898"
};
Modified: team/eliel/data_api_providers_gsoc2010/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/eliel/data_api_providers_gsoc2010/apps/app_queue.c?view=diff&rev=270077&r1=270076&r2=270077
==============================================================================
--- team/eliel/data_api_providers_gsoc2010/apps/app_queue.c (original)
+++ team/eliel/data_api_providers_gsoc2010/apps/app_queue.c Sat Jun 12 13:51:04 2010
@@ -7992,7 +7992,7 @@
};
static const struct ast_data_entry queue_data_providers[] = {
- AST_DATA_ENTRY("asterisk/application/app_queue/queues", &queues_data_provider),
+ AST_DATA_ENTRY("asterisk/application/queue/list", &queues_data_provider),
};
static int unload_module(void)
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=270077&r1=270076&r2=270077
==============================================================================
--- team/eliel/data_api_providers_gsoc2010/apps/app_voicemail.c (original)
+++ team/eliel/data_api_providers_gsoc2010/apps/app_voicemail.c Sat Jun 12 13:51:04 2010
@@ -10930,11 +10930,10 @@
struct ast_data *data_root, struct ast_vm_user *user)
{
struct ast_data *data_user, *data_zone;
-#ifdef IMAP_STORAGE
struct ast_data *data_state;
- struct vm_state *state;
-#endif
struct vm_zone *zone = NULL;
+ int urgentmsg = 0, newmsg = 0, oldmsg = 0;
+ char ext_context[256] = "";
data_user = ast_data_add_node(data_root, "user");
if (!data_user) {
@@ -10942,10 +10941,6 @@
}
ast_data_add_structure(ast_vm_user, data_user, user);
-
-#ifdef IMAP_STORAGE
- state = get_vm_state_by_mailbox(user->mailbox, user->context, 0);
-#endif
AST_LIST_LOCK(&zones);
AST_LIST_TRAVERSE(&zones, zone, list) {
@@ -10955,18 +10950,18 @@
}
AST_LIST_UNLOCK(&zones);
- /* TODO: Should a user's vm state be accessible without compiling in
- * IMAP support? */
-
-#ifdef IMAP_STORAGE
+ /* state */
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));
-#endif
+ snprintf(ext_context, sizeof(ext_context), "%s@%s", user->mailbox, user->context);
+ if (inboxcount2(ext_context, &urgentmsg, &newmsg, &oldmsg) < 0) {
+ ast_log(LOG_ERROR, "UPS UPS UPS ELIEL\n");
+ }
+ ast_data_add_int(data_state, "urgentmsg", urgentmsg);
+ ast_data_add_int(data_state, "newmsg", newmsg);
+ ast_data_add_int(data_state, "oldmsg", oldmsg);
if (zone) {
data_zone = ast_data_add_node(data_user, "zone");
@@ -10991,12 +10986,6 @@
}
AST_LIST_UNLOCK(&users);
- return 0;
-}
-
-static int vm_states_data_provider_get(const struct ast_data_search *search,
- struct ast_data *data_root)
-{
return 0;
}
@@ -11005,14 +10994,8 @@
.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/voicemail/users", &vm_users_data_provider),
- AST_DATA_ENTRY("asterisk/application/voicemail/states", &vm_states_data_provider)
+ AST_DATA_ENTRY("asterisk/application/voicemail/list", &vm_users_data_provider)
};
static void poll_subscribed_mailbox(struct mwi_sub *mwi_sub)
Modified: team/eliel/data_api_providers_gsoc2010/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/team/eliel/data_api_providers_gsoc2010/channels/chan_iax2.c?view=diff&rev=270077&r1=270076&r2=270077
==============================================================================
--- team/eliel/data_api_providers_gsoc2010/channels/chan_iax2.c (original)
+++ team/eliel/data_api_providers_gsoc2010/channels/chan_iax2.c Sat Jun 12 13:51:04 2010
@@ -13845,7 +13845,7 @@
AST_TEST_DEFINE(test_iax2_peers_get)
{
struct ast_data_query query = {
- .path = "/asterisk/channel/chan_iax2/peers",
+ .path = "/asterisk/channel/iax2/peers",
.search = "peers/peer/name=test_peer_data_provider"
};
struct ast_data *node;
@@ -13854,7 +13854,7 @@
switch (cmd) {
case TEST_INIT:
info->name = "iax2_peers_get_data_test";
- info->category = "main/data/chan_iax2/peers";
+ info->category = "main/data/iax2/peers";
info->summary = "IAX2 peers data providers unit test";
info->description =
"Tests whether the IAX2 peers data provider implementation works as expected.";
@@ -13905,7 +13905,7 @@
AST_TEST_DEFINE(test_iax2_users_get)
{
struct ast_data_query query = {
- .path = "/asterisk/channel/chan_iax2/users",
+ .path = "/asterisk/channel/iax2/users",
.search = "users/user/name=test_user_data_provider"
};
struct ast_data *node;
@@ -13914,7 +13914,7 @@
switch (cmd) {
case TEST_INIT:
info->name = "iax2_users_get_data_test";
- info->category = "main/data/chan_iax2/users";
+ info->category = "main/data/iax2/users";
info->summary = "IAX2 users data providers unit test";
info->description =
"Tests whether the IAX2 users data provider implementation works as expected.";
@@ -14315,8 +14315,8 @@
};
static const struct ast_data_entry iax2_data_providers[] = {
- AST_DATA_ENTRY("asterisk/channel/chan_iax2/peers", &peers_data_provider),
- AST_DATA_ENTRY("asterisk/channel/chan_iax2/users", &users_data_provider),
+ AST_DATA_ENTRY("asterisk/channel/iax2/peers", &peers_data_provider),
+ AST_DATA_ENTRY("asterisk/channel/iax2/users", &users_data_provider),
};
/*! \brief Load IAX2 module, load configuraiton ---*/
Modified: team/eliel/data_api_providers_gsoc2010/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/eliel/data_api_providers_gsoc2010/channels/chan_sip.c?view=diff&rev=270077&r1=270076&r2=270077
==============================================================================
--- team/eliel/data_api_providers_gsoc2010/channels/chan_sip.c (original)
+++ team/eliel/data_api_providers_gsoc2010/channels/chan_sip.c Sat Jun 12 13:51:04 2010
@@ -27532,14 +27532,14 @@
struct sip_peer *peer;
struct ast_data *node;
struct ast_data_query query = {
- .path = "/asterisk/channel/chan_sip/peers",
+ .path = "/asterisk/channel/sip/peers",
.search = "peers/peer/name=test_peer_data_provider"
};
switch (cmd) {
case TEST_INIT:
info->name = "sip_peers_get_data_test";
- info->category = "main/data/chan_sip/peers";
+ info->category = "main/data/sip/peers";
info->summary = "SIP peers data providers unit test";
info->description =
"Tests whether the SIP peers data provider implementation works as expected.";
@@ -27732,7 +27732,7 @@
};
static const struct ast_data_entry sip_data_providers[] = {
- AST_DATA_ENTRY("asterisk/channel/chan_sip/peers", &peers_data_provider),
+ AST_DATA_ENTRY("asterisk/channel/sip/peers", &peers_data_provider),
};
/*! \brief PBX load module - initialization */
More information about the asterisk-commits
mailing list