[asterisk-commits] oej: branch oej/moremanager r61801 - in /team/oej/moremanager: ./ apps/ chann...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Apr 25 09:26:53 MST 2007


Author: oej
Date: Wed Apr 25 11:26:52 2007
New Revision: 61801

URL: http://svn.digium.com/view/asterisk?view=rev&rev=61801
Log:
Many updates and changes. See
http://svn.digium.com/view/asterisk/team/oej/moremanager/CHANGES.moremanager


Modified:
    team/oej/moremanager/CHANGES.moremanager
    team/oej/moremanager/apps/app_meetme.c
    team/oej/moremanager/channels/chan_iax2.c
    team/oej/moremanager/channels/chan_sip.c
    team/oej/moremanager/include/asterisk.h
    team/oej/moremanager/include/asterisk/manager.h
    team/oej/moremanager/main/asterisk.c
    team/oej/moremanager/main/loader.c
    team/oej/moremanager/main/manager.c
    team/oej/moremanager/res/res_features.c
    team/oej/moremanager/res/res_jabber.c

Modified: team/oej/moremanager/CHANGES.moremanager
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/CHANGES.moremanager?view=diff&rev=61801&r1=61800&r2=61801
==============================================================================
--- team/oej/moremanager/CHANGES.moremanager (original)
+++ team/oej/moremanager/CHANGES.moremanager Wed Apr 25 11:26:52 2007
@@ -1,20 +1,45 @@
-* CHANGED EVENTS
-----------------
+* SYNTAX CLEANUPS
+-----------------
 
-- Manager events Newstate and Newchannel have changed headers
+- Response: headers are now either
+	"Success"	- Action OK, this message contains response
+	"Error"		- Action failed, reason in Message: header
+	"Follows"	- Action OK, response follows in following Events.
+
+- Manager version changed to 1.1
+
+* CHANGED EVENTS AND ACTIONS
+----------------------------
+- The Ping Action
+	- Now use Response: success
+	- New header "Ping: pong" :-)
+
+- The Events action
+	- Now use Response: Success
+	- The new status is reported as "Events: On" or "Events: Off"
+
+- The JabberSend action
+	- The Response: header is now the first header in the response
+	- now sends "Response: Error" instead of "Failure"
+
+- Newstate and Newchannel events
+	- these have changed headers
 	"State"		-> ChannelStateDesc	Text based channel state
 			-> ChannelState		Numeric channel state
 	- The events does not send "<unknown>" for unknown caller IDs just an empty field
 
-- Newstate now has "CalleridNum" for numeric caller id, like Newchannel
+- Newstate event
+	- Now has "CalleridNum" for numeric caller id, like Newchannel
 	- The event does not send "<unknown>" for unknown caller IDs just an empty field
 
-- Event Dial has new headers, to comply with other events
+- Dial event
+	- Event Dial has new headers, to comply with other events
 	- Source	-> Channel		Channel name (caller)
 	- SrcUniqueID	-> UniqueID		Uniqueid
 	(new)		-> Dialstring		Dialstring in app data
 
-- The "Link" and "Unlink" bridge events in channel.c are now renamed to "Bridge"
+- Link and Unlink events
+	- The "Link" and "Unlink" bridge events in channel.c are now renamed to "Bridge"
 	- The link state is in the bridgestate: header as "Link" or "Unlink"
 	- For channel.c bridges, "Bridgetype: core" is added. This opens up for
 	  bridge events in rtp.c 
@@ -31,17 +56,32 @@
 	- CallerID	-> CallerIDnum
 	- The event does not send "<unknown>" for unknown caller IDs just an empty field
 	
-- The "Reload" event sent at manager reload now has a new header and is now implemented
-  in more modules than manager to alert a reload. For channels, there's a CHANNELRELOAD 
-  event to use.
+- Reload event
+	- The "Reload" event sent at manager reload now has a new header and is now implemented
+  	in more modules than manager to alert a reload. For channels, there's a CHANNELRELOAD 
+  	event to use.
 	(new)		-> Module: manager | CDR | DNSmgr | RTP | ENUM
 	(new)		-> Status: enabled | disabled
 	- To support reload events from other modules too
 		- cdr module added
 
