[Asterisk-cvs] asterisk asterisk.c,1.100,1.101 file.c,1.44,1.45
markster at lists.digium.com
markster at lists.digium.com
Tue Jun 29 23:36:37 CDT 2004
Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv21469
Modified Files:
asterisk.c file.c
Log Message:
Add "show file formats" (courtesy bkw_) and Update IAXY firmware to 17 (altserver support)
Index: asterisk.c
===================================================================
RCS file: /usr/cvsroot/asterisk/asterisk.c,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -d -r1.100 -r1.101
--- asterisk.c 29 Jun 2004 04:42:19 -0000 1.100
+++ asterisk.c 30 Jun 2004 03:22:29 -0000 1.101
@@ -1703,6 +1703,10 @@
printf(term_quit());
exit(1);
}
+ if (ast_file_init()) {
+ printf(term_quit());
+ exit(1);
+ }
if (load_pbx()) {
printf(term_quit());
exit(1);
Index: file.c
===================================================================
RCS file: /usr/cvsroot/asterisk/file.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- file.c 23 Jun 2004 18:00:50 -0000 1.44
+++ file.c 30 Jun 2004 03:22:29 -0000 1.45
@@ -14,6 +14,7 @@
#include <sys/types.h>
#include <asterisk/frame.h>
#include <asterisk/file.h>
+#include <asterisk/cli.h>
#include <asterisk/logger.h>
#include <asterisk/channel.h>
#include <asterisk/sched.h>
@@ -1044,3 +1045,41 @@
}
return (c->_softhangup ? -1 : 0);
}
+
+static int show_file_formats(int fd, int argc, char *argv[])
+{
+#define FORMAT "%-10s %-10s %-20s\n"
+#define FORMAT2 "%-10s %-10s %-20s\n"
+ struct ast_format *f;
+ if (argc != 3)
+ return RESULT_SHOWUSAGE;
+ ast_cli(fd, FORMAT, "Format", "Name", "Extensions");
+
+ if (ast_mutex_lock(&formatlock)) {
+ ast_log(LOG_WARNING, "Unable to lock format list\n");
+ return -1;
+ }
+
+ f = formats;
+ while(f) {
+ ast_cli(fd, FORMAT2, ast_getformatname(f->format), f->name, f->exts);
+ f = f->next;
+ };
+ ast_mutex_unlock(&formatlock);
+ return RESULT_SUCCESS;
+}
+
+struct ast_cli_entry show_file =
+{
+ { "show", "file", "formats" },
+ show_file_formats,
+ "Displays file formats",
+ "Usage: show file formats\n"
+ " displays currently registered file formats (if any)\n"
+};
+
+int ast_file_init(void)
+{
+ ast_cli_register(&show_file);
+ return 0;
+}
More information about the svn-commits
mailing list