aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-06-30 03:22:29 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-06-30 03:22:29 +0000
commit90e5ff3d2db28777441a0a880e858ea669199475 (patch)
treeaf67c00311caca66ebfabe899b0b4227fd3a6fe5
parent3e4c4b4b7aa9945869f00c680ad50745c9605f97 (diff)
Add "show file formats" (courtesy bkw_) and Update IAXY firmware to 17 (altserver support)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3360 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xasterisk.c4
-rwxr-xr-xcontrib/firmware/iax/iaxy.binbin38522 -> 39016 bytes
-rwxr-xr-xfile.c39
-rwxr-xr-xinclude/asterisk/file.h8
4 files changed, 51 insertions, 0 deletions
diff --git a/asterisk.c b/asterisk.c
index ff85004a1..a128d03d5 100755
--- a/asterisk.c
+++ b/asterisk.c
@@ -1703,6 +1703,10 @@ int main(int argc, char *argv[])
printf(term_quit());
exit(1);
}
+ if (ast_file_init()) {
+ printf(term_quit());
+ exit(1);
+ }
if (load_pbx()) {
printf(term_quit());
exit(1);
diff --git a/contrib/firmware/iax/iaxy.bin b/contrib/firmware/iax/iaxy.bin
index 60aec2329..e21624a37 100755
--- a/contrib/firmware/iax/iaxy.bin
+++ b/contrib/firmware/iax/iaxy.bin
Binary files differ
diff --git a/file.c b/file.c
index d23879edf..fa3885a98 100755
--- a/file.c
+++ b/file.c
@@ -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 @@ char ast_waitstream_full(struct ast_channel *c, char *breakon, int audiofd, int
}
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;
+}
diff --git a/include/asterisk/file.h b/include/asterisk/file.h
index 55c0eaa7f..eb2c78e35 100755
--- a/include/asterisk/file.h
+++ b/include/asterisk/file.h
@@ -284,6 +284,14 @@ long ast_tellstream(struct ast_filestream *fs);
*/
struct ast_frame *ast_readframe(struct ast_filestream *s);
+//! Initialize file stuff
+/*!
+ * Initializes all the various file stuff. Basically just registers the cli stuff
+ * Returns 0 all the time
+ */
+extern int ast_file_init(void);
+
+
#define AST_RESERVED_POINTERS 20
#if defined(__cplusplus) || defined(c_plusplus)