[asterisk-commits] rmudgett: branch rmudgett/aoc_event r258388 - in /team/rmudgett/aoc_event: ./...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Apr 21 15:06:45 CDT 2010


Author: rmudgett
Date: Wed Apr 21 15:06:42 2010
New Revision: 258388

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=258388
Log:
Merged revisions 258347 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/team/group/CCSS

................
  r258347 | root | 2010-04-21 14:17:44 -0500 (Wed, 21 Apr 2010) | 22 lines
  
  Merged revisions 258344-258345 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ........
    r258344 | lmadsen | 2010-04-21 14:02:45 -0500 (Wed, 21 Apr 2010) | 7 lines
    
    IAXpeers output now matches SIPpeers format for manager (AMI).
    
    (closes issue #17100)
    Reported by: secesh
    Tested by: pabelanger
    
    Review: https://reviewboard.asterisk.org/r/594/
  ........
    r258345 | mmichelson | 2010-04-21 14:07:25 -0500 (Wed, 21 Apr 2010) | 6 lines
    
    Add small documentation update to func_callcompletion.c.
    
    This directs users to documents which can help explain the
    concepts and configuration options settable with the function.
  ........
................

Modified:
    team/rmudgett/aoc_event/   (props changed)
    team/rmudgett/aoc_event/CHANGES
    team/rmudgett/aoc_event/UPGRADE.txt
    team/rmudgett/aoc_event/channels/chan_iax2.c
    team/rmudgett/aoc_event/funcs/func_callcompletion.c

Propchange: team/rmudgett/aoc_event/
------------------------------------------------------------------------------
--- aoc_event-integrated (original)
+++ aoc_event-integrated Wed Apr 21 15:06:42 2010
@@ -1,1 +1,1 @@
-/team/group/CCSS:1-258327
+/team/group/CCSS:1-258387

Propchange: team/rmudgett/aoc_event/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/rmudgett/aoc_event/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Apr 21 15:06:42 2010
@@ -1,1 +1,1 @@
-/trunk:1-258306
+/trunk:1-258346

Modified: team/rmudgett/aoc_event/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/aoc_event/CHANGES?view=diff&rev=258388&r1=258387&r2=258388
==============================================================================
--- team/rmudgett/aoc_event/CHANGES (original)
+++ team/rmudgett/aoc_event/CHANGES Wed Apr 21 15:06:42 2010
@@ -359,6 +359,8 @@
    status.
  * Added a "MixMonitorMute" AMI action for muting inbound and/or outbound audio
    in a MixMonitor recording.
+ * The 'iax2 show peers' output is now similar to the expected output of
+   'sip show peers'.
  * Added Advice-Of-Charge events (AOC-S, AOC-D, and AOC-E) in the new
    aoc event class.
 

Modified: team/rmudgett/aoc_event/UPGRADE.txt
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/aoc_event/UPGRADE.txt?view=diff&rev=258388&r1=258387&r2=258388
==============================================================================
--- team/rmudgett/aoc_event/UPGRADE.txt (original)
+++ team/rmudgett/aoc_event/UPGRADE.txt Wed Apr 21 15:06:42 2010
@@ -74,6 +74,9 @@
   OSPCALLING to OSPOUTCALLING
   OSPCALLED to OSPOUTCALLED
   OSPRESULTS to OSPDESTREMAILS
+
+* The Manager event 'iax2 show peers' output has been updated.  It now has a
+  similar output of 'sip show peers'.
 
 From 1.6.1 to 1.6.2:
 

Modified: team/rmudgett/aoc_event/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/aoc_event/channels/chan_iax2.c?view=diff&rev=258388&r1=258387&r2=258388
==============================================================================
--- team/rmudgett/aoc_event/channels/chan_iax2.c (original)
+++ team/rmudgett/aoc_event/channels/chan_iax2.c Wed Apr 21 15:06:42 2010
@@ -6422,7 +6422,7 @@
 #undef FORMAT2
 }
 
