[asterisk-commits] eliel: branch eliel/data_api_providers_gsoc2010 r273871 - in /team/eliel/data...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jul 3 16:29:55 CDT 2010


Author: eliel
Date: Sat Jul  3 16:29:49 2010
New Revision: 273871

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=273871
Log:
Fix all the comments given in the review board.


Modified:
    team/eliel/data_api_providers_gsoc2010/apps/app_meetme.c
    team/eliel/data_api_providers_gsoc2010/apps/app_voicemail.c
    team/eliel/data_api_providers_gsoc2010/channels/chan_agent.c
    team/eliel/data_api_providers_gsoc2010/channels/chan_dahdi.c
    team/eliel/data_api_providers_gsoc2010/channels/chan_iax2.c
    team/eliel/data_api_providers_gsoc2010/res/res_odbc.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=273871&r1=273870&r2=273871
==============================================================================
--- team/eliel/data_api_providers_gsoc2010/apps/app_meetme.c (original)
+++ team/eliel/data_api_providers_gsoc2010/apps/app_meetme.c Sat Jul  3 16:29:49 2010
@@ -6778,7 +6778,7 @@
 
 		if (!AST_LIST_EMPTY(&cnf->userlist)) {
 			data_meetme_users = ast_data_add_node(data_meetme, "users");
-			if (!data_meetme_user) {
+			if (!data_meetme_users) {
 				ast_data_remove_node(data_root, data_meetme);
 				continue;
 			}

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=273871&r1=273870&r2=273871
==============================================================================
--- team/eliel/data_api_providers_gsoc2010/apps/app_voicemail.c (original)
+++ team/eliel/data_api_providers_gsoc2010/apps/app_voicemail.c Sat Jul  3 16:29:49 2010
@@ -10912,9 +10912,7 @@
 		return -1;
 	}
 	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");
-	}
+	inboxcount2(ext_context, &urgentmsg, &newmsg, &oldmsg);
 	ast_data_add_int(data_state, "urgentmsg", urgentmsg);
 	ast_data_add_int(data_state, "newmsg", newmsg);
 	ast_data_add_int(data_state, "oldmsg", oldmsg);

Modified: team/eliel/data_api_providers_gsoc2010/channels/chan_agent.c
URL: http://svnview.digium.com/svn/asterisk/team/eliel/data_api_providers_gsoc2010/channels/chan_agent.c?view=diff&rev=273871&r1=273870&r2=273871
==============================================================================
--- team/eliel/data_api_providers_gsoc2010/channels/chan_agent.c (original)
+++ team/eliel/data_api_providers_gsoc2010/channels/chan_agent.c Sat Jul  3 16:29:49 2010
@@ -2335,7 +2335,7 @@
 	.read = function_agent,
 };
 
-/*!             
+/*!
  * \internal
  * \brief Callback used to generate the agents tree.
  * \param[in] search The search pattern tree.

Modified: team/eliel/data_api_providers_gsoc2010/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/eliel/data_api_providers_gsoc2010/channels/chan_dahdi.c?view=diff&rev=273871&r1=273870&r2=273871
==============================================================================
--- team/eliel/data_api_providers_gsoc2010/channels/chan_dahdi.c (original)
+++ team/eliel/data_api_providers_gsoc2010/channels/chan_dahdi.c Sat Jul  3 16:29:49 2010
@@ -17471,7 +17471,7 @@
 	return res;
 }
 
-/*!             
+/*!
  * \internal
  * \brief Callback used to generate the dahdi status tree.
  * \param[in] search The search pattern tree.
@@ -17482,8 +17482,7 @@
 		struct ast_data *data_root)
 {
 	int ctl, res, span;
-	struct ast_data *data_span;
-	char alarmstr[50];
+	struct ast_data *data_span, *data_alarms;
 	struct dahdi_spaninfo s;
 
 	ctl = open("/dev/dahdi/ctl", O_RDWR);
@@ -17497,39 +17496,26 @@
 		if (res) {
 			continue;
 		}
-		alarmstr[0] = '\0';
-		if (s.alarms > 0) {
-			if (s.alarms & DAHDI_ALARM_BLUE)
-				strcat(alarmstr, "BLU/");
-			if (s.alarms & DAHDI_ALARM_YELLOW)
-				strcat(alarmstr, "YEL/");
-			if (s.alarms & DAHDI_ALARM_RED)
-				strcat(alarmstr, "RED/");
-			if (s.alarms & DAHDI_ALARM_LOOPBACK)
-				strcat(alarmstr, "LB/");
-			if (s.alarms & DAHDI_ALARM_RECOVER)
-				strcat(alarmstr, "REC/");
-			if (s.alarms & DAHDI_ALARM_NOTOPEN)
-				strcat(alarmstr, "NOP/");
-			if (!strlen(alarmstr))
-				strcat(alarmstr, "UUU/");
-			if (strlen(alarmstr)) {
-				/* Strip trailing / */
-				alarmstr[strlen(alarmstr) - 1] = '\0';
-			}
-		} else {
-			if (s.numchans)
-				strcpy(alarmstr, "OK");
-			else    
-				strcpy(alarmstr, "UNCONFIGURED");
-		}
 
 		data_span = ast_data_add_node(data_root, "span");
 		if (!data_span) {
 			continue;
 		}
 		ast_data_add_str(data_span, "description", s.desc);
