mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-09 03:18:30 +00:00
Add capability to retrieve list of channel types
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@9508 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
16
channel.c
16
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[])
|
static int show_channeltypes(int fd, int argc, char *argv[])
|
||||||
{
|
{
|
||||||
#define FORMAT "%-10.10s %-40.40s %-12.12s %-12.12s %-12.12s\n"
|
#define FORMAT "%-10.10s %-40.40s %-12.12s %-12.12s %-12.12s\n"
|
||||||
|
|||||||
@@ -1236,6 +1236,9 @@ extern char *ast_print_group(char *buf, int buflen, ast_group_t group);
|
|||||||
*/
|
*/
|
||||||
const char *channelreloadreason2txt(enum channelreloadreason reason);
|
const char *channelreloadreason2txt(enum channelreloadreason reason);
|
||||||
|
|
||||||
|
/*! \brief return an ast_variable list of channeltypes */
|
||||||
|
extern struct ast_variable *ast_channeltype_list(void);
|
||||||
|
|
||||||
#if defined(__cplusplus) || defined(c_plusplus)
|
#if defined(__cplusplus) || defined(c_plusplus)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user