summaryrefslogtreecommitdiff
path: root/channel.c
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2006-02-11 07:06:47 +0000
committerMark Spencer <markster@digium.com>2006-02-11 07:06:47 +0000
commit4a80fe50222de3a7683baec3b1820411c8d1d330 (patch)
treea46e7f49098d94bc416888edb21ba7974eeed499 /channel.c
parentc74856b173f36b60263ece0aa7def9e9954a814f (diff)
Add capability to retrieve list of channel types
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@9508 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channel.c')
-rw-r--r--channel.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/channel.c b/channel.c
index a8747b017..dc4dd8fb8 100644
--- a/channel.c
+++ b/channel.c
@@ -165,6 +165,22 @@ const struct ast_cause {
};
+struct ast_variable *ast_channeltype_list(void)
+{
+ struct chanlist *cl;
+ struct ast_variable *var=NULL, *prev = NULL;
+ AST_LIST_TRAVERSE(&backends, cl, list) {
+ if (prev) {
+ if ((prev->next = ast_variable_new(cl->tech->type, cl->tech->description)))
+ prev = prev->next;
+ } else {
+ var = ast_variable_new(cl->tech->type, cl->tech->description);
+ prev = var;
+ }
+ }
+ return var;
+}
+
static int show_channeltypes(int fd, int argc, char *argv[])
{
#define FORMAT "%-10.10s %-40.40s %-12.12s %-12.12s %-12.12s\n"