-static int __iax2_show_peers(int manager, int fd, struct mansession *s, const int argc, const char * const argv[])
+static int __iax2_show_peers(int fd, int *total, struct mansession *s, const int argc, const char * const argv[])
 {
 	regex_t regexbuf;
 	int havepattern = 0;
@@ -6432,18 +6432,17 @@
 	int unmonitored_peers = 0;
 	struct ao2_iterator i;
 
-#define FORMAT2 "%-15.15s  %-15.15s %s  %-15.15s  %-8s  %s %-10s%s"
-#define FORMAT "%-15.15s  %-15.15s %s  %-15.15s  %-5d%s  %s %-10s%s"
+#define FORMAT2 "%-15.15s  %-15.15s %s  %-15.15s  %-8s  %s %-10s\n"
+#define FORMAT "%-15.15s  %-15.15s %s  %-15.15s  %-5d%s  %s %-10s\n"
 
 	struct iax2_peer *peer = NULL;
 	char name[256];
 	struct ast_str *encmethods = ast_str_alloca(256);
 	int registeredonly=0;
-	char *term = manager ? "\r\n" : "\n";
 	char idtext[256] = "";
 	switch (argc) {
 	case 6:
- 		if (!strcasecmp(argv[3], "registered"))
+		if (!strcasecmp(argv[3], "registered"))
 			registeredonly = 1;
 		else
 			return RESULT_SHOWUSAGE;
@@ -6476,10 +6475,10 @@
 
 
 	if (!s)
-		ast_cli(fd, FORMAT2, "Name/Username", "Host", "   ", "Mask", "Port", "   ", "Status", term);
+		ast_cli(fd, FORMAT2, "Name/Username", "Host", "   ", "Mask", "Port", "   ", "Status");
 
 	i = ao2_iterator_init(peers, 0);
-	for (peer = ao2_iterator_next(&i); peer; 
+	for (peer = ao2_iterator_next(&i); peer;
 		peer_unref(peer), peer = ao2_iterator_next(&i)) {
 		char nm[20];
 		char status[20];
@@ -6534,18 +6533,21 @@
 				ntohs(peer->addr.sin_port),
 				ast_test_flag64(peer, IAX_TRUNK) ? "(T)" : "   ",
 				peer->encmethods ? "(E)" : "   ",
-				status,
-				term);
+				status);
 		}
 		total_peers++;
 	}
 	ao2_iterator_destroy(&i);
 
 	if (!s)
-		ast_cli(fd,"%d iax2 peers [%d online, %d offline, %d unmonitored]%s", total_peers, online_peers, offline_peers, unmonitored_peers, term);
+		ast_cli(fd,"%d iax2 peers [%d online, %d offline, %d unmonitored]\n",
+			total_peers, online_peers, offline_peers, unmonitored_peers);
 
 	if (havepattern)
 		regfree(&regexbuf);
+
+	if (total)
+		*total = total_peers;
 
 	return RESULT_SUCCESS;
 #undef FORMAT
@@ -6704,7 +6706,7 @@
 		return NULL;
 	}
 
-	switch (__iax2_show_peers(0, a->fd, NULL, a->argc, a->argv)) {
+	switch (__iax2_show_peers(a->fd, NULL, NULL, a->argc, a->argv)) {
 	case RESULT_SHOWUSAGE:
 		return CLI_SHOWUSAGE;
 	case RESULT_FAILURE:
@@ -6758,12 +6760,23 @@
 	static const char * const a[] = { "iax2", "show", "peers" };
 	const char *id = astman_get_header(m,"ActionID");
 	char idtext[256] = "";
+	int total = 0;
 
 	if (!ast_strlen_zero(id))
 		snprintf(idtext, sizeof(idtext), "ActionID: %s\r\n", id);
-	astman_send_ack(s, m, "Peer status list will follow");
-	return __iax2_show_peers(1, -1, s, 3, a);
-} 
+
+	astman_send_listack(s, m, "Peer status list will follow", "start");
+        /* List the peers in separate manager events */
+	__iax2_show_peers(-1, &total, s, 3, a);
+        /* Send final confirmation */
+        astman_append(s,
+        "Event: PeerlistComplete\r\n"
+        "EventList: Complete\r\n"
+        "ListItems: %d\r\n"
+        "%s"
+        "\r\n", total, idtext);
+        return 0;
+}
 
 /*! \brief callback to display iax peers in manager format */
 static int manager_iax2_show_peer_list(struct mansession *s, const struct message *m)

Modified: team/rmudgett/aoc_event/funcs/func_callcompletion.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/aoc_event/funcs/func_callcompletion.c?view=diff&rev=258388&r1=258387&r2=258388
==============================================================================
--- team/rmudgett/aoc_event/funcs/func_callcompletion.c (original)
+++ team/rmudgett/aoc_event/funcs/func_callcompletion.c Wed Apr 21 15:06:42 2010
@@ -56,7 +56,10 @@
 			<para>The CALLCOMPLETION function can be used to get or set a call
 			completion configuration parameter for a channel. Note that setting
 			a configuration parameter will only change the parameter for the
-			duration of the call.</para>
+			duration of the call.
+			
+			For more information on call completion in Asterisk, see <filename>doc/tex/ccss.tex</filename>.
+			For more information on call completion parameters, see <filename>configs/ccss.conf.sample</filename>.</para>
 		</description>
 	</function>
  ***/




More information about the asterisk-commits mailing list