+- Status action replies (Event: Status)
+	Header changes
+	- link		-> BridgedChannel
+	- (new)		-> BridgedUniqueid
+
+- StatusComplete Event
+	New header
+	- (new)		-> Items		Number of channels reported
+	
+
 - The ExtensionStatus manager command now has a "StatusDesc" field with text description of the state
 
 - The Registry and Peerstatus events in chan_sip and chan_iax now use "ChannelType" instead of "ChannelDriver"
+
+- The Response to Action: IAXpeers now have a Response: Success header
+
+- The MeetmeJoin now has caller ID name and Caller ID number fields (like MeetMeLeave)
 
 * NEW EVENTS
 ------------
@@ -81,3 +121,34 @@
 			Channeltype: SIP
 			SIPcallid: NTQzYWFiOWM4NmE0MWRkZjExMzU2YzQ3OWQwNzg3ZmI.
 			SIPfullcontact: sip:olle at 127.0.0.1:49054
+
+- Action: CoreSettings
+	Modules: manager.c
+	Purpose: To report core settings, like AMI and Asterisk version,
+		maxcalls and maxload settings.
+	Example:
+		Response: Success
+		ActionID: 1681692777
+		AMIversion: 1.1
+		AsteriskVersion: SVN-oej-moremanager-r61756M
+		SystemName: EDVINA-node-a
+		CoreMaxCalls: 120
+		CoreMaxLoadAvg: 0.000000
+		CoreRunUser: edvina
+		CoreRunGroup: edvina
+
+- Action: CoreStatus
+	Modules: manager.c
+	Purpose: To report current PBX core status flags, like
+		number of concurrent calls, startup and reload time.
+	Example:
+		Response: Success
+		ActionID: 1649760492
+		CoreStartupTime: 22:35:17
+		CoreReloadTime: 22:35:17
+		CoreCurrentCalls: 20
+
+* TODO
+------
+- Someone needs to fix "iaxpeers"
+

Modified: team/oej/moremanager/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/apps/app_meetme.c?view=diff&rev=61801&r1=61800&r2=61801
==============================================================================
--- team/oej/moremanager/apps/app_meetme.c (original)
+++ team/oej/moremanager/apps/app_meetme.c Wed Apr 25 11:26:52 2007
@@ -1642,11 +1642,16 @@
 
 	if (!sent_event) {
 		manager_event(EVENT_FLAG_CALL, "MeetmeJoin", 
-			      "Channel: %s\r\n"
-			      "Uniqueid: %s\r\n"
-			      "Meetme: %s\r\n"
-			      "Usernum: %d\r\n",
-			      chan->name, chan->uniqueid, conf->confno, user->user_no);
+			        "Channel: %s\r\n"
+			        "Uniqueid: %s\r\n"
+				"Meetme: %s\r\n"
+				"CallerIDnum: %s\r\n"
+			      	"CallerIDname: %s\r\n"
+			      	"Duration: %ld\r\n",
+			      	chan->name, chan->uniqueid, conf->confno, 
+			      user->user_no,
+			      S_OR(user->chan->cid.cid_num, "<unknown>"),
+			      S_OR(user->chan->cid.cid_name, "<unknown>"),
 		sent_event = 1;
 	}
 

Modified: team/oej/moremanager/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/channels/chan_iax2.c?view=diff&rev=61801&r1=61800&r2=61801
==============================================================================
--- team/oej/moremanager/channels/chan_iax2.c (original)
+++ team/oej/moremanager/channels/chan_iax2.c Wed Apr 25 11:26:52 2007
@@ -4254,6 +4254,7 @@
 	int ret;
 	const char *id = astman_get_header(m,"ActionID");
 
+	astman_append(s, "Response: Success\r\n");
 	if (!ast_strlen_zero(id))
 		astman_append(s, "ActionID: %s\r\n",id);
 	ret = __iax2_show_peers(1, -1, s, 3, a );

Modified: team/oej/moremanager/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/channels/chan_sip.c?view=diff&rev=61801&r1=61800&r2=61801
==============================================================================
--- team/oej/moremanager/channels/chan_sip.c (original)
+++ team/oej/moremanager/channels/chan_sip.c Wed Apr 25 11:26:52 2007
@@ -3469,9 +3469,6 @@
 			res = transmit_response_with_t38_sdp(p, "200 OK", &p->initreq, XMIT_CRITICAL);
 		} else 
 			res = transmit_response_with_sdp(p, "200 OK", &p->initreq, XMIT_CRITICAL);
