[asterisk-commits] oej: branch oej/moremanager r172813 - /team/oej/moremanager/main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Feb 2 02:42:03 CST 2009


Author: oej
Date: Mon Feb  2 02:42:03 2009
New Revision: 172813

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=172813
Log:
Backport some changes from trunk

Modified:
    team/oej/moremanager/main/channel.c
    team/oej/moremanager/main/loader.c
    team/oej/moremanager/main/manager.c

Modified: team/oej/moremanager/main/channel.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/moremanager/main/channel.c?view=diff&rev=172813&r1=172812&r2=172813
==============================================================================
--- team/oej/moremanager/main/channel.c (original)
+++ team/oej/moremanager/main/channel.c Mon Feb  2 02:42:03 2009
@@ -838,6 +838,8 @@
 			      "ChannelStateDesc: %s\r\n"
 			      "CallerIDNum: %s\r\n"
 			      "CallerIDName: %s\r\n"
+			      "Context: %s\r\n"
+			      "Exten: %s\r\n"
 			      "AccountCode: %s\r\n"
 			      "Uniqueid: %s\r\n",
 			      tmp->name, 
@@ -845,6 +847,8 @@
 			      ast_state2str(state),
 			      S_OR(cid_num, ""),
 			      S_OR(cid_name, ""),
+			      S_OR(context, ""),
+			      S_OR(exten, ""),
 			      tmp->accountcode,
 			      tmp->uniqueid);
 	}

Modified: team/oej/moremanager/main/loader.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/moremanager/main/loader.c?view=diff&rev=172813&r1=172812&r2=172813
==============================================================================
--- team/oej/moremanager/main/loader.c (original)
+++ team/oej/moremanager/main/loader.c Mon Feb  2 02:42:03 2009
@@ -1041,37 +1041,46 @@
 /* Manager function to check if module is loaded */
 static int manager_modulecheck(struct mansession *s, const struct message *m)
 {
-	int res;
-	const char *module = astman_get_header(m, "Module");
-	const char *id = astman_get_header(m,"ActionID");
-	char idText[BUFSIZ];
-	const char *version;
-	char filename[BUFSIZ/2];
-	char *cut;
-
-	snprintf(filename, sizeof(filename), module);
-	if ((cut = strchr(filename, '.'))) {
-		*cut = '\0';
-	} else {
-		cut = filename + strlen(filename);
-	}
-	sprintf(cut, ".so");
-	ast_log(LOG_DEBUG, "**** ModuleCheck .so file %s\n", filename);
-	res = ast_module_check(filename);
-	if (!res) {
-		astman_send_error(s, m, "Module not loaded");
-		return 0;
-	}
-	sprintf(cut, ".c");
-	ast_log(LOG_DEBUG, "**** ModuleCheck .c file %s\n", filename);
-	version = ast_file_version_find(filename);
-
-	if (!ast_strlen_zero(id))
-		snprintf(idText, sizeof(idText), "ActionID: %s\r\n", id);
-	astman_append(s, "Response: Success\r\n%s", idText);
-	astman_append(s, "Version: %s\r\n\r\n", version ? version : "");
-	return 0;
-}
+        int res;
+        const char *module = astman_get_header(m, "Module");
+        const char *id = astman_get_header(m, "ActionID");
+        char idText[256];
+#if !defined(LOW_MEMORY)
+        const char *version;
+#endif
+        char filename[PATH_MAX];
+        char *cut;
+
+        ast_copy_string(filename, module, sizeof(filename));
+        if ((cut = strchr(filename, '.'))) {
+                *cut = '\0';
+        } else {
+                cut = filename + strlen(filename);
+        }
+        snprintf(cut, (sizeof(filename) - strlen(filename)) - 1, ".so");
+        ast_log(LOG_DEBUG, "**** ModuleCheck .so file %s\n", filename);
+        res = ast_module_check(filename);
+        if (!res) {
+                astman_send_error(s, m, "Module not loaded");
+                return 0;
+        }
+        snprintf(cut, (sizeof(filename) - strlen(filename)) - 1, ".c");
+        ast_log(LOG_DEBUG, "**** ModuleCheck .c file %s\n", filename);
+#if !defined(LOW_MEMORY)
+        version = ast_file_version_find(filename);
+#endif
+
+        if (!ast_strlen_zero(id))
+                snprintf(idText, sizeof(idText), "ActionID: %s\r\n", id);
+        else
+                idText[0] = '\0';
+        astman_append(s, "Response: Success\r\n%s", idText);
+#if !defined(LOW_MEMORY)
+        astman_append(s, "Version: %s\r\n\r\n", version ? version : "");
+#endif
+        return 0;
+}
+
 
 
 static char mandescr_moduleload[] = 

Modified: team/oej/moremanager/main/manager.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/moremanager/main/manager.c?view=diff&rev=172813&r1=172812&r2=172813
==============================================================================
--- team/oej/moremanager/main/manager.c (original)
+++ team/oej/moremanager/main/manager.c Mon Feb  2 02:42:03 2009
@@ -1105,7 +1105,13 @@
 
 static int action_ping(struct mansession *s, const struct message *m)
 {
-	astman_send_response(s, m, "Success", "Ping: Pong\r\n");
+	const char *actionid = astman_get_header(m, "ActionID");
+
+	astman_append(s, "Response: Success\r\n");
+	if (!ast_strlen_zero(actionid)){
+		astman_append(s, "ActionID: %s\r\n", actionid);
+	}
+	astman_append(s, "Ping: Pong\r\n\r\n");
 	return 0;
 }
 




More information about the asterisk-commits mailing list