[asterisk-commits] mjordan: branch mjordan/manager-events r368638 - in /team/mjordan/manager-eve...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 6 15:03:24 CDT 2012


Author: mjordan
Date: Wed Jun  6 15:03:20 2012
New Revision: 368638

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=368638
Log:
Changes from the previous night

Working on getting includes to be handled in the get_documentation
script.

Modified:
    team/mjordan/manager-events/apps/app_chanspy.c
    team/mjordan/manager-events/apps/app_confbridge.c
    team/mjordan/manager-events/apps/app_meetme.c
    team/mjordan/manager-events/apps/app_queue.c
    team/mjordan/manager-events/build_tools/get_documentation.py
    team/mjordan/manager-events/doc/appdocsxml.dtd

Modified: team/mjordan/manager-events/apps/app_chanspy.c
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/manager-events/apps/app_chanspy.c?view=diff&rev=368638&r1=368637&r2=368638
==============================================================================
--- team/mjordan/manager-events/apps/app_chanspy.c (original)
+++ team/mjordan/manager-events/apps/app_chanspy.c Wed Jun  6 15:03:20 2012
@@ -545,6 +545,7 @@
 			<see-also>
 				<ref type="application">ChanSpy</ref>
 				<ref type="application">ExtenSpy</ref>
+				<ref type="managerEvent">ChanSpyStop</ref>
 			</see-also>
 		</managerEventInstance>
 	***/
@@ -739,6 +740,9 @@
 	/*** DOCUMENTATION
 		<managerEventInstance>
 			<synopsis>Raised when a channel has stopped spying on another channel.</synopsis>
+			<see-also>
+				<ref type="managerEvent">ChanSpyStart</ref>
+			</see-also>
 		</managerEventInstance>
 	***/
 	ast_manager_event(chan, EVENT_FLAG_CALL, "ChanSpyStop", "SpyeeChannel: %s\r\n", name);