-		manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate",
-			"Channel: %s\r\nUniqueid: %s\r\nChanneltype: %s\r\nSIPcallid: %s\r\nSIPfullcontact: %s\r\n",
-			ast->name, ast->uniqueid, "SIP", p->callid, p->fullcontact);
 	}
 	ast_mutex_unlock(&p->lock);
 	return res;
@@ -3912,6 +3909,10 @@
 
 	if (!ast_test_flag(&i->flags[0], SIP_NO_HISTORY))
 		append_history(i, "NewChan", "Channel %s - from %s", tmp->name, i->callid);
+
+	manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate",
+		"Channel: %s\r\nUniqueid: %s\r\nChanneltype: %s\r\nSIPcallid: %s\r\nSIPfullcontact: %s\r\n",
+		tmp->name, tmp->uniqueid, "SIP", i->callid, i->fullcontact);
 
 	return tmp;
 }
@@ -11815,8 +11816,8 @@
 			if (!reinvite) {
 				ast_queue_control(p->owner, AST_CONTROL_ANSWER);
 				manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate",
-					"Channel: %s\r\nChanneltype: %s\r\nSIPcallid: %s\r\nSIPfullcontact: %s\r\nPeername: %s\r\n",
-					p->owner->name, "SIP", p->callid, p->fullcontact, p->peername);
+					"Channel: %s\r\nChanneltype: %s\r\nUniqueid: %s\r\nSIPcallid: %s\r\nSIPfullcontact: %s\r\nPeername: %s\r\n",
+					p->owner->name, p->owner->uniqueid, "SIP", p->callid, p->fullcontact, p->peername);
 			} else {	/* RE-invite */
 				ast_queue_frame(p->owner, &ast_null_frame);
 			}
@@ -13748,10 +13749,12 @@
 	ast_set_flag(&transferer->flags[0], SIP_DEFER_BYE_ON_TRANSFER);	/* Delay hangup */
 
 	/* Perform the transfer */
