diff options
author | Mark Spencer <markster@digium.com> | 2006-02-11 07:06:47 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2006-02-11 07:06:47 +0000 |
commit | 4a80fe50222de3a7683baec3b1820411c8d1d330 (patch) | |
tree | a46e7f49098d94bc416888edb21ba7974eeed499 /channel.c | |
parent | c74856b173f36b60263ece0aa7def9e9954a814f (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.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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" |