mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
Merge "show features" (bug #3515)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4971 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1353,6 +1353,34 @@ static int park_exec(struct ast_channel *chan, void *data)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int handle_showfeatures(int fd, int argc, char *argv[])
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
int fcount;
|
||||||
|
char format[] = "%-25s %-7s %-7s\n";
|
||||||
|
|
||||||
|
ast_cli(fd, format, "Feature", "Default", "Current");
|
||||||
|
ast_cli(fd, format, "-------", "-------", "-------");
|
||||||
|
|
||||||
|
ast_cli(fd, format, "Pickup", "*8", ast_pickup_ext()); /* default hardcoded above, so we'll hardcode it here */
|
||||||
|
|
||||||
|
fcount = sizeof(builtin_features) / sizeof(builtin_features[0]);
|
||||||
|
|
||||||
|
for (i = 0; i < fcount; i++)
|
||||||
|
{
|
||||||
|
ast_cli(fd, format, builtin_features[i].fname, builtin_features[i].default_exten, builtin_features[i].exten);
|
||||||
|
}
|
||||||
|
|
||||||
|
return RESULT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static char showfeatures_help[] =
|
||||||
|
"Usage: show features\n"
|
||||||
|
" Lists currently configured features.\n";
|
||||||
|
|
||||||
|
static struct ast_cli_entry showfeatures =
|
||||||
|
{ { "show", "features", NULL }, handle_showfeatures, "Lists configured features", showfeatures_help };
|
||||||
|
|
||||||
static int handle_parkedcalls(int fd, int argc, char *argv[])
|
static int handle_parkedcalls(int fd, int argc, char *argv[])
|
||||||
{
|
{
|
||||||
struct parkeduser *cur;
|
struct parkeduser *cur;
|
||||||
@@ -1520,6 +1548,7 @@ int load_module(void)
|
|||||||
if ((res = load_config()))
|
if ((res = load_config()))
|
||||||
return res;
|
return res;
|
||||||
ast_cli_register(&showparked);
|
ast_cli_register(&showparked);
|
||||||
|
ast_cli_register(&showfeatures);
|
||||||
ast_pthread_create(&parking_thread, NULL, do_parking_thread, NULL);
|
ast_pthread_create(&parking_thread, NULL, do_parking_thread, NULL);
|
||||||
res = ast_register_application(parkedcall, park_exec, synopsis, descrip);
|
res = ast_register_application(parkedcall, park_exec, synopsis, descrip);
|
||||||
if (!res)
|
if (!res)
|
||||||
@@ -1571,6 +1600,7 @@ int unload_module(void)
|
|||||||
STANDARD_HANGUP_LOCALUSERS;
|
STANDARD_HANGUP_LOCALUSERS;
|
||||||
|
|
||||||
ast_manager_unregister( "ParkedCalls" );
|
ast_manager_unregister( "ParkedCalls" );
|
||||||
|
ast_cli_unregister(&showfeatures);
|
||||||
ast_cli_unregister(&showparked);
|
ast_cli_unregister(&showparked);
|
||||||
ast_unregister_application(parkcall);
|
ast_unregister_application(parkcall);
|
||||||
return ast_unregister_application(parkedcall);
|
return ast_unregister_application(parkedcall);
|
||||||
|
Reference in New Issue
Block a user