-	manager_event(EVENT_FLAG_CALL, "Transfer", "TransferMethod: SIP\r\nTransferType: Attended\r\nChannel: %s\r\nSIP-Callid: %s\r\nTargetChannel: %s\r\n",
+	manager_event(EVENT_FLAG_CALL, "Transfer", "TransferMethod: SIP\r\nTransferType: Attended\r\nChannel: %s\r\nUniqueid: %s\r\nSIP-Callid: %s\r\nTargetChannel: %s\r\nTargetUniqueid: %s\r\n",
 		transferer->owner->name,
+		transferer->owner->uniqueid,
 		transferer->callid,
-		target.chan1->name);
+		target.chan1->name,
+		target.chan1->uniqueid);
 	res = attempt_transfer(current, &target);
 	ast_mutex_unlock(&targetcall_pvt->lock);
 	if (res) {
@@ -14016,10 +14019,12 @@
 		ast_clear_flag(&p->flags[0], SIP_GOTREFER);	
 		p->refer->status = REFER_200OK;
 		append_history(p, "Xfer", "REFER to call parking.");
-		manager_event(EVENT_FLAG_CALL, "Transfer", "TransferMethod: SIP\r\nTransferType: Blind\r\nChannel: %s\r\nSIP-Callid: %s\r\nTargetChannel: %s\r\nTransferExten: %s\r\n",
+		manager_event(EVENT_FLAG_CALL, "Transfer", "TransferMethod: SIP\r\nTransferType: Blind\r\nChannel: %s\r\nUniqueid: %s\r\nSIP-Callid: %s\r\nTargetChannel: %s\r\nTargetUniqueid: %s\r\nTransferExten: %s\r\nTransfer2Parking: Yes\r\n",
 			current.chan1->name,
+			current.chan1->uniqueid,
 			p->callid,
 			current.chan2->name,
+			current.chan2->uniqueid,
 			p->refer->refer_to);
 		if (sipdebug && option_debug > 3)
 			ast_log(LOG_DEBUG, "SIP transfer to parking: trying to park %s. Parked by %s\n", current.chan2->name, current.chan1->name);
@@ -14094,10 +14099,12 @@
 	res = ast_async_goto(current.chan2, p->refer->refer_to_context, p->refer->refer_to, 1);
 
 	if (!res) {
-		manager_event(EVENT_FLAG_CALL, "Transfer", "TransferMethod: SIP\r\nTransferType: Blind\r\nChannel: %s\r\nSIP-Callid: %s\r\nTargetChannel: %s\r\nTransferExten: %s\r\nTransferContext: %s\r\n",
+		manager_event(EVENT_FLAG_CALL, "Transfer", "TransferMethod: SIP\r\nTransferType: Blind\r\nChannel: %s\r\nUniqueid: %s\r\nSIP-Callid: %s\r\nTargetChannel: %s\r\nTargetUniqueid: %s\r\nTransferExten: %s\r\nTransferContext: %s\r\n",
 			current.chan1->name,
+			current.chan1->uniqueid,
 			p->callid,
 			current.chan2->name,
+			current.chan2->uniqueid,
 			p->refer->refer_to, p->refer->refer_to_context);
 		/* Success  - we have a new channel */
 		if (option_debug > 2)

Modified: team/oej/moremanager/include/asterisk.h
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/include/asterisk.h?view=diff&rev=61801&r1=61800&r2=61801
==============================================================================
--- team/oej/moremanager/include/asterisk.h (original)
+++ team/oej/moremanager/include/asterisk.h Wed Apr 25 11:26:52 2007
@@ -53,6 +53,8 @@
 extern char ast_config_AST_PID[PATH_MAX];
 extern char ast_config_AST_SOCKET[PATH_MAX];
 extern char ast_config_AST_RUN_DIR[PATH_MAX];
+extern char ast_config_AST_RUN_USER[PATH_MAX];
+extern char ast_config_AST_RUN_GROUP[PATH_MAX];
 extern char ast_config_AST_CTL_PERMISSIONS[PATH_MAX];
 extern char ast_config_AST_CTL_OWNER[PATH_MAX];
 extern char ast_config_AST_CTL_GROUP[PATH_MAX];

Modified: team/oej/moremanager/include/asterisk/manager.h
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/include/asterisk/manager.h?view=diff&rev=61801&r1=61800&r2=61801
==============================================================================
--- team/oej/moremanager/include/asterisk/manager.h (original)
+++ team/oej/moremanager/include/asterisk/manager.h Wed Apr 25 11:26:52 2007
@@ -35,10 +35,16 @@
  Manager protocol packages are text fields of the form a: b.  There is
  always exactly one space after the colon.
 
+ For Actions replies, the first line of the reply is a "Response:" header with
+ values "success", "error" or "follows". "Follows" implies that the
+ response is coming as separate events with the same ActionID. If the
+ Action request has no ActionID, it will be hard matching events
+ to the Action request in the manager client.
+
  The first header type is the "Event" header.  Other headers vary from
- event to event.  Headers end with standard \r\n termination.
+ event to event.  Headers end with standard \\r\\n termination.
  The last line of the manager response or event is an empty line.
- (\r\n)
+ (\\r\\n)
 
  ** Please try to re-use existing headers to simplify manager message parsing in clients.
     Don't re-use an existing header with a new meaning, please.
@@ -46,6 +52,7 @@
  */
 
 #define DEFAULT_MANAGER_PORT 5038	/* Default port for Asterisk management via TCP */
+#define AMI_VERSION			"1.1"
 
 #define EVENT_FLAG_SYSTEM 		(1 << 0) /* System events such as module load/unload */
 #define EVENT_FLAG_CALL			(1 << 1) /* Call event, such as state change, etc */

Modified: team/oej/moremanager/main/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/main/asterisk.c?view=diff&rev=61801&r1=61800&r2=61801
==============================================================================
--- team/oej/moremanager/main/asterisk.c (original)
+++ team/oej/moremanager/main/asterisk.c Wed Apr 25 11:26:52 2007
@@ -2932,6 +2932,7 @@
 #endif	
 
 	time(&ast_startuptime);
+	ast_lastreloadtime = ast_startuptime;
 	ast_cli_register_multiple(cli_asterisk, sizeof(cli_asterisk) / sizeof(struct ast_cli_entry));
 
 	if (ast_opt_console) {

Modified: team/oej/moremanager/main/loader.c
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/main/loader.c?view=diff&rev=61801&r1=61800&r2=61801
==============================================================================
--- team/oej/moremanager/main/loader.c (original)
+++ team/oej/moremanager/main/loader.c Wed Apr 25 11:26:52 2007
@@ -250,7 +250,7 @@
 	for (pos = 0, x = 0; x < 16; x++)
 		pos += sprintf(buf + pos, " %02x", *d++);
 
-	ast_log(LOG_DEBUG, "Unexpected signature:%s\n", buf);
+	ast_log(LOG_WARNING, "Unexpected signature:%s\n", buf);
 
 	return 0;
 }

Modified: team/oej/moremanager/main/manager.c
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/main/manager.c?view=diff&rev=61801&r1=61800&r2=61801
==============================================================================
--- team/oej/moremanager/main/manager.c (original)
+++ team/oej/moremanager/main/manager.c Wed Apr 25 11:26:52 2007
@@ -68,6 +68,7 @@
 #include "asterisk/http.h"
 #include "asterisk/threadstorage.h"
 #include "asterisk/linkedlists.h"
+#include "asterisk/version.h"
 
 struct fast_originate_helper {
 	char tech[AST_MAX_EXTENSION];
@@ -1012,7 +1013,7 @@
 
 static int action_ping(struct mansession *s, const struct message *m)
 {
-	astman_send_response(s, m, "Pong", NULL);
+	astman_send_response(s, m, "Success", "Ping: Pong\r\n");
 	return 0;
 }
 
@@ -1300,9 +1301,9 @@
 
 	res = set_eventmask(s, mask);
 	if (res > 0)
-		astman_send_response(s, m, "Events On", NULL);
+		astman_send_response(s, m, "Success", "Events: On\r\n");
 	else if (res == 0)
-		astman_send_response(s, m, "Events Off", NULL);
+		astman_send_response(s, m, "Success", "Events: Off\r\n");
 
 	return 0;
 }
@@ -1444,6 +1445,7 @@
 	char bridge[256];
 	struct timeval now = ast_tvnow();
 	long elapsed_seconds = 0;
+	int channels = 0;
 	int all = ast_strlen_zero(name); /* set if we want all channels */
 
 	if (!ast_strlen_zero(id))
@@ -1458,10 +1460,12 @@
 		}
 	}
 	astman_send_ack(s, m, "Channel status will follow");
+
 	/* if we look by name, we break after the first iteration */
 	while (c) {
+		channels++;
 		if (c->_bridge)
-			snprintf(bridge, sizeof(bridge), "Link: %s\r\n", c->_bridge->name);
+			snprintf(bridge, sizeof(bridge), "BridgedChannel: %s\r\nBridgedUniqueid\r\n", c->_bridge->name, c->_bridge->uniqueid);
 		else
 			bridge[0] = '\0';
 		if (c->pbx) {
@@ -1472,7 +1476,6 @@
 			"Event: Status\r\n"
 			"Privilege: Call\r\n"
 			"Channel: %s\r\n"
-			"CallerID: %s\r\n"		/* This parameter is deprecated and will be removed post-1.4 */
 			"CallerIDNum: %s\r\n"
 			"CallerIDName: %s\r\n"
 			"Account: %s\r\n"
@@ -1487,7 +1490,6 @@
 			"\r\n",
 			c->name, 
 			S_OR(c->cid.cid_num, "<unknown>"), 
-			S_OR(c->cid.cid_num, "<unknown>"), 
 			S_OR(c->cid.cid_name, "<unknown>"), 
 			c->accountcode,
 			ast_state2str(c->_state), c->context,
@@ -1497,7 +1499,6 @@
 			"Event: Status\r\n"
 			"Privilege: Call\r\n"
 			"Channel: %s\r\n"
-			"CallerID: %s\r\n"		/* This parameter is deprecated and will be removed post-1.4 */
 			"CallerIDNum: %s\r\n"
 			"CallerIDName: %s\r\n"
 			"Account: %s\r\n"
@@ -1508,7 +1509,6 @@
 			"\r\n",
 			c->name, 
 			S_OR(c->cid.cid_num, "<unknown>"), 
-			S_OR(c->cid.cid_num, "<unknown>"), 
 			S_OR(c->cid.cid_name, "<unknown>"), 
 			c->accountcode,
 			ast_state2str(c->_state), bridge, c->uniqueid, idText);
@@ -1521,7 +1521,8 @@
 	astman_append(s,
 	"Event: StatusComplete\r\n"
 	"%s"
-	"\r\n",idText);
+	"Items: %d\r\n",
+	"\r\n",idText, channels);
 	return 0;
 }
 
@@ -1976,6 +1977,92 @@
 	}
 
 	manager_event(EVENT_FLAG_USER, "UserEvent", "UserEvent: %s\r\n%s", event, body);