Modified: team/mjordan/manager-events/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/manager-events/apps/app_confbridge.c?view=diff&rev=368638&r1=368637&r2=368638
==============================================================================
--- team/mjordan/manager-events/apps/app_confbridge.c (original)
+++ team/mjordan/manager-events/apps/app_confbridge.c Wed Jun  6 15:03:20 2012
@@ -529,24 +529,49 @@
 
 static void send_conf_start_event(const char *conf_name)
 {
-	manager_event(EVENT_FLAG_CALL, "ConfbridgeStart", "Conference: %s\r\n", conf_name);
-}
-
-static void send_conf_end_event(const char *conf_name)
-{
-	manager_event(EVENT_FLAG_CALL, "ConfbridgeEnd", "Conference: %s\r\n", conf_name);
-}
-
-static void send_join_event(struct ast_channel *chan, const char *conf_name)
-{
 	/*** DOCUMENTATION
 		<managerEventInstance>
-			<synopsis>Raised when a channel joins a Confbridge conference.</synopsis>
+			<synopsis>Raised when a conference starts.</synopsis>
 			<syntax>
 				<parameter name="Conference">
 					<para>The name of the Confbridge conference.</para>
 				</parameter>
 			</syntax>
+			<see-also>
+				<ref type="managerEvent">ConfbridgeEnd</ref>
+			</see-also>
+		</managerEventInstance>
+	***/
+	manager_event(EVENT_FLAG_CALL, "ConfbridgeStart", "Conference: %s\r\n", conf_name);
+}
+
+static void send_conf_end_event(const char *conf_name)
+{
+	/*** DOCUMENTATION
+		<managerEventInstance>
+			<synopsis>Raised when a conference ends.</synopsis>
+			<syntax>
+				<xi:include xpointer="xpointer(/docs/managerEvent[@name='ConfbridgeStart']/managerEventInstance/syntax/parameter[@name='Conference'])" />
+			</syntax>
+			<see-also>
+				<ref type="managerEvent">ConfbridgeStart</ref>
+			</see-also>
+		</managerEventInstance>
+	***/
+	manager_event(EVENT_FLAG_CALL, "ConfbridgeEnd", "Conference: %s\r\n", conf_name);
+}
+
+static void send_join_event(struct ast_channel *chan, const char *conf_name)
+{
+	/*** DOCUMENTATION
+		<managerEventInstance>
+			<synopsis>Raised when a channel joins a Confbridge conference.</synopsis>
+			<parameter name="Conference">
+				<para>The name of the Confbridge conference.</para>
+			</parameter>
+			<see-also>
+				<ref type="managerEvent">ConfbridgeLeave</ref>
+			</see-also>
 		</managerEventInstance>
 	***/
 	ast_manager_event(chan, EVENT_FLAG_CALL, "ConfbridgeJoin",
@@ -568,11 +593,12 @@
 	/*** DOCUMENTATION
 		<managerEventInstance>
 			<synopsis>Raised when a channel leaves a Confbridge conference.</synopsis>
-			<syntax>
-				<parameter name="Conference">
-					<para>The name of the Confbridge conference.</para>
-				</parameter>
-			</syntax>
+			<parameter name="Conference">
+				<para>The name of the Confbridge conference.</para>
+			</parameter>
+			<see-also>
+				<ref type="managerEvent">ConfbridgeJoin</ref>
+			</see-also>
 		</managerEventInstance>
 	***/
 	ast_manager_event(chan, EVENT_FLAG_CALL, "ConfbridgeLeave",

Modified: team/mjordan/manager-events/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/manager-events/apps/app_meetme.c?view=diff&rev=368638&r1=368637&r2=368638
==============================================================================
--- team/mjordan/manager-events/apps/app_meetme.c (original)
+++ team/mjordan/manager-events/apps/app_meetme.c Wed Jun  6 15:03:20 2012
@@ -1845,6 +1845,14 @@
 	struct announce_listitem *item;
 	
 	AST_LIST_REMOVE(&confs, conf, list);
+	/*** DOCUMENTATION
+		<managerEventInstance>
+			<synopsis>Raised when a MeetMe conference ends.</synopsis>
+			<parameter name="Meetme">
+				<para>The identifier for the Meetme conference.</para>
+			</parameter>
+		</managerEventInstance>
+	***/
 	manager_event(EVENT_FLAG_CALL, "MeetmeEnd", "Meetme: %s\r\n", conf->confno);
 
 	if (conf->recording == MEETME_RECORD_ACTIVE) {
@@ -2179,13 +2187,34 @@
 
 static void send_talking_event(struct ast_channel *chan, struct ast_conference *conf, struct ast_conf_user *user, int talking)
 {
+	/*** DOCUMENTATION
+		<managerEventInstance>
+			<synopsis>Raised when a MeetMe user begins or ends talking.</synopsis>
+			<syntax>
+				<parameter name="Meetme">
+					<para>The identifier for the MeetMe conference.</para>
+				</parameter>
+				<parameter name="Usernum">
+					<para>The identifier of the MeetMe user who started or ended talking.</para>
+				</parameter>
+				<parameter name="Status">
+					<enumlist>
+						<enum name="on"/>
+						<enum name="off"/>
+					</enumlist>
+				</parameter>
+			</syntax>
+		</managerEventInstance>
+	***/
 	ast_manager_event(chan, EVENT_FLAG_CALL, "MeetmeTalking",
 		"Channel: %s\r\n"
 		"Uniqueid: %s\r\n"
 		"Meetme: %s\r\n"
 		"Usernum: %d\r\n"
 		"Status: %s\r\n",
-		ast_channel_name(chan), ast_channel_uniqueid(chan), conf->confno, user->user_no, talking ? "on" : "off");
+		ast_channel_name(chan), ast_channel_uniqueid(chan),
+		conf->confno,
+		user->user_no, talking ? "on" : "off");
 }
 
 static void set_user_talking(struct ast_channel *chan, struct ast_conference *conf, struct ast_conf_user *user, int talking, int monitor)
@@ -2777,6 +2806,22 @@
 	ast_debug(1, "Placed channel %s in DAHDI conf %d\n", ast_channel_name(chan), conf->dahdiconf);
 
 	if (!sent_event) {
+		/*** DOCUMENTATION
+			<managerEventInstance>
+				<synopsis>Raised when a user joins a MeetMe conference.</synopsis>
+				<syntax>
+					<parameter name="Meetme">
+						<para>The identifier for the MeetMe conference.</para>
+					</parameter>
+					<parameter name="Usernum">
+						<para>The identifier of the MeetMe user who joined.</para>
+					</parameter>
+				</syntax>
+				<see-also>
+					<ref type="managerEvent">MeetmeLeave</ref>
+				</see-also>
+			</managerEventInstance>
+		***/
 		ast_manager_event(chan, EVENT_FLAG_CALL, "MeetmeJoin",
 			"Channel: %s\r\n"
 			"Uniqueid: %s\r\n"
@@ -3142,7 +3187,25 @@
 				if (ast_test_flag64(confflags,  (CONFFLAG_MONITORTALKER | CONFFLAG_OPTIMIZETALKER))) {
 					set_user_talking(chan, conf, user, -1, ast_test_flag64(confflags, CONFFLAG_MONITORTALKER));
 				}
-
+				/*** DOCUMENTATION
+				<managerEventInstance>
+					<synopsis>Raised when a MeetMe user is muted.</synopsis>
+					<syntax>
+						<parameter name="Meetme">
+							<para>The identifier for the MeetMe conference.</para>
+						</parameter>
+						<parameter name="Usernum">
+							<para>The identifier of the MeetMe user who joined.</para>
+						</parameter>
+						<parameter name="Status">
+							<enumlist>
+								<enum name="on"/>
+								<enum name="off"/>
+							</enumlist>
+						</parameter>
+					</syntax>
+				</managerEventInstance>
+				***/
 				ast_manager_event(chan, EVENT_FLAG_CALL, "MeetmeMute",
 					"Channel: %s\r\n"
 					"Uniqueid: %s\r\n"
@@ -3160,7 +3223,11 @@
 					ret = -1;
 					break;
 				}
-
+				/*** DOCUMENTATION
+				<managerEventInstance>
+					<synopsis>Raised when a MeetMe user is unmuted.</synopsis>
+				</managerEventInstance>
+				***/
 				ast_manager_event(chan, EVENT_FLAG_CALL, "MeetmeMute",
 					"Channel: %s\r\n"
 					"Uniqueid: %s\r\n"
@@ -3174,6 +3241,25 @@
 				(user->adminflags & ADMINFLAG_T_REQUEST) && !(talkreq_manager)) {
 				talkreq_manager = 1;
 
+				/*** DOCUMENTATION
+				<managerEventInstance>
+					<synopsis>Raised when a MeetMe user has started talking.</synopsis>
+					<syntax>
+						<parameter name="Meetme">
+							<para>The identifier for the MeetMe conference.</para>
+						</parameter>
+						<parameter name="Usernum">
+							<para>The identifier of the MeetMe user who joined.</para>
+						</parameter>
+						<parameter name="Status">
+							<enumlist>
+								<enum name="on"/>
+								<enum name="off"/>
+							</enumlist>
+						</parameter>
+					</syntax>
+				</managerEventInstance>
+				***/
 				ast_manager_event(chan, EVENT_FLAG_CALL, "MeetmeTalkRequest",
 					"Channel: %s\r\n"
 					"Uniqueid: %s\r\n"
@@ -3183,10 +3269,14 @@
 					ast_channel_name(chan), ast_channel_uniqueid(chan), conf->confno, user->user_no);
 			}
 
-			
 			if (!(user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) && 
 				!(user->adminflags & ADMINFLAG_T_REQUEST) && (talkreq_manager)) {
 				talkreq_manager = 0;
+				/*** DOCUMENTATION
+				<managerEventInstance>
+					<synopsis>Raised when a MeetMe user has finished talking.</synopsis>
+				</managerEventInstance>
+				***/
 				ast_manager_event(chan, EVENT_FLAG_CALL, "MeetmeTalkRequest",
 					"Channel: %s\r\n"
 					"Uniqueid: %s\r\n"
@@ -3850,6 +3940,25 @@
 		now = ast_tvnow();
 
 		if (sent_event) {
+			/*** DOCUMENTATION
+			<managerEventInstance>
+				<synopsis>Raised when a user leaves a MeetMe conference.</synopsis>
+				<syntax>
+					<parameter name="Meetme">
+						<para>The identifier for the MeetMe conference.</para>
+					</parameter>
+					<parameter name="Usernum">
+						<para>The identifier of the MeetMe user who joined.</para>
+					</parameter>
+					<parameter name="Duration">
+						<para>The length of time in seconds that the Meetme user was in the conference.</para>
+					</parameter>
+				</syntax>
+				<see-also>
+					<ref type="managerEvent">MeetmeJoin</ref>
+				</see-also>
+			</managerEventInstance>
+			***/
 			ast_manager_event(chan, EVENT_FLAG_CALL, "MeetmeLeave",
 				"Channel: %s\r\n"
 				"Uniqueid: %s\r\n"

Modified: team/mjordan/manager-events/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/manager-events/apps/app_queue.c?view=diff&rev=368638&r1=368637&r2=368638
==============================================================================
--- team/mjordan/manager-events/apps/app_queue.c (original)
+++ team/mjordan/manager-events/apps/app_queue.c Wed Jun  6 15:03:20 2012
@@ -1579,6 +1579,11 @@
 		return 0;
 	}
 
+	/*** DOCUMENTATION
+	<managerEventInstance>
+		<synopsis>Raised when a Queue member's status has changed.</synopsis>
+	</managerEventInstance>
+	***/
 	manager_event(EVENT_FLAG_AGENT, "QueueMemberStatus",
 		"Queue: %s\r\n"
 		"Location: %s\r\n"
@@ -2740,6 +2745,14 @@
 		ast_copy_string(qe->context, q->context, sizeof(qe->context));
 		q->count++;
 		res = 0;
+		/*** DOCUMENTATION
+		<managerEventInstance>
+			<synopsis>Raised when a channel joins a Queue.</synopsis>
+			<see-also>
+				<ref type="managerEvent">Leave</ref>
+			</see-also>
+		</managerEventInstance>
+		***/
 		ast_manager_event(qe->chan, EVENT_FLAG_CALL, "Join",
 			"Channel: %s\r\n"
 			"CallerIDNum: %s\r\n"
@@ -3027,6 +3040,14 @@
 			q->count--;
 
 			/* Take us out of the queue */
+			/*** DOCUMENTATION
+			<managerEventInstance>
+				<synopsis>Raised when a channel leaves a Queue.</synopsis>
+				<see-also>
+					<ref type="managerEvent">Join</ref>
+				</see-also>
+			</managerEventInstance>
+			***/
 			ast_manager_event(qe->chan, EVENT_FLAG_CALL, "Leave",
 				"Channel: %s\r\nQueue: %s\r\nCount: %d\r\nPosition: %d\r\nUniqueid: %s\r\n",
 				ast_channel_name(qe->chan), q->name,  q->count, qe->pos, ast_channel_uniqueid(qe->chan));

Modified: team/mjordan/manager-events/build_tools/get_documentation.py
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/manager-events/build_tools/get_documentation.py?view=diff&rev=368638&r1=368637&r2=368638
==============================================================================
--- team/mjordan/manager-events/build_tools/get_documentation.py (original)
+++ team/mjordan/manager-events/build_tools/get_documentation.py Wed Jun  6 15:03:20 2012
@@ -13,6 +13,15 @@
 import xml.dom.minidom
 
 from xml.dom.minidom import Element
+
+def get_manager_event_method_type(candidate_string):
+    if "ast_manager_event_multichan" in candidate_string:
+        return "multichan"
+    elif "ast_manager_event" in candidate_string:
+        return "ast_manager_event"
+    elif "manager_event" in candidate_string:
+        return "manager_event"
+    return ""
 
 def parse_manager_event_instance(xml_fragment):
     ''' Parse the information for a manager event
@@ -33,18 +42,14 @@
     while (True):
         line = sys.stdin.readline()
         line = line.strip()
-        candidate_lines.append(line)
+        if line:
+            candidate_lines.append(line)
         if ");" in line:
             break;
 
     candidate_string = ''.join(candidate_lines)
-    if "ast_manager_event_multichan" in candidate_string:
-        type = "multichan"
-    elif "ast_manager_event" in candidate_string:
-        type = "ast_manager_event"
-    elif "manager_event" in candidate_string:
-        type = "manager_event"
-    else:
+    type = get_manager_event_method_type(candidate_string)
+    if not type:
         # Unknown, return what we have
         return ''.join(xml_fragment)
 
@@ -75,13 +80,22 @@
     xml_fragment[1] = "<managerEventInstance class=\"%s\">" % (class_level)
     xml_fragment.insert(len(xml_fragment), "</managerEvent>")
 
+    # Turn the XML into a DOM to manage the rest of the node manipulations
     dom = xml.dom.minidom.parseString(''.join(xml_fragment))
+    el = dom.createElementNS('http://www.w3.org/2001/XInclude', 'xi')
+    el.setAttribute('xmlns', 'http://www.w3.org/2001/XInclude')
+    dom.appendChild(el)
 
+    # Get the syntax node if we have one; otherwise make one
     instance = dom.getElementsByTagName("managerEventInstance")[0]
     syntax = instance.getElementsByTagName("syntax")
     if not syntax:
         syntax = dom.createElement("syntax")
         instance.appendChild(syntax)
+        # Move any existing parameter nodes over
+        for node in instance.getElementsByTagName("parameter"):
+            syntax.appendChild(node.cloneNode(True))
+            instance.removeChild(node)
     else:
         syntax = syntax[0]
 

Modified: team/mjordan/manager-events/doc/appdocsxml.dtd
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/manager-events/doc/appdocsxml.dtd?view=diff&rev=368638&r1=368637&r2=368638
==============================================================================
--- team/mjordan/manager-events/doc/appdocsxml.dtd (original)
+++ team/mjordan/manager-events/doc/appdocsxml.dtd Wed Jun  6 15:03:20 2012
@@ -39,7 +39,7 @@
   <!ELEMENT see-also (ref|xi:include)*>
 
   <!ELEMENT ref (#PCDATA)>
-  <!ATTLIST ref type (application|function|astcli|link|manpage|filename|agi) #REQUIRED>
+  <!ATTLIST ref type (application|function|astcli|link|manpage|filename|agi|managerEvent) #REQUIRED>
 
   <!ELEMENT synopsis (#PCDATA)>
 




More information about the asterisk-commits mailing list