[Asterisk-cvs] asterisk manager.c,1.57,1.58

markster at lists.digium.com markster at lists.digium.com
Sat Jun 26 10:45:15 CDT 2004


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv17746

Modified Files:
	manager.c 
Log Message:
Merge cmaj's ZapDND and specific channel status manager commands (bugs #1917, 1918)


Index: manager.c
===================================================================
RCS file: /usr/cvsroot/asterisk/manager.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- manager.c	22 Jun 2004 18:48:59 -0000	1.57
+++ manager.c	26 Jun 2004 14:31:09 -0000	1.58
@@ -553,6 +553,7 @@
 static int action_status(struct mansession *s, struct message *m)
 {
 	char *id = astman_get_header(m,"ActionID");
+    	char *name = astman_get_header(m,"Channel");
 	char idText[256] = "";
 	struct ast_channel *c;
 	char bridge[256];
@@ -560,6 +561,19 @@
 	c = ast_channel_walk_locked(NULL);
         if (id && !ast_strlen_zero(id))
                 snprintf(idText,256,"ActionID: %s\r\n",id);
+	if (name && !ast_strlen_zero(name)) {
+		while (c) {
+			if (!strcasecmp(c->name, name)) {
+				break;
+			}
+			ast_mutex_unlock(&c->lock);
+			c = ast_channel_walk_locked(c);
+		}
+		if (!c) {
+			astman_send_error(s, m, "No such channel");
+			return 0;
+		}
+	}
 	while(c) {
 		if (c->bridge)
 			snprintf(bridge, sizeof(bridge), "Link: %s\r\n", c->bridge->name);
@@ -570,6 +584,7 @@
 			"Event: Status\r\n"
 			"Channel: %s\r\n"
 			"CallerID: %s\r\n"
+			"Account: %s\r\n"
 			"State: %s\r\n"
 			"Context: %s\r\n"
 			"Extension: %s\r\n"
@@ -579,6 +594,7 @@
 			"%s"
 			"\r\n",
 			c->name, c->callerid ? c->callerid : "<unknown>", 
+			c->accountcode,
 			ast_state2str(c->_state), c->context,
 			c->exten, c->priority, bridge, c->uniqueid, idText);
 		} else {
@@ -586,15 +602,20 @@
 			"Event: Status\r\n"
 			"Channel: %s\r\n"
 			"CallerID: %s\r\n"
+			"Account: %s\r\n"
 			"State: %s\r\n"
 			"%s"
 			"Uniqueid: %s\r\n"
 			"%s"
 			"\r\n",
 			c->name, c->callerid ? c->callerid : "<unknown>", 
+			c->accountcode,
 			ast_state2str(c->_state), bridge, c->uniqueid, idText);
 		}
 		ast_mutex_unlock(&c->lock);
+		if (name && !ast_strlen_zero(name)) {
+			break;
+		}
 		c = ast_channel_walk_locked(c);
 	}
 	ast_cli(s->fd,




More information about the svn-commits mailing list