+	return 0;
+}
+
+static char mandescr_coresettings[] =
+"Description: Query for Core PBX settings.\n"
+"Variables: (Names marked with * are optional)\n"
+"       *ActionID: ActionID of this transaction\n";
+
+/*! \brief Show PBX core settings information */
+static int action_coresettings(struct mansession *s, const struct message *m)
+{
+	const char *actionid = astman_get_header(m, "ActionID");
+	char idText[150];
+
+        if (!ast_strlen_zero(actionid)) {
+                snprintf(idText, sizeof(idText), "ActionID: %s\r\n", actionid);
+        }
+
+	astman_append(s, "Response: Success\r\n"
+			"%s"
+			"AMIversion: %s\r\n"
+			"AsteriskVersion: %s\r\n"
+			"SystemName: %s\r\n"
+			"CoreMaxCalls: %d\r\n"
+			"CoreMaxLoadAvg: %f\r\n"
+			"CoreRunUser: %s\r\n"
+			"CoreRunGroup: %s\r\n"
+#ifdef THIS_REQUIRES_SVN_TRUNK
+			"CoreMaxFilehandles: %d\r\n" 
+			"CoreRealTimeEnabled: %s\r\n"
+			"CoreCDRenabled: %s\r\n"
+			"CoreHTTPenabled: %s\r\n"
+#endif
+			,
+			AMI_VERSION,
+			idText,
+			ASTERISK_VERSION, 
+			ast_config_AST_SYSTEM_NAME,
+			option_maxcalls,
+			option_maxload,
+			ast_config_AST_RUN_USER,
+			ast_config_AST_RUN_GROUP
+#ifdef THIS_REQUIRES_SVN_TRUNK
+			,
+			option_maxfiles,
+			ast_realtime_enabled() ? "Yes" : "No",
+			check_cdr_enabled() ? "Yes" : "No",
+			check_webmanager_enabled() ? "Yes" : "No"
+#endif
+			);
+	return 0;
+}
+
+static char mandescr_corestatus[] =
+"Description: Query for Core PBX status.\n"
+"Variables: (Names marked with * are optional)\n"
+"       *ActionID: ActionID of this transaction\n";
+
+/*! \brief Show PBX core status information */
+static int action_corestatus(struct mansession *s, const struct message *m)
+{
+	const char *actionid = astman_get_header(m, "ActionID");
+	char idText[150];
+	char startuptime[150];
+	char reloadtime[150];
+	struct tm tm;
+
+        if (!ast_strlen_zero(actionid)) {
+                snprintf(idText, sizeof(idText), "ActionID: %s\r\n", actionid);
+        }
+	localtime_r(&ast_startuptime, &tm);
+	strftime(startuptime, sizeof(startuptime), "%H:%M:%S", &tm);
+	localtime_r(&ast_lastreloadtime, &tm);
+	strftime(reloadtime, sizeof(reloadtime), "%H:%M:%S", &tm);
+
+	astman_append(s, "Response: Success\r\n"
+			"%s"
+			"CoreStartupTime: %s\r\n"
+			"CoreReloadTime: %s\r\n"
+			"CoreCurrentCalls: %d\r\n"
+			"",
+			idText,
+			startuptime,
+			reloadtime,
+			ast_active_channels()
+			);
 	return 0;
 }
 
