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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jun 12 12:25:17 CDT 2010


Author: eliel
Date: Sat Jun 12 12:25:12 2010
New Revision: 270076

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=270076
Log:
Enum nodes now have a different structure in the tree with two internal nodes:
text and value.


Modified:
    team/eliel/data_api_providers_gsoc2010/apps/app_queue.c
    team/eliel/data_api_providers_gsoc2010/channels/chan_sip.c
    team/eliel/data_api_providers_gsoc2010/main/channel.c

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=270076&r1=270075&r2=270076
==============================================================================
--- team/eliel/data_api_providers_gsoc2010/apps/app_queue.c (original)
+++ team/eliel/data_api_providers_gsoc2010/apps/app_queue.c Sat Jun 12 12:25:12 2010
@@ -7753,7 +7753,7 @@
 	MEMBER(call_queue, sound_reporthold, AST_DATA_STRING)		\
 	MEMBER(call_queue, dead, AST_DATA_BOOLEAN)			\
 	MEMBER(call_queue, eventwhencalled, AST_DATA_BOOLEAN)		\
-	MEMBER(call_queue, ringinuse, AST_DATA_INTEGER)			\
+	MEMBER(call_queue, ringinuse, AST_DATA_BOOLEAN)			\
 	MEMBER(call_queue, setinterfacevar, AST_DATA_BOOLEAN)		\
 	MEMBER(call_queue, setqueuevar, AST_DATA_BOOLEAN)		\
 	MEMBER(call_queue, setqueueentryvar, AST_DATA_BOOLEAN)		\
@@ -7761,7 +7761,6 @@
 	MEMBER(call_queue, wrapped, AST_DATA_BOOLEAN)			\
 	MEMBER(call_queue, timeoutrestart, AST_DATA_BOOLEAN)		\
 	MEMBER(call_queue, announceholdtime, AST_DATA_INTEGER)		\
-	MEMBER(call_queue, announceposition, AST_DATA_INTEGER)		\
 	MEMBER(call_queue, strategy, AST_DATA_INTEGER)			\
 	MEMBER(call_queue, maskmemberstatus, AST_DATA_BOOLEAN)		\
 	MEMBER(call_queue, realtime, AST_DATA_BOOLEAN)			\
@@ -7850,7 +7849,7 @@
 	struct ao2_iterator im;
 	struct member *member;
 	struct queue_ent *qe;
-	struct ast_data *data_queue, *data_members = NULL;
+	struct ast_data *data_queue, *data_members = NULL, *enum_node;
 	struct ast_data *data_member, *data_callers = NULL, *data_caller, *data_caller_channel;
 
 	data_queue = ast_data_add_node(data_root, "queue");
@@ -7859,6 +7858,30 @@
 	}
 
 	ast_data_add_structure(call_queue, data_queue, queue);
+
+	/* announce position */
+	enum_node = ast_data_add_node(data_queue, "announceposition");
+	if (!enum_node) {
+		return;
+	}
+	switch (queue->announceposition) {
+	case ANNOUNCEPOSITION_LIMIT:
+		ast_data_add_str(enum_node, "text", "limit");
+		break;
+	case ANNOUNCEPOSITION_MORE_THAN:
+		ast_data_add_str(enum_node, "text", "more");
+		break;
+	case ANNOUNCEPOSITION_YES:
+		ast_data_add_str(enum_node, "text", "yes");
+		break;
+	case ANNOUNCEPOSITION_NO:
+		ast_data_add_str(enum_node, "text", "no");
+		break;
+	default:
+		ast_data_add_str(enum_node, "text", "unknown");
+		break;
+	}
+	ast_data_add_int(enum_node, "value", queue->announceposition);
 
 	/* add queue members */
 	im = ao2_iterator_init(queue->members, 0);

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=270076&r1=270075&r2=270076
==============================================================================
--- team/eliel/data_api_providers_gsoc2010/channels/chan_sip.c (original)
+++ team/eliel/data_api_providers_gsoc2010/channels/chan_sip.c Sat Jun 12 12:25:12 2010
@@ -27634,7 +27634,6 @@
 	MEMBER(sip_peer, onHold, AST_DATA_INTEGER)		\
 	MEMBER(sip_peer, call_limit, AST_DATA_INTEGER)		\
 	MEMBER(sip_peer, t38_maxdatagram, AST_DATA_INTEGER)	\
-	MEMBER(sip_peer, allowtransfer, AST_DATA_INTEGER)	\
 	MEMBER(sip_peer, lastmsgssent, AST_DATA_INTEGER)	\
 	MEMBER(sip_peer, sipoptions, AST_DATA_INTEGER)		\
 	MEMBER(sip_peer, maxcallbitrate, AST_DATA_INTEGER)	\
@@ -27656,7 +27655,7 @@
 {
 	struct sip_peer *peer;
 	struct ao2_iterator i;
-	struct ast_data *data_peer, *data_peer_mailboxes = NULL, *data_peer_mailbox;
+	struct ast_data *data_peer, *data_peer_mailboxes = NULL, *data_peer_mailbox, *enum_node;
 	int total_mailboxes;
 	struct sip_mailbox *mailbox;
 
@@ -27672,6 +27671,14 @@
 		}
 
 		ast_data_add_structure(sip_peer, data_peer, peer);
+
+		/* transfer mode */
+		enum_node = ast_data_add_node(data_peer, "allowtransfer");
+		if (!enum_node) {
+			continue;
+		}
+		ast_data_add_str(enum_node, "text", transfermode2str(peer->allowtransfer));
+		ast_data_add_int(enum_node, "value", peer->allowtransfer);
 
 		/* transports */
 		ast_data_add_str(data_peer, "transports", get_transport_list(peer->transports));

Modified: team/eliel/data_api_providers_gsoc2010/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/eliel/data_api_providers_gsoc2010/main/channel.c?view=diff&rev=270076&r1=270075&r2=270076
==============================================================================
--- team/eliel/data_api_providers_gsoc2010/main/channel.c (original)
+++ team/eliel/data_api_providers_gsoc2010/main/channel.c Sat Jun 12 12:25:12 2010
@@ -289,7 +289,7 @@
 {
 	struct ast_channel *bc;
 	struct ast_data *data_bridged, *data_cdr, *data_flags, *data_zones;
-	struct ast_data *data_callerid;
+	struct ast_data *data_callerid, *enum_node;
 
 	if (!tree) {
 		return -1;
@@ -315,9 +315,19 @@
 	ast_data_add_codecs(tree, "rawreadformat", chan->rawreadformat);
 	ast_data_add_codecs(tree, "rawwriteformat", chan->rawwriteformat);
 
-	ast_data_add_str(tree, "state", ast_state2str(chan->_state));
-
-	ast_data_add_str(tree, "hangupcause", ast_cause2str(chan->hangupcause));
+	enum_node = ast_data_add_node(tree, "state");
+	if (!enum_node) {
+		return -1;
+	}
+	ast_data_add_str(enum_node, "text", ast_state2str(chan->_state));
+	ast_data_add_int(enum_node, "value", chan->_state);
+
+	enum_node = ast_data_add_node(tree, "hangupcause");
+	if (!enum_node) {
+		return -1;
+	}
+	ast_data_add_str(enum_node, "text", ast_cause2str(chan->hangupcause));
+	ast_data_add_int(enum_node, "value", chan->hangupcause);
 
 	/* channel flags */
 	data_flags = ast_data_add_node(tree, "flags");




More information about the asterisk-commits mailing list