-		ast_data_add_str(data_span, "alarms", alarmstr);
+
+		/* insert the alarms status */
+		data_alarms = ast_data_add_node(data_span, "alarms");
+		if (!data_alarms) {
+			continue;
+		}
+
+		ast_data_add_bool(data_alarms, "BLUE", s.alarms & DAHDI_ALARM_BLUE);
+		ast_data_add_bool(data_alarms, "YELLOW", s.alarms & DAHDI_ALARM_YELLOW);
+		ast_data_add_bool(data_alarms, "RED", s.alarms & DAHDI_ALARM_RED);
+		ast_data_add_bool(data_alarms, "LOOPBACK", s.alarms & DAHDI_ALARM_LOOPBACK);
+		ast_data_add_bool(data_alarms, "RECOVER", s.alarms & DAHDI_ALARM_RECOVER);
+		ast_data_add_bool(data_alarms, "NOTOPEN", s.alarms & DAHDI_ALARM_NOTOPEN);
+
 		ast_data_add_int(data_span, "irqmisses", s.irqmisses);
 		ast_data_add_int(data_span, "bpviol", s.bpvcount);
 		ast_data_add_int(data_span, "crc4", s.crc4count);

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=273871&r1=273870&r2=273871
==============================================================================
--- team/eliel/data_api_providers_gsoc2010/channels/chan_iax2.c (original)
+++ team/eliel/data_api_providers_gsoc2010/channels/chan_iax2.c Sat Jul  3 16:29:49 2010
@@ -13940,11 +13940,13 @@
 	if (!user) {
 		return AST_TEST_FAIL;
 	}
-	user->amaflags = 1010; 
+	user->amaflags = 1010;
 	ao2_link(users, user);
 
 	node = ast_data_get(&query);
 	if (!node) {
+		ao2_unlink(users, user);
+		user_unref(user);
 		return AST_TEST_FAIL;
 	}
 

Modified: team/eliel/data_api_providers_gsoc2010/res/res_odbc.c
URL: http://svnview.digium.com/svn/asterisk/team/eliel/data_api_providers_gsoc2010/res/res_odbc.c?view=diff&rev=273871&r1=273870&r2=273871
==============================================================================
--- team/eliel/data_api_providers_gsoc2010/res/res_odbc.c (original)
+++ team/eliel/data_api_providers_gsoc2010/res/res_odbc.c Sat Jul  3 16:29:49 2010
@@ -1610,7 +1610,7 @@
 {
 	struct ao2_iterator aoi, aoi2;
 	struct odbc_class *class;
-	struct odbc_obj *current; 
+	struct odbc_obj *current;
 	struct ast_data *data_odbc_class, *data_odbc_connections, *data_odbc_connection;
 	struct ast_data *enum_node;
 	int count;




More information about the asterisk-commits mailing list