Asterisk - The Open Source Telephony Project
18.5.0
|
Standard Command Line Interface. More...
Go to the source code of this file.
Data Structures | |
struct | ast_cli_args |
struct | ast_cli_entry |
descriptor for a cli entry. More... | |
Macros | |
#define | ast_cli_command(fd, s) ast_cli_command_full(CLI_NO_PERMS, CLI_NO_PERMS, fd, s) |
#define | ast_cli_command_multiple(fd, size, s) ast_cli_command_multiple_full(CLI_NO_PERMS, CLI_NO_PERMS, fd, size, s) |
#define | AST_CLI_COMPLETE_EOF "_EOF_" |
#define | AST_CLI_DEFINE(fn, txt, ...) { .handler = fn, .summary = txt, ## __VA_ARGS__ } |
#define | AST_CLI_ONOFF(x) (x) ? "On" : "Off" |
return On or Off depending on the argument. This is used in many places in CLI command, having a function to generate this helps maintaining a consistent output (and possibly emitting the output in other languages, at some point). More... | |
#define | ast_cli_register(e) __ast_cli_register(e, AST_MODULE_SELF) |
Registers a command or an array of commands. More... | |
#define | ast_cli_register_multiple(e, len) __ast_cli_register_multiple(e, len, AST_MODULE_SELF) |
Register multiple commands. More... | |
#define | AST_CLI_YESNO(x) AST_YESNO(x) |
Return Yes or No depending on the argument. More... | |
#define | AST_MAX_ARGS 64 |
#define | AST_MAX_CMD_LEN 16 |
#define | CLI_FAILURE (char *)RESULT_FAILURE |
#define | CLI_NO_PERMS -1 |
#define | CLI_SHOWUSAGE (char *)RESULT_SHOWUSAGE |
#define | CLI_SUCCESS (char *)RESULT_SUCCESS |
#define | ESS(x) ((x) == 1 ? "" : "s") |
#define | RESULT_FAILURE 2 |
#define | RESULT_SHOWUSAGE 1 |
#define | RESULT_SUCCESS 0 |
Enumerations | |
enum | ast_cli_command { CLI_INIT = -2, CLI_GENERATE = -3, CLI_HANDLER = -4 } |
calling arguments for new-style handlers. More... | |
Functions | |
int | __ast_cli_register (struct ast_cli_entry *e, struct ast_module *mod) |
int | __ast_cli_register_multiple (struct ast_cli_entry *e, int len, struct ast_module *mod) |
void | ast_cli (int fd, const char *fmt,...) |
int | ast_cli_allow_at_shutdown (struct ast_cli_entry *e) |
int | ast_cli_command_full (int uid, int gid, int fd, const char *s) |
Interprets a command Interpret a command s, sending output to fd if uid:gid has permissions to run this command. uid = CLI_NO_PERMS to avoid checking user permissions gid = CLI_NO_PERMS to avoid checking group permissions. More... | |
int | ast_cli_command_multiple_full (int uid, int gid, int fd, size_t size, const char *s) |
Executes multiple CLI commands Interpret strings separated by NULL and execute each one, sending output to fd if uid has permissions, uid = CLI_NO_PERMS to avoid checking users permissions. gid = CLI_NO_PERMS to avoid checking group permissions. More... | |
char * | ast_cli_complete (const char *word, const char *const choices[], int pos) |
int | ast_cli_completion_add (char *value) |
Add a result to a request for completion options. More... | |
char ** | ast_cli_completion_matches (const char *, const char *) |
Generates a NULL-terminated array of strings that 1) begin with the string in the second parameter, and 2) are valid in a command after the string in the first parameter. More... | |
struct ast_vector_string * | ast_cli_completion_vector (const char *text, const char *word) |
Generates a vector of strings for CLI completion. More... | |
char * | ast_cli_generator (const char *, const char *, int) |
Readline madness Useful for readline, that's about it. More... | |
void | ast_cli_print_timestr_fromseconds (int fd, int seconds, const char *prefix) |
Print on cli a duration in seconds in format s year(s), s week(s), s day(s), s hour(s), s second(s) More... | |
int | ast_cli_unregister (struct ast_cli_entry *e) |
Unregisters a command or an array of commands. More... | |
int | ast_cli_unregister_multiple (struct ast_cli_entry *e, int len) |
Unregister multiple commands. More... | |
char * | ast_complete_channels (const char *line, const char *word, int pos, int state, int rpos) |
Command completion for the list of active channels. More... | |
Standard Command Line Interface.
Definition in file cli.h.
#define ast_cli_command | ( | fd, | |
s | |||
) | ast_cli_command_full(CLI_NO_PERMS, CLI_NO_PERMS, fd, s) |
#define ast_cli_command_multiple | ( | fd, | |
size, | |||
s | |||
) | ast_cli_command_multiple_full(CLI_NO_PERMS, CLI_NO_PERMS, fd, size, s) |
#define AST_CLI_COMPLETE_EOF "_EOF_" |
Definition at line 52 of file cli.h.
Referenced by ast_el_strtoarr(), cli_complete(), and handle_commandmatchesarray().
#define AST_CLI_DEFINE | ( | fn, | |
txt, | |||
... | |||
) | { .handler = fn, .summary = txt, ## __VA_ARGS__ } |
Definition at line 197 of file cli.h.
Referenced by action_dahdishowchannels(), ao2_container_unregister(), ao2_weakproxy_unsubscribe(), dahdi_cc_callback(), and threadstorage_init().
#define AST_CLI_ONOFF | ( | x | ) | (x) ? "On" : "Off" |
return On or Off depending on the argument. This is used in many places in CLI command, having a function to generate this helps maintaining a consistent output (and possibly emitting the output in other languages, at some point).
Definition at line 78 of file cli.h.
Referenced by sip_show_settings(), and sorcery_memory_cache_show().
#define ast_cli_register | ( | e | ) | __ast_cli_register(e, AST_MODULE_SELF) |
Registers a command or an array of commands.
e | which cli entry to register. Register your own command |
0 | on success |
-1 | on failure |
Definition at line 256 of file cli.h.
Referenced by ast_xmldoc_load_documentation(), load_config(), and load_module().
#define ast_cli_register_multiple | ( | e, | |
len | |||
) | __ast_cli_register_multiple(e, len, AST_MODULE_SELF) |
Register multiple commands.
e | pointer to first cli entry to register |
len | number of entries to register |
Definition at line 265 of file cli.h.
Referenced by __init_manager(), aco_init(), ast_aoc_cli_init(), ast_ari_cli_register(), ast_bridging_init(), ast_builtins_init(), ast_channels_init(), ast_codec_init(), ast_file_init(), ast_image_init(), ast_local_init(), ast_media_cache_init(), ast_res_pjsip_init_options_handling(), ast_res_pjsip_initialize_configuration(), ast_sip_initialize_cli(), ast_sip_initialize_distributor(), ast_sip_initialize_scheduler(), ast_sip_initialize_sorcery_auth(), ast_sip_initialize_sorcery_location(), ast_sip_initialize_sorcery_transport(), ast_stun_init(), ast_test_init(), ast_timing_init(), ast_tps_init(), ast_translate_init(), ast_utils_init(), astdb_init(), asterisk_daemon(), astobj2_init(), cli_init(), conf_load_config(), container_init(), crypto_init(), iax_provision_init(), init_logger(), load_features_config(), load_module(), load_parking_ui(), load_pbx(), load_pbx_app(), load_pbx_functions_cli(), load_pbx_hangup_handler(), load_pbx_switch(), load_pbx_variables(), my_load_module(), pjsip_channel_cli_register(), register_config_cli(), stasis_init(), stir_shaken_certificate_load(), stir_shaken_general_load(), stir_shaken_store_load(), and threadstorage_init().
#define AST_CLI_YESNO | ( | x | ) | AST_YESNO(x) |
Return Yes or No depending on the argument.
Note that this should probably still be used for CLI commands instead of AST_YESNO(), in the off chance we someday want to translate the CLI.
x | Boolean value |
Definition at line 71 of file cli.h.
Referenced by _sip_show_peer(), action_coresettings(), agent_handle_show_specific(), ari_show(), ari_show_user(), comedia_string(), display_nat_warning(), force_rport_string(), handle_bridge_technology_show(), handle_cli_confbridge_list(), handle_cli_presencestate_list(), handle_cli_rtp_settings(), handle_cli_show_config(), handle_manager_show_settings(), handle_skel_show_config(), handle_skinny_show_settings(), show_channels_cb(), show_users_cb(), sip_show_channel(), sip_show_mwi(), sip_show_settings(), sip_show_user(), and sip_show_users().
#define AST_MAX_ARGS 64 |
Definition at line 50 of file cli.h.
Referenced by __ast_cli_generator(), ast_cli_command_full(), and handle_cli_check_permissions().
#define AST_MAX_CMD_LEN 16 |
Definition at line 48 of file cli.h.
Referenced by __ast_cli_register(), check_blacklist(), and find_best().
#define CLI_FAILURE (char *)RESULT_FAILURE |
Definition at line 46 of file cli.h.
Referenced by _sip_show_peers(), ari_mkpasswd(), ari_set_debug(), ari_show(), ari_show_app(), ari_show_apps(), ari_show_user(), ari_show_users(), ast_cli_command_full(), ast_sip_cli_traverse_objects(), cli_console_active(), cli_console_answer(), cli_console_autoanswer(), cli_console_dial(), cli_console_flash(), cli_console_hangup(), cli_console_mute(), cli_console_sendtext(), cli_list_subscriptions_inout(), cli_notify(), cli_odbc_read(), cli_odbc_write(), cli_qualify(), cli_realtime_destroy(), cli_realtime_store(), cli_realtime_update(), cli_realtime_update2(), cli_register(), cli_reload_qualify_aor(), cli_reload_qualify_endpoint(), cli_show_qualify_aor(), cli_show_qualify_endpoint(), cli_show_settings(), cli_show_subscriptions_inout(), cli_show_tasks(), cli_subsystem_alert_report(), cli_tps_ping(), cli_unregister(), complete_ari_app(), complete_ari_user(), console_answer(), console_autoanswer(), console_cmd(), console_dial(), console_do_answer(), console_flash(), console_hangup(), console_sendtext(), console_transfer(), corosync_ping(), corosync_show_members(), dahdi_cc_callback(), dahdi_create_channels(), dahdi_destroy_channels(), dahdi_restart_cmd(), dahdi_set_dnd(), dahdi_set_hwgain(), dahdi_set_swgain(), dahdi_show_channel(), dahdi_show_status(), handle_cc_status(), handle_cli_ael_reload(), handle_cli_agi_add_cmd(), handle_cli_agi_show(), handle_cli_amihook_register_hook(), handle_cli_amihook_send(), handle_cli_amihook_unregister_hook(), handle_cli_check_permissions(), handle_cli_confbridge_start_record(), handle_cli_core_show_channeltype(), handle_cli_core_show_translation(), handle_cli_devstate_change(), handle_cli_dialplan_add_extension(), handle_cli_dialplan_add_ignorepat(), handle_cli_dialplan_add_include(), handle_cli_dialplan_remove_extension(), handle_cli_dialplan_remove_ignorepat(), handle_cli_dialplan_remove_include(), handle_cli_dialplan_save(), handle_cli_file_convert(), handle_cli_iax2_set_debug(), handle_cli_iax2_show_peers(), handle_cli_indication_add(), handle_cli_indication_remove(), handle_cli_presencestate_change(), handle_cli_realtime_pgsql_status(), handle_cli_rtp_drop_incoming_packets(), handle_cli_sched_bench(), handle_cli_sec_evt_test(), handle_cli_show_config(), handle_cli_sound_show(), handle_cli_sounds_show(), handle_cli_status(), handle_cli_submit(), handle_cli_ulimit(), handle_commandmatchesarray(), handle_debug_dialplan(), handle_debug_or_trace(), handle_dump_docs(), handle_export_primitives(), handle_load(), handle_logger_add_channel(), handle_logger_reload(), handle_logger_remove_channel(), handle_logger_rotate(), handle_minivm_list_templates(), handle_minivm_show_users(), handle_minivm_show_zones(), handle_queue_add_member(), handle_queue_change_priority_caller(), handle_queue_pause_member(), handle_queue_remove_member(), handle_queue_set_member_penalty(), handle_queue_set_member_ringinuse(), handle_redirect(), handle_set_chanvar(), handle_show_application(), handle_show_chanvar(), handle_show_dialplan(), handle_show_function(), handle_show_hangup_all(), handle_show_hangup_channel(), handle_show_locks(), handle_show_translation_path(), handle_showchan(), handle_showmancmd(), handle_softhangup(), handle_unload(), handle_voicemail_show_users(), handle_voicemail_show_zones(), meetme_cmd_helper(), meetme_show_cmd(), orig_app(), orig_exten(), pjsip_show_history(), prometheus_show_metrics(), realtime_ldap_status(), rtcp_do_debug_ip(), rtp_do_debug_ip(), show_users_realtime(), sip_cli_notify(), sorcery_memory_cache_cli_thrash(), sorcery_memory_cache_dump(), sorcery_memory_cache_expire(), sorcery_memory_cache_populate(), sorcery_memory_cache_show(), sorcery_memory_cache_stale(), stasis_show_topic(), statistics_show_subscription(), statistics_show_subscriptions(), statistics_show_topic(), statistics_show_topics(), timing_test(), xmpp_cli_create_collection(), xmpp_cli_create_leafnode(), xmpp_cli_delete_pubsub_node(), xmpp_cli_list_pubsub_nodes(), and xmpp_cli_purge_pubsub_nodes().
#define CLI_NO_PERMS -1 |
Definition at line 38 of file cli.h.
Referenced by cli_has_permissions().
#define CLI_SHOWUSAGE (char *)RESULT_SHOWUSAGE |
Definition at line 45 of file cli.h.
Referenced by __queues_show(), __say_cli_init(), _sip_qualify_peer(), _sip_show_peer(), _sip_show_peers(), _skinny_message_clear(), _skinny_message_set(), _skinny_show_device(), _skinny_show_devices(), _skinny_show_line(), _skinny_show_lines(), action_dahdishowchannels(), agent_handle_logoff_cmd(), agent_handle_show_all(), agent_handle_show_online(), agent_handle_show_specific(), ao2_container_unregister(), ao2_weakproxy_unsubscribe(), aoc_cli_debug_enable(), ari_mkpasswd(), ari_set_debug(), ari_show(), ari_show_app(), ari_show_apps(), ari_show_user(), ari_show_users(), ast_cli_command_full(), ast_sip_cli_traverse_objects(), cli_console_active(), cli_console_answer(), cli_console_autoanswer(), cli_console_dial(), cli_console_flash(), cli_console_hangup(), cli_console_mute(), cli_console_sendtext(), cli_dump_endpt(), cli_fax_set_debug(), cli_fax_show_session(), cli_fax_show_version(), cli_list_available(), cli_list_devices(), cli_list_subscriptions_inout(), cli_notify(), cli_odbc_read(), cli_odbc_write(), cli_qualify(), cli_realtime_destroy(), cli_realtime_load(), cli_realtime_store(), cli_realtime_update(), cli_realtime_update2(), cli_register(), cli_reload_qualify_aor(), cli_reload_qualify_endpoint(), cli_show_endpoint_identifiers(), cli_show_help(), cli_show_qualify_aor(), cli_show_qualify_endpoint(), cli_show_subscription_inout(), cli_show_subscriptions_inout(), cli_show_tasks(), cli_subsystem_alert_report(), cli_tps_ping(), cli_tps_report(), cli_tps_reset_stats(), cli_tps_reset_stats_all(), cli_unregister(), console_active(), console_answer(), console_autoanswer(), console_cmd(), console_dial(), console_flash(), console_hangup(), console_mute(), console_sendtext(), console_transfer(), corosync_ping(), corosync_show_config(), corosync_show_members(), dahdi_cc_callback(), dahdi_create_channels(), dahdi_destroy_channels(), dahdi_restart_cmd(), dahdi_set_dnd(), dahdi_set_hwgain(), dahdi_set_swgain(), dahdi_show_channel(), dahdi_show_channels(), dundi_do_lookup(), dundi_do_precache(), dundi_do_query(), dundi_flush(), dundi_set_debug(), dundi_show_cache(), dundi_show_entityid(), dundi_show_hints(), dundi_show_mappings(), dundi_show_peer(), dundi_show_peers(), dundi_show_precache(), dundi_show_requests(), dundi_show_trans(), dundi_store_history(), group_show_channels(), handle_abort_shutdown(), handle_bridge_destroy_specific(), handle_bridge_kick_channel(), handle_bridge_show_specific(), handle_bridge_technology_suspend(), handle_cc_kill(), handle_cc_status(), handle_cdr_pgsql_status(), handle_chanlist(), handle_cli_ael_reload(), handle_cli_ael_set_debug(), handle_cli_agi_add_cmd(), handle_cli_agi_debug(), handle_cli_agi_dump_html(), handle_cli_agi_show(), handle_cli_cdr_mysql_status(), handle_cli_check_permissions(), handle_cli_confbridge_kick(), handle_cli_confbridge_list(), handle_cli_confbridge_lock(), handle_cli_confbridge_mute(), handle_cli_confbridge_show_bridge_profile(), handle_cli_confbridge_show_menu(), handle_cli_confbridge_show_user_profile(), handle_cli_confbridge_start_record(), handle_cli_confbridge_stop_record(), handle_cli_confbridge_unlock(), handle_cli_confbridge_unmute(), handle_cli_config_reload(), handle_cli_core_show_channeltype(), handle_cli_core_show_channeltypes(), handle_cli_core_show_file_formats(), handle_cli_core_show_translation(), handle_cli_database_del(), handle_cli_database_deltree(), handle_cli_database_get(), handle_cli_database_put(), handle_cli_database_query(), handle_cli_database_show(), handle_cli_database_showkey(), handle_cli_debug(), handle_cli_devstate_change(), handle_cli_devstate_list(), handle_cli_dialplan_add_extension(), handle_cli_dialplan_add_ignorepat(), handle_cli_dialplan_add_include(), handle_cli_dialplan_reload(), handle_cli_dialplan_remove_context(), handle_cli_dialplan_remove_extension(), handle_cli_dialplan_remove_ignorepat(), handle_cli_dialplan_remove_include(), handle_cli_dialplan_save(), handle_cli_file_convert(), handle_cli_iax2_provision(), handle_cli_iax2_prune_realtime(), handle_cli_iax2_set_debug(), handle_cli_iax2_set_debug_jb(), handle_cli_iax2_set_debug_trunk(), handle_cli_iax2_set_mtu(), handle_cli_iax2_show_callno_limits(), handle_cli_iax2_show_channels(), handle_cli_iax2_show_firmware(), handle_cli_iax2_show_netstats(), handle_cli_iax2_show_peer(), handle_cli_iax2_show_peers(), handle_cli_iax2_show_registry(), handle_cli_iax2_show_stats(), handle_cli_iax2_show_threads(), handle_cli_iax2_show_users(), handle_cli_iax2_test_losspct(), handle_cli_iax2_unregister(), handle_cli_indication_add(), handle_cli_indication_remove(), handle_cli_keys_init(), handle_cli_misdn_port_block(), handle_cli_misdn_port_down(), handle_cli_misdn_port_unblock(), handle_cli_misdn_port_up(), handle_cli_misdn_reload(), handle_cli_misdn_restart_pid(), handle_cli_misdn_restart_port(), handle_cli_misdn_send_digit(), handle_cli_misdn_send_display(), handle_cli_misdn_send_facility(), handle_cli_misdn_send_restart(), handle_cli_misdn_set_crypt_debug(), handle_cli_misdn_set_debug(), handle_cli_misdn_set_tics(), handle_cli_misdn_show_channel(), handle_cli_misdn_show_channels(), handle_cli_misdn_show_config(), handle_cli_misdn_show_port(), handle_cli_misdn_show_ports_stats(), handle_cli_misdn_show_stacks(), handle_cli_misdn_toggle_echocancel(), handle_cli_mixmonitor(), handle_cli_mobile_cusd(), handle_cli_mobile_rfcomm(), handle_cli_mobile_search(), handle_cli_mobile_show_devices(), handle_cli_moh_reload(), handle_cli_moh_show_classes(), handle_cli_moh_show_files(), handle_cli_moh_unregister_class(), handle_cli_ooh323_reload(), handle_cli_ooh323_set_debug(), handle_cli_ooh323_show_config(), handle_cli_ooh323_show_gk(), handle_cli_ooh323_show_peer(), handle_cli_ooh323_show_peers(), handle_cli_ooh323_show_user(), handle_cli_ooh323_show_users(), handle_cli_osp_show(), handle_cli_presencestate_change(), handle_cli_presencestate_list(), handle_cli_realtime_mysql_status(), handle_cli_realtime_pgsql_status(), handle_cli_refresh(), handle_cli_reload(), handle_cli_rtcp_set_debug(), handle_cli_rtcp_set_stats(), handle_cli_rtp_drop_incoming_packets(), handle_cli_rtp_set_debug(), handle_cli_rtp_settings(), handle_cli_sched_bench(), handle_cli_show(), handle_cli_show_sqlite_status(), handle_cli_sound_show(), handle_cli_sounds_show(), handle_cli_sqlite_show_tables(), handle_cli_status(), handle_cli_stun_set_debug(), handle_cli_stun_show_status(), handle_cli_submit(), handle_cli_test_locales(), handle_cli_transcoder_show(), handle_cli_udptl_set_debug(), handle_cli_ulimit(), handle_commandmatchesarray(), handle_core_reload(), handle_core_set_debug_channel(), handle_core_show_image_formats(), handle_debug_category(), handle_debug_dialplan(), handle_debug_or_trace(), handle_dump_docs(), handle_load(), handle_logger_add_channel(), handle_logger_mute(), handle_logger_remove_channel(), handle_logger_set_level(), handle_manager_reload(), handle_manager_show_event(), handle_manager_show_events(), handle_manager_show_settings(), handle_mandebug(), handle_mgcp_audit_endpoint(), handle_mgcp_set_debug(), handle_mgcp_show_endpoints(), handle_minivm_list_templates(), handle_minivm_show_users(), handle_minivm_show_zones(), handle_modlist(), handle_nodebugchan_deprecated(), handle_orig(), handle_pjproject_set_log_level(), handle_pjproject_show_log_level(), handle_queue_add_member(), handle_queue_change_priority_caller(), handle_queue_pause_member(), handle_queue_reload(), handle_queue_remove_member(), handle_queue_reset(), handle_queue_rule_show(), handle_queue_set_member_penalty(), handle_queue_set_member_ringinuse(), handle_redirect(), handle_remb_set(), handle_restart_gracefully(), handle_restart_now(), handle_restart_when_convenient(), handle_set_chanvar(), handle_set_extenpatternmatchnew(), handle_set_global(), handle_show_application(), handle_show_calendar(), handle_show_chanvar(), handle_show_dialplan(), handle_show_function(), handle_show_functions(), handle_show_hangup_all(), handle_show_hangup_channel(), handle_show_hint(), handle_show_http(), handle_show_named_acl_cmd(), handle_show_parking_lot_cmd(), handle_showcalls(), handle_showchan(), handle_showmanager(), handle_showmanagers(), handle_showmancmd(), handle_showuptime(), handle_skinny_reload(), handle_skinny_reset(), handle_skinny_set_debug(), handle_skinny_show_lines(), handle_skinny_show_settings(), handle_softhangup(), handle_stop_gracefully(), handle_stop_now(), handle_stop_when_convenient(), handle_unload(), handle_unset_extenpatternmatchnew(), handle_verbose(), handle_version(), handle_voicemail_reload(), handle_voicemail_show_aliases(), handle_voicemail_show_users(), handle_voicemail_show_zones(), iax_show_provisioning(), locals_show(), media_cache_handle_create_item(), media_cache_handle_delete_item(), media_cache_handle_refresh_item(), media_cache_handle_show_all(), media_cache_handle_show_item(), meetme_cmd_helper(), meetme_kick_cmd(), meetme_lock_cmd(), meetme_mute_cmd(), meetme_show_cmd(), orig_app(), orig_exten(), pjsip_enable_logger_host(), pjsip_set_history(), pjsip_set_logger(), pjsip_show_history(), pktccops_debug(), pktccops_gatedel(), pktccops_gateset(), prometheus_show_metrics(), prometheus_show_status(), show_codec(), show_codecs(), sip_cli_notify(), sip_do_debug(), sip_do_debug_ip(), sip_prune_realtime(), sip_set_history(), sip_show_channel(), sip_show_channels(), sip_show_channelstats(), sip_show_history(), sip_show_inuse(), sip_show_objects(), sip_show_registry(), sip_show_settings(), sip_show_tcp(), sip_show_user(), sip_show_users(), sip_unregister(), sorcery_memory_cache_cli_thrash(), sorcery_memory_cache_dump(), sorcery_memory_cache_expire(), sorcery_memory_cache_populate(), sorcery_memory_cache_show(), sorcery_memory_cache_stale(), stasis_show_topic(), stasis_show_topics(), statistics_show_messages(), statistics_show_subscription(), statistics_show_subscriptions(), statistics_show_topic(), statistics_show_topics(), stir_shaken_certificate_show(), stir_shaken_certificate_show_all(), stir_shaken_general_show(), stir_shaken_store_show(), test_cli_execute_registered(), test_cli_generate_results(), test_cli_show_registered(), test_cli_show_results(), threadstorage_init(), timing_test(), unistim_do_debug(), unistim_reload(), unistim_show_devices(), unistim_show_info(), unistim_sp(), xmpp_cli_create_collection(), xmpp_cli_create_leafnode(), xmpp_cli_delete_pubsub_node(), xmpp_cli_list_pubsub_nodes(), xmpp_cli_purge_pubsub_nodes(), and xmpp_do_set_debug().
#define CLI_SUCCESS (char *)RESULT_SUCCESS |
Definition at line 44 of file cli.h.
Referenced by __queues_show(), __say_cli_init(), _sip_qualify_peer(), _sip_show_peer(), _sip_show_peers(), _skinny_message_clear(), _skinny_message_set(), _skinny_show_device(), _skinny_show_devices(), _skinny_show_line(), _skinny_show_lines(), action_dahdishowchannels(), agent_handle_logoff_cmd(), agent_handle_show_all(), agent_handle_show_online(), agent_handle_show_specific(), alias_show(), ao2_container_unregister(), ao2_weakproxy_unsubscribe(), aoc_cli_debug_enable(), ari_mkpasswd(), ari_set_debug(), ari_show(), ari_show_app(), ari_show_apps(), ari_show_user(), ari_show_users(), ast_cli_command_full(), ast_sip_cli_traverse_objects(), check_debug(), cli_alias_passthrough(), cli_console_active(), cli_console_answer(), cli_console_autoanswer(), cli_console_dial(), cli_console_flash(), cli_console_hangup(), cli_console_mute(), cli_console_sendtext(), cli_dump_endpt(), cli_fax_set_debug(), cli_fax_show_capabilities(), cli_fax_show_session(), cli_fax_show_sessions(), cli_fax_show_settings(), cli_fax_show_stats(), cli_fax_show_version(), cli_list_available(), cli_list_devices(), cli_list_subscriptions_inout(), cli_notify(), cli_odbc_read(), cli_odbc_write(), cli_qualify(), cli_realtime_destroy(), cli_realtime_load(), cli_realtime_store(), cli_realtime_update(), cli_realtime_update2(), cli_register(), cli_reload_qualify_aor(), cli_reload_qualify_endpoint(), cli_show_endpoint_identifiers(), cli_show_help(), cli_show_qualify_aor(), cli_show_qualify_endpoint(), cli_show_settings(), cli_show_subscription_inout(), cli_show_subscriptions_inout(), cli_show_tasks(), cli_subsystem_alert_report(), cli_tps_ping(), cli_tps_report(), cli_tps_reset_stats(), cli_tps_reset_stats_all(), cli_unregister(), console_active(), console_answer(), console_autoanswer(), console_boost(), console_cmd(), console_dial(), console_do_answer(), console_flash(), console_hangup(), console_mute(), console_sendtext(), console_transfer(), corosync_ping(), corosync_show_config(), corosync_show_members(), dahdi_cc_callback(), dahdi_create_channels(), dahdi_destroy_channels(), dahdi_restart_cmd(), dahdi_set_dnd(), dahdi_set_hwgain(), dahdi_set_swgain(), dahdi_show_channel(), dahdi_show_channels(), dahdi_show_status(), dahdi_show_version(), dundi_do_lookup(), dundi_do_precache(), dundi_do_query(), dundi_flush(), dundi_set_debug(), dundi_show_cache(), dundi_show_entityid(), dundi_show_hints(), dundi_show_mappings(), dundi_show_peer(), dundi_show_peers(), dundi_show_precache(), dundi_show_requests(), dundi_show_trans(), dundi_store_history(), group_show_channels(), handle_abort_shutdown(), handle_bang(), handle_bridge_destroy_specific(), handle_bridge_kick_channel(), handle_bridge_show_all(), handle_bridge_show_specific(), handle_bridge_technology_show(), handle_bridge_technology_suspend(), handle_cc_kill(), handle_cc_status(), handle_cdr_pgsql_status(), handle_chanlist(), handle_clear_profile(), handle_cli_ael_reload(), handle_cli_ael_set_debug(), handle_cli_agi_add_cmd(), handle_cli_agi_debug(), handle_cli_agi_dump_html(), handle_cli_agi_show(), handle_cli_amihook_register_hook(), handle_cli_amihook_send(), handle_cli_amihook_unregister_hook(), handle_cli_cdr_mysql_status(), handle_cli_check_permissions(), handle_cli_confbridge_kick(), handle_cli_confbridge_list(), handle_cli_confbridge_lock(), handle_cli_confbridge_mute(), handle_cli_confbridge_show_bridge_profile(), handle_cli_confbridge_show_bridge_profiles(), handle_cli_confbridge_show_menu(), handle_cli_confbridge_show_menus(), handle_cli_confbridge_show_user_profile(), handle_cli_confbridge_show_user_profiles(), handle_cli_confbridge_start_record(), handle_cli_confbridge_stop_record(), handle_cli_confbridge_unlock(), handle_cli_confbridge_unmute(), handle_cli_config_list(), handle_cli_config_reload(), handle_cli_core_show_channeltype(), handle_cli_core_show_channeltypes(), handle_cli_core_show_config_mappings(), handle_cli_core_show_file_formats(), handle_cli_database_del(), handle_cli_database_deltree(), handle_cli_database_get(), handle_cli_database_put(), handle_cli_database_query(), handle_cli_database_show(), handle_cli_database_showkey(), handle_cli_debug(), handle_cli_devstate_change(), handle_cli_devstate_list(), handle_cli_dialplan_add_extension(), handle_cli_dialplan_add_ignorepat(), handle_cli_dialplan_add_include(), handle_cli_dialplan_reload(), handle_cli_dialplan_remove_context(), handle_cli_dialplan_remove_extension(), handle_cli_dialplan_remove_ignorepat(), handle_cli_dialplan_remove_include(), handle_cli_dialplan_save(), handle_cli_dynamic_level_test(), handle_cli_file_convert(), handle_cli_iax2_provision(), handle_cli_iax2_prune_realtime(), handle_cli_iax2_reload(), handle_cli_iax2_set_debug(), handle_cli_iax2_set_debug_jb(), handle_cli_iax2_set_debug_trunk(), handle_cli_iax2_set_mtu(), handle_cli_iax2_show_cache(), handle_cli_iax2_show_callno_limits(), handle_cli_iax2_show_channels(), handle_cli_iax2_show_firmware(), handle_cli_iax2_show_netstats(), handle_cli_iax2_show_peer(), handle_cli_iax2_show_peers(), handle_cli_iax2_show_registry(), handle_cli_iax2_show_stats(), handle_cli_iax2_show_threads(), handle_cli_iax2_show_users(), handle_cli_iax2_test_losspct(), handle_cli_iax2_unregister(), handle_cli_indication_add(), handle_cli_indication_remove(), handle_cli_indication_show(), handle_cli_keys_init(), handle_cli_keys_show(), handle_cli_malloc_trim(), handle_cli_misdn_port_block(), handle_cli_misdn_port_down(), handle_cli_misdn_port_unblock(), handle_cli_misdn_port_up(), handle_cli_misdn_reload(), handle_cli_misdn_restart_pid(), handle_cli_misdn_restart_port(), handle_cli_misdn_send_digit(), handle_cli_misdn_send_display(), handle_cli_misdn_send_facility(), handle_cli_misdn_send_restart(), handle_cli_misdn_set_crypt_debug(), handle_cli_misdn_set_debug(), handle_cli_misdn_set_tics(), handle_cli_misdn_show_channel(), handle_cli_misdn_show_channels(), handle_cli_misdn_show_config(), handle_cli_misdn_show_port(), handle_cli_misdn_show_ports_stats(), handle_cli_misdn_show_stacks(), handle_cli_misdn_toggle_echocancel(), handle_cli_mixmonitor(), handle_cli_mobile_cusd(), handle_cli_mobile_rfcomm(), handle_cli_mobile_search(), handle_cli_mobile_show_devices(), handle_cli_moh_reload(), handle_cli_moh_show_classes(), handle_cli_moh_show_files(), handle_cli_moh_unregister_class(), handle_cli_odbc_show(), handle_cli_ooh323_set_debug(), handle_cli_ooh323_show_config(), handle_cli_ooh323_show_gk(), handle_cli_ooh323_show_peer(), handle_cli_ooh323_show_peers(), handle_cli_ooh323_show_user(), handle_cli_osp_show(), handle_cli_performance_test(), handle_cli_presencestate_change(), handle_cli_presencestate_list(), handle_cli_queue_test(), handle_cli_realtime_mysql_cache(), handle_cli_realtime_mysql_status(), handle_cli_realtime_pgsql_status(), handle_cli_refresh(), handle_cli_reload(), handle_cli_reload_permissions(), handle_cli_rtcp_set_debug(), handle_cli_rtcp_set_stats(), handle_cli_rtp_drop_incoming_packets(), handle_cli_rtp_set_debug(), handle_cli_rtp_settings(), handle_cli_sched_bench(), handle_cli_sec_evt_test(), handle_cli_show(), handle_cli_show_config(), handle_cli_show_permissions(), handle_cli_show_sqlite_status(), handle_cli_sound_show(), handle_cli_sounds_show(), handle_cli_sqlite_show_tables(), handle_cli_status(), handle_cli_stun_set_debug(), handle_cli_stun_show_status(), handle_cli_submit(), handle_cli_test_locales(), handle_cli_transcoder_show(), handle_cli_udptl_set_debug(), handle_cli_ulimit(), handle_cli_wait_fullybooted(), handle_commandmatchesarray(), handle_core_reload(), handle_core_set_debug_channel(), handle_core_show_image_formats(), handle_dahdi_show_cadences(), handle_debug_category(), handle_debug_dialplan(), handle_debug_or_trace(), handle_dump_docs(), handle_dump_sched(), handle_export_primitives(), handle_feature_show(), handle_help(), handle_load(), handle_logger_add_channel(), handle_logger_mute(), handle_logger_reload(), handle_logger_remove_channel(), handle_logger_rotate(), handle_logger_set_level(), handle_logger_show_channels(), handle_manager_reload(), handle_manager_show_event(), handle_manager_show_events(), handle_manager_show_settings(), handle_mandebug(), handle_mgcp_audit_endpoint(), handle_mgcp_set_debug(), handle_mgcp_show_endpoints(), handle_minivm_list_templates(), handle_minivm_reload(), handle_minivm_show_settings(), handle_minivm_show_stats(), handle_minivm_show_users(), handle_minivm_show_zones(), handle_modlist(), handle_pjproject_set_log_level(), handle_pjproject_show_buildopts(), handle_pjproject_show_log_level(), handle_pjproject_show_log_mappings(), handle_pjsip_show_version(), handle_queue_add_member(), handle_queue_change_priority_caller(), handle_queue_pause_member(), handle_queue_reload(), handle_queue_remove_member(), handle_queue_reset(), handle_queue_rule_show(), handle_queue_set_member_penalty(), handle_queue_set_member_ringinuse(), handle_redirect(), handle_reload(), handle_remb_set(), handle_restart_gracefully(), handle_restart_now(), handle_restart_when_convenient(), handle_set_chanvar(), handle_set_extenpatternmatchnew(), handle_set_global(), handle_show_application(), handle_show_applications(), handle_show_calendar(), handle_show_calendars(), handle_show_calendars_types(), handle_show_chanvar(), handle_show_device2extenstate(), handle_show_dialplan(), handle_show_function(), handle_show_functions(), handle_show_globals(), handle_show_hangup_all(), handle_show_hangup_channel(), handle_show_hint(), handle_show_hints(), handle_show_http(), handle_show_locks(), handle_show_named_acl_cmd(), handle_show_parking_lot_cmd(), handle_show_profile(), handle_show_settings(), handle_show_switches(), handle_show_sysinfo(), handle_show_threads(), handle_show_translation_path(), handle_show_translation_table(), handle_showchan(), handle_showmanager(), handle_showmanagers(), handle_showmancmd(), handle_showmancmds(), handle_showmanconn(), handle_showmaneventq(), handle_showuptime(), handle_skel_show_config(), handle_skel_show_games(), handle_skel_show_levels(), handle_skinny_reload(), handle_skinny_reset(), handle_skinny_set_debug(), handle_skinny_show_settings(), handle_softhangup(), handle_stop_gracefully(), handle_stop_now(), handle_stop_when_convenient(), handle_unload(), handle_unset_extenpatternmatchnew(), handle_verbose(), handle_version(), handle_voicemail_reload(), handle_voicemail_show_aliases(), handle_voicemail_show_users(), handle_voicemail_show_zones(), help1(), help_workhorse(), iax_show_provisioning(), locals_show(), media_cache_handle_create_item(), media_cache_handle_delete_item(), media_cache_handle_refresh_item(), media_cache_handle_show_all(), media_cache_handle_show_item(), meetme_cmd_helper(), meetme_show_cmd(), mgcp_reload(), orig_app(), orig_exten(), pjsip_disable_logger(), pjsip_enable_logger_all(), pjsip_enable_logger_host(), pjsip_set_history(), pjsip_set_logger_pcap(), pjsip_set_logger_verbose(), pjsip_show_history(), pktccops_debug(), pktccops_gatedel(), pktccops_gateset(), pktccops_show_cmtses(), pktccops_show_gates(), pktccops_show_pools(), prometheus_show_metrics(), prometheus_show_status(), realtime_ldap_status(), rtcp_do_debug_ip(), rtp_do_debug_ip(), show_codec(), show_codecs(), show_license(), show_users_realtime(), show_warranty(), sip_cli_notify(), sip_do_debug(), sip_do_debug_ip(), sip_do_debug_peer(), sip_prune_realtime(), sip_reload(), sip_set_history(), sip_show_channel(), sip_show_channels(), sip_show_channelstats(), sip_show_domains(), sip_show_history(), sip_show_inuse(), sip_show_mwi(), sip_show_objects(), sip_show_registry(), sip_show_sched(), sip_show_settings(), sip_show_tcp(), sip_show_user(), sip_show_users(), sip_unregister(), sla_show_stations(), sla_show_trunks(), sorcery_memory_cache_cli_thrash(), sorcery_memory_cache_dump(), sorcery_memory_cache_expire(), sorcery_memory_cache_populate(), sorcery_memory_cache_show(), sorcery_memory_cache_stale(), spandsp_fax_cli_show_capabilities(), spandsp_fax_cli_show_session(), spandsp_fax_cli_show_settings(), spandsp_fax_cli_show_stats(), stasis_show_topic(), stasis_show_topics(), statistics_show_messages(), statistics_show_subscription(), statistics_show_subscriptions(), statistics_show_topic(), statistics_show_topics(), stir_shaken_certificate_show(), stir_shaken_certificate_show_all(), stir_shaken_general_show(), stir_shaken_store_show(), test_cli_execute_registered(), test_cli_generate_results(), test_cli_show_registered(), test_cli_show_results(), threadstorage_init(), timing_test(), tls_method_to_str(), unistim_do_debug(), unistim_reload(), unistim_show_devices(), unistim_show_info(), unistim_sp(), xmpp_cli_create_collection(), xmpp_cli_create_leafnode(), xmpp_cli_delete_pubsub_node(), xmpp_cli_list_pubsub_nodes(), xmpp_cli_purge_pubsub_nodes(), xmpp_do_set_debug(), xmpp_show_buddies(), and xmpp_show_clients().
#define ESS | ( | x | ) | ((x) == 1 ? "" : "s") |
In many cases we need to print singular or plural words depending on a count. This macro helps us e.g. printf("we have %d object%s", n, ESS(n));
Definition at line 59 of file cli.h.
Referenced by cli_realtime_destroy(), cli_realtime_update(), cli_realtime_update2(), group_show_channels(), handle_chanlist(), handle_cli_status(), handle_showcalls(), print_uptimestr(), and sip_show_channels().
#define RESULT_FAILURE 2 |
Definition at line 42 of file cli.h.
Referenced by agi_handle_command(), ast_cli_command_full(), dahdi_create_channel_range(), get_member_penalty(), handle_answer(), handle_cli_iax2_show_peers(), handle_controlstreamfile(), handle_getoption(), handle_gosub(), handle_queue_set_member_penalty(), handle_queue_set_member_ringinuse(), handle_recordfile(), handle_recvchar(), handle_sayalpha(), handle_saydate(), handle_saydatetime(), handle_saydigits(), handle_saynumber(), handle_sayphonetic(), handle_saytime(), handle_sendimage(), handle_sendtext(), handle_speechcreate(), handle_streamfile(), handle_waitfordigit(), set_member_paused(), and set_member_value().
#define RESULT_SHOWUSAGE 1 |
Definition at line 41 of file cli.h.
Referenced by __iax2_show_peers(), agi_handle_command(), handle_autohangup(), handle_channelstatus(), handle_cli_iax2_show_peers(), handle_controlstreamfile(), handle_dbdel(), handle_dbdeltree(), handle_dbget(), handle_dbput(), handle_exec(), handle_getdata(), handle_getoption(), handle_getvariable(), handle_getvariablefull(), handle_gosub(), handle_hangup(), handle_recordfile(), handle_recvchar(), handle_recvtext(), handle_sayalpha(), handle_saydate(), handle_saydatetime(), handle_saydigits(), handle_saynumber(), handle_sayphonetic(), handle_saytime(), handle_sendimage(), handle_sendtext(), handle_setcontext(), handle_setextension(), handle_setmusic(), handle_setpriority(), handle_setvariable(), handle_speechactivategrammar(), handle_speechdeactivategrammar(), handle_speechloadgrammar(), handle_speechrecognize(), handle_speechset(), handle_speechunloadgrammar(), handle_streamfile(), handle_tddmode(), handle_verbose(), and handle_waitfordigit().
#define RESULT_SUCCESS 0 |
Definition at line 40 of file cli.h.
Referenced by __iax2_show_peers(), action_command(), agi_handle_command(), ast_cli_command_full(), cli_fax_show_session(), dahdi_create_channel_range(), dahdi_create_channels(), handle_answer(), handle_autohangup(), handle_channelstatus(), handle_cli_ooh323_set_debug(), handle_cli_ooh323_show_users(), handle_controlstreamfile(), handle_dbdel(), handle_dbdeltree(), handle_dbget(), handle_dbput(), handle_getdata(), handle_getoption(), handle_getvariable(), handle_getvariablefull(), handle_gosub(), handle_hangup(), handle_noop(), handle_queue_pause_member(), handle_queue_set_member_penalty(), handle_queue_set_member_ringinuse(), handle_recordfile(), handle_recvchar(), handle_recvtext(), handle_sayalpha(), handle_saydate(), handle_saydatetime(), handle_saydigits(), handle_saynumber(), handle_sayphonetic(), handle_saytime(), handle_sendimage(), handle_sendtext(), handle_setcallerid(), handle_setcontext(), handle_setextension(), handle_setmusic(), handle_setpriority(), handle_setvariable(), handle_showcalls(), handle_speechactivategrammar(), handle_speechcreate(), handle_speechdeactivategrammar(), handle_speechdestroy(), handle_speechloadgrammar(), handle_speechrecognize(), handle_speechset(), handle_speechunloadgrammar(), handle_streamfile(), handle_tddmode(), handle_verbose(), handle_waitfordigit(), locals_show(), manager_iax2_show_netstats(), manager_iax2_show_peer_list(), manager_list_voicemail_users(), manager_queue_rule_show(), manager_queues_status(), manager_queues_summary(), manager_status_voicemail_user(), manager_voicemail_refresh(), reload_config(), set_member_paused(), and set_member_value().
enum ast_cli_command |
int __ast_cli_register | ( | struct ast_cli_entry * | e, |
struct ast_module * | mod | ||
) |
Definition at line 2420 of file main/cli.c.
References ast_cli_entry::_full_cmd, ast_free, ast_log, AST_MAX_CMD_LEN, AST_RWLIST_INSERT_BEFORE_CURRENT, AST_RWLIST_INSERT_TAIL, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_skip_blanks(), ast_skip_nonblanks(), ast_strdup, ast_strlen_zero, CLI_INIT, cli_is_registered(), ast_cli_entry::cmda, ast_cli_entry::cmdlen, ast_cli_entry::command, done, find_cli(), ast_cli_entry::handler, len(), cli_perm::list, LOG_WARNING, ast_cli_entry::module, NULL, S_OR, and set_full_cmd().
Referenced by __ast_cli_register_multiple().
int __ast_cli_register_multiple | ( | struct ast_cli_entry * | e, |
int | len, | ||
struct ast_module * | mod | ||
) |
Definition at line 2497 of file main/cli.c.
References __ast_cli_register(), and len().
void ast_cli | ( | int | fd, |
const char * | fmt, | ||
... | |||
) |
Definition at line 6 of file clicompat.c.
References ast_register_atexit().
Referenced by __ast_test_status_update(), __iax2_show_peers(), __say_cli_init(), _iax2_show_peers_one(), _sip_qualify_peer(), _sip_show_peer(), _sip_show_peers(), _sip_show_peers_one(), _skinny_show_device(), _skinny_show_devices(), _skinny_show_line(), _skinny_show_lines(), _stun_show_status(), action_dahdishowchannels(), agent_handle_logoff_cmd(), agent_handle_show_specific(), agent_show_requested(), alias_show(), ao2_container_unregister(), ao2_weakproxy_unsubscribe(), aoc_cli_debug_enable(), ari_mkpasswd(), ari_set_debug(), ari_show(), ari_show_apps(), ari_show_user(), ari_show_users(), ast_acl_output(), ast_cli_command_full(), ast_cli_netstats(), ast_console_toggle_mute(), ast_ha_output(), ast_pbx_hangup_handler_headers(), ast_pbx_hangup_handler_show(), ast_sip_cli_traverse_objects(), ast_test_debug(), bridge_show_specific_print_channel(), cc_cli_output_status(), cc_cli_print_monitor_stats(), channel_set_debug(), cli_console_active(), cli_console_answer(), cli_console_autoanswer(), cli_console_dial(), cli_console_flash(), cli_console_hangup(), cli_console_mute(), cli_console_sendtext(), cli_display_named_acl(), cli_display_named_acl_list(), cli_display_parking_global(), cli_display_parking_lot(), cli_display_parking_lot_list(), cli_fax_set_debug(), cli_fax_show_capabilities(), cli_fax_show_session(), cli_fax_show_sessions(), cli_fax_show_settings(), cli_fax_show_stats(), cli_fax_show_version(), cli_list_available(), cli_list_devices(), cli_list_subscriptions_detail(), cli_list_subscriptions_inout(), cli_match_char_tree(), cli_mute_unmute_helper(), cli_notify(), cli_odbc_read(), cli_odbc_write(), cli_qualify(), cli_realtime_destroy(), cli_realtime_load(), cli_realtime_store(), cli_realtime_update(), cli_realtime_update2(), cli_register(), cli_reload_qualify_aor(), cli_reload_qualify_endpoint(), cli_show_channel(), cli_show_channels(), cli_show_endpoint_identifiers(), cli_show_module_options(), cli_show_module_type(), cli_show_module_types(), cli_show_modules(), cli_show_qualify_aor(), cli_show_qualify_endpoint(), cli_show_settings(), cli_show_subscription_common(), cli_show_subscriptions_detail(), cli_show_subscriptions_inout(), cli_show_tasks(), cli_subsystem_alert_report(), cli_tps_ping(), cli_tps_report(), cli_tps_reset_stats(), cli_tps_reset_stats_all(), cli_unregister(), complete_ari_app(), complete_ari_user(), console_active(), console_answer(), console_autoanswer(), console_boost(), console_cmd(), console_dial(), console_do_answer(), console_flash(), console_hangup(), console_mute(), console_sendtext(), console_transfer(), corosync_show_config(), corosync_show_members(), dahdi_cc_callback(), dahdi_create_channels(), dahdi_destroy_channels(), dahdi_set_dnd(), dahdi_set_hwgain(), dahdi_set_swgain(), dahdi_show_channel(), dahdi_show_channels(), dahdi_show_status(), dahdi_show_version(), dialog_dump_func(), display_entry_list(), display_parked_call(), display_parking_lot(), display_results(), display_single_entry(), do_print(), dump_str_and_free(), dundi_do_lookup(), dundi_do_precache(), dundi_do_query(), dundi_flush(), dundi_set_debug(), dundi_show_cache(), dundi_show_entityid(), dundi_show_hints(), dundi_show_mappings(), dundi_show_peer(), dundi_show_peers(), dundi_show_precache(), dundi_show_requests(), dundi_show_trans(), dundi_store_history(), firmware_show_callback(), gen_events(), group_show_channels(), handle_bridge_destroy_specific(), handle_bridge_kick_channel(), handle_bridge_show_all(), handle_bridge_show_specific(), handle_bridge_technology_show(), handle_bridge_technology_suspend(), handle_cdr_pgsql_status(), handle_chanlist(), handle_cli_agi_add_cmd(), handle_cli_agi_debug(), handle_cli_agi_dump_html(), handle_cli_agi_show(), handle_cli_cdr_mysql_status(), handle_cli_check_permissions(), handle_cli_confbridge_kick(), handle_cli_confbridge_list(), handle_cli_confbridge_list_item(), handle_cli_confbridge_lock(), handle_cli_confbridge_show_bridge_profile(), handle_cli_confbridge_show_bridge_profiles(), handle_cli_confbridge_show_menu(), handle_cli_confbridge_show_menus(), handle_cli_confbridge_show_user_profile(), handle_cli_confbridge_show_user_profiles(), handle_cli_confbridge_start_record(), handle_cli_confbridge_stop_record(), handle_cli_confbridge_unlock(), handle_cli_config_list(), handle_cli_core_show_channeltype(), handle_cli_core_show_channeltypes(), handle_cli_core_show_config_mappings(), handle_cli_core_show_file_formats(), handle_cli_core_show_translation(), handle_cli_database_del(), handle_cli_database_deltree(), handle_cli_database_get(), handle_cli_database_put(), handle_cli_database_show(), handle_cli_database_showkey(), handle_cli_debug(), handle_cli_devstate_change(), handle_cli_devstate_list(), handle_cli_dialplan_add_extension(), handle_cli_dialplan_add_ignorepat(), handle_cli_dialplan_add_include(), handle_cli_dialplan_reload(), handle_cli_dialplan_remove_context(), handle_cli_dialplan_remove_extension(), handle_cli_dialplan_remove_ignorepat(), handle_cli_dialplan_remove_include(), handle_cli_dialplan_save(), handle_cli_dynamic_level_test(), handle_cli_file_convert(), handle_cli_iax2_provision(), handle_cli_iax2_prune_realtime(), handle_cli_iax2_set_debug(), handle_cli_iax2_set_debug_jb(), handle_cli_iax2_set_debug_trunk(), handle_cli_iax2_set_mtu(), handle_cli_iax2_show_cache(), handle_cli_iax2_show_callno_limits(), handle_cli_iax2_show_channels(), handle_cli_iax2_show_firmware(), handle_cli_iax2_show_netstats(), handle_cli_iax2_show_peer(), handle_cli_iax2_show_registry(), handle_cli_iax2_show_stats(), handle_cli_iax2_show_threads(), handle_cli_iax2_show_users(), handle_cli_iax2_unregister(), handle_cli_indication_show(), handle_cli_keys_show(), handle_cli_locks_show(), handle_cli_malloc_trim(), handle_cli_misdn_reload(), handle_cli_misdn_send_digit(), handle_cli_misdn_send_display(), handle_cli_misdn_set_debug(), handle_cli_misdn_show_channels(), handle_cli_misdn_show_config(), handle_cli_misdn_show_port(), handle_cli_misdn_show_ports_stats(), handle_cli_misdn_show_stacks(), handle_cli_misdn_toggle_echocancel(), handle_cli_mixmonitor(), handle_cli_mobile_cusd(), handle_cli_mobile_rfcomm(), handle_cli_mobile_search(), handle_cli_mobile_show_devices(), handle_cli_moh_show_classes(), handle_cli_moh_show_files(), handle_cli_moh_unregister_class(), handle_cli_odbc_show(), handle_cli_ooh323_set_debug(), handle_cli_ooh323_show_config(), handle_cli_ooh323_show_gk(), handle_cli_ooh323_show_peer(), handle_cli_ooh323_show_peers(), handle_cli_ooh323_show_user(), handle_cli_ooh323_show_users(), handle_cli_osp_show(), handle_cli_performance_test(), handle_cli_presencestate_change(), handle_cli_presencestate_list(), handle_cli_queue_test(), handle_cli_realtime_mysql_cache(), handle_cli_realtime_mysql_status(), handle_cli_realtime_pgsql_cache(), handle_cli_realtime_pgsql_status(), handle_cli_recalc(), handle_cli_refresh(), handle_cli_rtcp_set_debug(), handle_cli_rtcp_set_stats(), handle_cli_rtp_drop_incoming_packets(), handle_cli_rtp_set_debug(), handle_cli_rtp_settings(), handle_cli_sched_bench(), handle_cli_show_config(), handle_cli_show_permissions(), handle_cli_show_sqlite_status(), handle_cli_sound_show(), handle_cli_sounds_show(), handle_cli_sqlite_show_tables(), handle_cli_status(), handle_cli_stun_set_debug(), handle_cli_submit(), handle_cli_test_locales(), handle_cli_transcoder_show(), handle_cli_udptl_set_debug(), handle_cli_ulimit(), handle_cli_wait_fullybooted(), handle_commandmatchesarray(), handle_core_set_debug_channel(), handle_core_show_image_formats(), handle_dahdi_show_cadences(), handle_debug_dialplan(), handle_debug_or_trace(), handle_export_primitives(), handle_feature_show(), handle_help(), handle_load(), handle_logger_add_channel(), handle_logger_reload(), handle_logger_remove_channel(), handle_logger_rotate(), handle_logger_set_level(), handle_logger_show_channels(), handle_manager_show_event(), handle_manager_show_events(), handle_manager_show_settings(), handle_mandebug(), handle_mgcp_audit_endpoint(), handle_mgcp_set_debug(), handle_mgcp_show_endpoints(), handle_minivm_list_templates(), handle_minivm_reload(), handle_minivm_show_settings(), handle_minivm_show_stats(), handle_minivm_show_users(), handle_minivm_show_zones(), handle_modlist(), handle_pjproject_set_log_level(), handle_pjproject_show_buildopts(), handle_pjproject_show_log_level(), handle_pjproject_show_log_mappings(), handle_pjsip_show_version(), handle_queue_add_member(), handle_queue_change_priority_caller(), handle_queue_pause_member(), handle_queue_remove_member(), handle_queue_rule_show(), handle_queue_set_member_penalty(), handle_queue_set_member_ringinuse(), handle_redirect(), handle_reload(), handle_remb_set(), handle_restart_when_convenient(), handle_set_chanvar(), handle_set_extenpatternmatchnew(), handle_set_global(), handle_show_application(), handle_show_applications(), handle_show_calendar(), handle_show_calendars(), handle_show_calendars_types(), handle_show_chanvar(), handle_show_device2extenstate(), handle_show_dialplan(), handle_show_function(), handle_show_functions(), handle_show_globals(), handle_show_hangup_channel(), handle_show_hint(), handle_show_hints(), handle_show_http(), handle_show_locks(), handle_show_parking_lot_cmd(), handle_show_profile(), handle_show_settings(), handle_show_switches(), handle_show_sysinfo(), handle_show_threads(), handle_show_translation_path(), handle_show_translation_table(), handle_showcalls(), handle_showchan(), handle_showmanager(), handle_showmanagers(), handle_showmancmd(), handle_showmancmds(), handle_showmanconn(), handle_showmaneventq(), handle_skel_show_config(), handle_skel_show_games(), handle_skel_show_levels(), handle_skinny_set_debug(), handle_skinny_show_settings(), handle_softhangup(), handle_stop_when_convenient(), handle_unload(), handle_unset_extenpatternmatchnew(), handle_version(), handle_voicemail_reload(), handle_voicemail_show_aliases(), handle_voicemail_show_users(), handle_voicemail_show_zones(), help1(), help_workhorse(), iax_show_provisioning(), locals_show(), log_forwarder(), media_cache_handle_create_item(), media_cache_handle_delete_item(), media_cache_handle_refresh_item(), media_cache_handle_show_all(), media_cache_handle_show_item(), media_cache_prnt_summary(), meetme_show_cmd(), modlist_modentry(), orig_app(), orig_exten(), output_tests(), peer_dump_func(), pjsip_disable_logger(), pjsip_enable_logger_all(), pjsip_enable_logger_host(), pjsip_set_history(), pjsip_set_logger_pcap(), pjsip_set_logger_verbose(), pjsip_show_history(), pktccops_debug(), pktccops_gatedel(), pktccops_gateset(), pktccops_show_cmtses(), pktccops_show_gates(), pktccops_show_pools(), print_app_docs(), print_applicationmap(), print_bc_info(), print_event_instance(), print_featuregroup(), print_featuregroups(), print_group(), print_named_groups(), print_stats_cb(), print_uptimestr(), prometheus_show_metrics(), prometheus_show_status(), route_list_cb(), rtcp_do_debug_ip(), rtp_do_debug_ip(), show_channels_cb(), show_chanstats_cb(), show_codec(), show_codecs(), show_config_description(), show_debug_helper(), show_dialplan_helper(), show_dialplan_helper_extension_output(), show_license(), show_sound_info_cb(), show_sounds_cb(), show_users_cb(), show_users_realtime(), show_warranty(), sip_cli_notify(), sip_do_debug(), sip_do_debug_ip(), sip_do_debug_peer(), sip_prune_realtime(), sip_set_history(), sip_show_channel(), sip_show_channels(), sip_show_channelstats(), sip_show_domains(), sip_show_history(), sip_show_inuse(), sip_show_mwi(), sip_show_objects(), sip_show_registry(), sip_show_sched(), sip_show_settings(), sip_show_tcp(), sip_show_user(), sip_show_users(), sip_unregister(), sla_show_stations(), sla_show_trunks(), sorcery_memory_cache_cli_thrash(), sorcery_memory_cache_dump(), sorcery_memory_cache_expire(), sorcery_memory_cache_populate(), sorcery_memory_cache_print_object(), sorcery_memory_cache_show(), sorcery_memory_cache_stale(), spandsp_fax_cli_show_capabilities(), spandsp_fax_cli_show_session(), spandsp_fax_cli_show_stats(), stasis_app_to_cli(), stasis_show_topic(), stasis_show_topics(), statistics_show_messages(), statistics_show_subscription(), statistics_show_subscriptions(), statistics_show_topic(), statistics_show_topics(), status_debug_verbose(), stir_shaken_certificate_show_all(), stir_shaken_cli_show(), test_cli_execute_registered(), test_cli_generate_results(), test_cli_show_registered(), test_cli_show_results(), test_execute_multiple(), threadstorage_init(), timing_test(), tls_method_to_str(), tps_report_taskprocessor_list_helper(), unistim_do_debug(), unistim_show_devices(), unistim_show_info(), unistim_sp(), xmpp_cli_create_collection(), xmpp_cli_create_leafnode(), xmpp_cli_delete_pubsub_node(), xmpp_cli_list_pubsub_nodes(), xmpp_cli_purge_pubsub_nodes(), xmpp_do_set_debug(), xmpp_show_buddies(), and xmpp_show_clients().
int ast_cli_allow_at_shutdown | ( | struct ast_cli_entry * | e | ) |
Definition at line 3026 of file main/cli.c.
References ast_rwlock_unlock, ast_rwlock_wrlock, AST_VECTOR_APPEND, and shutdown_commands_lock.
Referenced by handle_abort_shutdown(), handle_restart_gracefully(), handle_restart_now(), handle_restart_when_convenient(), handle_show_locks(), handle_stop_gracefully(), handle_stop_now(), and handle_stop_when_convenient().
int ast_cli_command_full | ( | int | uid, |
int | gid, | ||
int | fd, | ||
const char * | s | ||
) |
Interprets a command Interpret a command s, sending output to fd if uid:gid has permissions to run this command. uid = CLI_NO_PERMS to avoid checking user permissions gid = CLI_NO_PERMS to avoid checking group permissions.
uid | User ID that is trying to run the command. |
gid | Group ID that is trying to run the command. |
fd | pipe |
s | incoming string |
0 | on success |
-1 | on failure |
Definition at line 2939 of file main/cli.c.
References allowed_on_shutdown(), args, ast_atomic_fetchadd_int(), ast_cli(), ast_free, ast_join, AST_MAX_ARGS, ast_module_running_ref, ast_module_unref, AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, ast_shutting_down(), CLI_FAILURE, CLI_HANDLER, cli_has_permissions(), CLI_SHOWUSAGE, CLI_SUCCESS, done, ast_cli_args::fd, find_best(), find_cli(), ast_cli_entry::handler, ast_cli_entry::inuse, ast_cli_entry::module, NULL, parse_args(), RESULT_FAILURE, RESULT_SUCCESS, retval, S_OR, tmp(), and ast_cli_entry::usage.
Referenced by ast_cli_command_multiple_full().
int ast_cli_command_multiple_full | ( | int | uid, |
int | gid, | ||
int | fd, | ||
size_t | size, | ||
const char * | s | ||
) |
Executes multiple CLI commands Interpret strings separated by NULL and execute each one, sending output to fd if uid has permissions, uid = CLI_NO_PERMS to avoid checking users permissions. gid = CLI_NO_PERMS to avoid checking group permissions.
uid | User ID that is trying to run the command. |
gid | Group ID that is trying to run the command. |
fd | pipe |
size | is the total size of the string |
s | incoming string |
number | of commands executed |
Definition at line 3004 of file main/cli.c.
References ast_cli_command_full().
Referenced by netconsole().
char* ast_cli_complete | ( | const char * | word, |
const char *const | choices[], | ||
int | pos | ||
) |
Helper function to generate cli entries from a NULL-terminated array. Returns the n-th matching entry from the array, or NULL if not found. Can be used to implement generate() for static entries as below (in this example we complete the word in position 2):
Definition at line 1811 of file main/cli.c.
References ast_cli_completion_add(), ast_strdup, ast_strlen_zero, len(), and NULL.
Referenced by cli_odbc_read(), cli_odbc_write(), complete_skinny_reset(), complete_skinny_show_line(), handle_bridge_kick_channel(), handle_cli_core_show_translation(), handle_cli_devstate_change(), handle_cli_iax2_prune_realtime(), handle_cli_presencestate_change(), handle_cli_rtp_drop_incoming_packets(), handle_core_set_debug_channel(), handle_orig(), handle_showcalls(), handle_softhangup(), sip_prune_realtime(), sip_qualify_peer(), sip_show_peer(), sip_show_user(), sorcery_memory_cache_stale(), test_cli_execute_registered(), test_cli_generate_results(), test_cli_show_registered(), and test_cli_show_results().
int ast_cli_completion_add | ( | char * | value | ) |
Add a result to a request for completion options.
value | A completion option text. |
0 | Success |
-1 | Failure |
This is an alternative to returning individual values from CLI_GENERATE. Instead of repeatedly being asked for the next match and having to start over, you can call this function repeatedly from your own stateful loop. When all matches have been added you can return NULL from the CLI_GENERATE function.
Definition at line 2726 of file main/cli.c.
References ast_threadstorage_get_ptr(), and cli_completion_vector_add().
Referenced by ao2_container_unregister(), ast_cli_complete(), ast_complete_applications(), ast_complete_channels(), category_complete(), cli_complete_endpoint(), cli_complete_show(), cli_complete_uri(), complete_bridge_live_search(), complete_bridge_participant(), complete_bridge_technology(), complete_channeltypes(), complete_config_module(), complete_config_option(), complete_config_type(), complete_core_id(), complete_country(), complete_indications(), complete_show_sorcery_object(), complete_test_category(), complete_test_name(), complete_trans_path_choice(), handle_cli_config_reload(), handle_cli_rtp_drop_incoming_packets(), handle_cli_sound_show(), handle_debug_category(), handle_manager_show_event(), handle_show_named_acl_cmd(), handle_showmanager(), handle_showmancmd(), module_load_helper_on_file(), stir_shaken_tab_complete_name(), topic_complete_name(), and tps_taskprocessor_tab_complete().
char** ast_cli_completion_matches | ( | const char * | , |
const char * | |||
) |
Generates a NULL-terminated array of strings that 1) begin with the string in the second parameter, and 2) are valid in a command after the string in the first parameter.
The first entry (offset 0) of the result is the longest common substring in the results, useful to extend the string that has been completed. Subsequent entries are all possible values, followed by a NULL. All strings and the array itself are malloc'ed and must be freed by the caller.
Definition at line 2670 of file main/cli.c.
References ast_cli_completion_vector(), ast_free, AST_THREADSTORAGE_RAW(), AST_VECTOR_APPEND, AST_VECTOR_CALLBACK_VOID, AST_VECTOR_PTR_FREE, AST_VECTOR_STEAL_ELEMENTS, and NULL.
Referenced by handle_commandmatchesarray().
struct ast_vector_string* ast_cli_completion_vector | ( | const char * | text, |
const char * | word | ||
) |
Generates a vector of strings for CLI completion.
text | Complete input being matched. |
word | Current word being matched |
The results contain strings that both: 1) Begin with the string in word. 2) Are valid in a command after the string in text.
The first entry (offset 0) of the result is the longest common substring in the results, useful to extend the string that has been completed. Subsequent entries are all possible values.
Definition at line 2731 of file main/cli.c.
References ast_assert, ast_calloc, ast_cli_generator(), ast_free, ast_log, ast_strndup, ast_threadstorage_get_ptr(), ast_threadstorage_set_ptr(), AST_VECTOR_CALLBACK_VOID, AST_VECTOR_GET, AST_VECTOR_INSERT_AT, AST_VECTOR_PTR_FREE, AST_VECTOR_REMOVE, AST_VECTOR_SIZE, cli_completion_vector_add(), LOG_ERROR, and NULL.
Referenced by ast_cli_completion_matches(), AST_TEST_DEFINE(), and cli_complete().
char* ast_cli_generator | ( | const char * | , |
const char * | , | ||
int | |||
) |
Readline madness Useful for readline, that's about it.
0 | on success |
-1 | on failure |
Only call this function to proxy the CLI generator to another.
Definition at line 2917 of file main/cli.c.
References __ast_cli_generator().
Referenced by ast_cli_completion_vector(), cli_alias_passthrough(), and handle_cli_check_permissions().
void ast_cli_print_timestr_fromseconds | ( | int | fd, |
int | seconds, | ||
const char * | prefix | ||
) |
Print on cli a duration in seconds in format s year(s), s week(s), s day(s), s hour(s), s second(s)
ast_cli_args | fd to print by ast_cli |
duration | The time (in seconds) to print |
prefix | A Prefix string to add before of duration formatted |
Definition at line 3021 of file main/cli.c.
References ast_tv(), and print_uptimestr().
Referenced by handle_cdr_pgsql_status(), handle_cli_cdr_mysql_status(), handle_cli_realtime_pgsql_status(), and realtime_ldap_status().
int ast_cli_unregister | ( | struct ast_cli_entry * | e | ) |
Unregisters a command or an array of commands.
e | which cli entry to unregister Unregister your own command. You must pass a completed ast_cli_entry structure |
Definition at line 2397 of file main/cli.c.
References ast_cli_entry::_full_cmd, ast_free, ast_log, AST_RWLIST_REMOVE, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_cli_entry::cmda, ast_cli_entry::command, ast_cli_entry::handler, ast_cli_entry::inuse, cli_perm::list, LOG_WARNING, NULL, remove_shutdown_command(), and ast_cli_entry::usage.
Referenced by aco_deinit(), alias_unregister_cb(), ast_cli_unregister_multiple(), unload_module(), and xmldoc_unload_documentation().
int ast_cli_unregister_multiple | ( | struct ast_cli_entry * | e, |
int | len | ||
) |
Unregister multiple commands.
e | pointer to first cli entry to unregister |
len | number of entries to unregister |
Definition at line 30 of file clicompat.c.
References ast_cli_unregister(), and len().
Referenced by __ast_cli_register_multiple(), __unload_module(), ao2_container_unregister(), aoc_shutdown(), ast_ari_cli_unregister(), ast_res_pjsip_cleanup_options_handling(), ast_res_pjsip_destroy_configuration(), ast_sip_destroy_cli(), ast_sip_destroy_distributor(), ast_sip_destroy_scheduler(), ast_sip_destroy_sorcery_auth(), ast_sip_destroy_sorcery_location(), ast_sip_destroy_sorcery_transport(), astdb_atexit(), astobj2_cleanup(), bridge_cleanup(), cdr_engine_shutdown(), channels_shutdown(), cli_shutdown(), cli_unload_cb(), close_logger(), codec_shutdown(), conf_destroy_config(), config_shutdown(), file_shutdown(), iax_provision_unload(), image_shutdown(), load_module(), local_shutdown(), main_atexit(), manager_shutdown(), media_cache_shutdown(), my_unload_module(), pjsip_channel_cli_unregister(), stasis_cleanup(), stir_shaken_certificate_unload(), stir_shaken_general_unload(), stir_shaken_store_unload(), stun_shutdown(), test_cleanup(), threadstorage_init(), timing_shutdown(), tps_shutdown(), translate_shutdown(), unload_features_config(), unload_module(), unload_parking_ui(), unload_pbx(), unload_pbx_app(), unload_pbx_functions_cli(), unload_pbx_hangup_handler(), unload_pbx_switch(), unload_pbx_variables(), and utils_shutdown().
char* ast_complete_channels | ( | const char * | line, |
const char * | word, | ||
int | pos, | ||
int | state, | ||
int | rpos | ||
) |
Command completion for the list of active channels.
This can be called from a CLI command completion function that wants to complete from the list of active channels. 'rpos' is the required position in the command. This function will return NULL immediately if 'rpos' is not the same as the current position, 'pos'.
Definition at line 1830 of file main/cli.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_channel_cache_all(), ast_cli_completion_add(), ast_strdup, ast_channel_snapshot::base, ast_channel_snapshot_base::name, NULL, and state.
Referenced by complete_ch(), handle_cli_agi_add_cmd(), handle_cli_mixmonitor(), handle_core_set_debug_channel(), handle_redirect(), handle_remb_set(), handle_set_chanvar(), handle_show_chanvar(), handle_show_hangup_channel(), handle_showchan(), and handle_softhangup().