@@ -2051,8 +2138,11 @@
 				break;
 			}
 			ast_rwlock_unlock(&actionlock);
-			if (!tmp)
-				astman_send_error(s, m, "Invalid/unknown command");
+			if (!tmp) {
+				char buf[120];
+				snprintf(buf, sizeof(buf), "Invalid/unkonwn command: %s\n", action);
+				astman_send_error(s, m, buf);
+			}
 		}
 	}
 	if (ret)
@@ -2149,7 +2239,7 @@
 	struct mansession *s = data;
 	int res;
 	
-	astman_append(s, "Asterisk Call Manager/1.0\r\n");
+	astman_append(s, "Asterisk Call Manager/%s\r\n", AMI_VERSION);
 	for (;;) {
 		if ((res = do_message(s)) < 0)
 			break;
@@ -2722,6 +2812,8 @@
 		ast_manager_register2("ListCommands", 0, action_listcommands, "List available manager commands", mandescr_listcommands);
 		ast_manager_register2("UserEvent", EVENT_FLAG_USER, action_userevent, "Send an arbitrary event", mandescr_userevent);
 		ast_manager_register2("WaitEvent", 0, action_waitevent, "Wait for an event to occur", mandescr_waitevent);
+		ast_manager_register2("CoreStatus", EVENT_FLAG_SYSTEM, action_corestatus, "Show PBX core status variables", mandescr_corestatus);
+		ast_manager_register2("CoreSettings", EVENT_FLAG_SYSTEM, action_coresettings, "Show PBX core settings (version etc)", mandescr_coresettings);
 
 		ast_cli_register_multiple(cli_manager, sizeof(cli_manager) / sizeof(struct ast_cli_entry));
 		ast_extension_state_add(NULL, NULL, manager_state_cb, NULL);

Modified: team/oej/moremanager/res/res_features.c
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/res/res_features.c?view=diff&rev=61801&r1=61800&r2=61801
==============================================================================
--- team/oej/moremanager/res/res_features.c (original)
+++ team/oej/moremanager/res/res_features.c Wed Apr 25 11:26:52 2007
@@ -703,8 +703,8 @@
 			if (ast_async_goto(transferee, transferer_real_context, xferto, 1))
 				ast_log(LOG_WARNING, "Async goto failed :-(\n");
 			else  {
-				manager_event(EVENT_FLAG_CALL, "Transfer", "TransferMethod: PBX\r\nTransferType: Blind\r\nChannel: %s\r\nTransferExten: %s\r\nTransferContext: %s\r\n",
-					transferee->name, xferto, transferer_real_context);
+				manager_event(EVENT_FLAG_CALL, "Transfer", "TransferMethod: PBX\r\nTransferType: Blind\r\nChannel: %s\r\nUniqueid: %s\r\nTargetChannel: %s\r\nTargetUniqueid: %s\r\nTransferExten: %s\r\nTransferContext: %s\r\n",
+					transferer->name, transferer->uniqueid, transferee->name, transferee->uniqueid, xferto, transferer_real_context);
 			}
 			res = -1;
 		} else {
@@ -2011,6 +2011,7 @@
 	struct parkeduser *cur;
 	const char *id = astman_get_header(m, "ActionID");
 	char idText[256] = "";
+	int i = 0;
 
 	if (!ast_strlen_zero(id))
 		snprintf(idText, sizeof(idText), "ActionID: %s\r\n", id);
@@ -2020,6 +2021,7 @@
 	ast_mutex_lock(&parking_lock);
 
 	for (cur = parkinglot; cur; cur = cur->next) {
+		i++;
 		astman_append(s, "Event: ParkedCall\r\n"
 			"Exten: %d\r\n"
 			"Channel: %s\r\n"
@@ -2039,7 +2041,9 @@
 	astman_append(s,
 		"Event: ParkedCallsComplete\r\n"
 		"%s"
-		"\r\n",idText);
+		"ItemsInList: %d\r\n"
+		"\r\n",
+		idText, i);
 
 	ast_mutex_unlock(&parking_lock);
 

Modified: team/oej/moremanager/res/res_jabber.c
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/res/res_jabber.c?view=diff&rev=61801&r1=61800&r2=61801
==============================================================================
--- team/oej/moremanager/res/res_jabber.c (original)
+++ team/oej/moremanager/res/res_jabber.c Wed Apr 25 11:26:52 2007
@@ -2341,14 +2341,14 @@
 	}	
 	if (strchr(screenname, '@') && message){
 		ast_aji_send(client, screenname, message);	
+		astman_append(s, "Response: Success\r\n");
 		if (!ast_strlen_zero(id))
 			astman_append(s, "ActionID: %s\r\n",id);
-		astman_append(s, "Response: Success\r\n");
 		return 0;
 	}
+	astman_append(s, "Response: Error\r\n");
 	if (!ast_strlen_zero(id))
 		astman_append(s, "ActionID: %s\r\n",id);
-	astman_append(s, "Response: Failure\r\n");
 	return 0;
 }
 



More information about the asterisk-commits mailing list