Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
#include "asterisk.h"
#include <newt.h>
#include <stdio.h>
#include <sys/time.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <sys/select.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
#include "asterisk/md5.h"
#include "asterisk/linkedlists.h"
Go to the source code of this file.
Data Structures | |
struct | ast_chan |
struct | ast_mansession |
struct | chans |
struct | event |
struct | message |
Macros | |
#define | _NEWT_CAST (void *) |
#define | ARRAY_LEN(a) (sizeof(a) / sizeof(a[0])) |
#define | ASTMM_LIBC ASTMM_IGNORE |
#define | DEFAULT_MANAGER_PORT 5038 |
#define | MAX_HEADERS 80 |
#define | MAX_LEN 256 |
Functions | |
int | ast_add_profile (const char *, uint64_t scale) |
support for event profiling More... | |
int64_t | ast_mark (int, int start1_stop0) |
int64_t | ast_profile (int, int64_t) |
static void | del_chan (char *name) |
static int | event_hangup (struct ast_mansession *s, struct message *m) |
static int | event_ignore (struct ast_mansession *s, struct message *m) |
static int | event_newchannel (struct ast_mansession *s, struct message *m) |
static int | event_newexten (struct ast_mansession *s, struct message *m) |
static int | event_newstate (struct ast_mansession *s, struct message *m) |
static int | event_rename (struct ast_mansession *s, struct message *m) |
static int | event_status (struct ast_mansession *s, struct message *m) |
static void | fdprintf (int fd, char *fmt,...) |
static struct ast_chan * | find_chan (char *name) |
static char * | get_header (struct message *m, char *var) |
static int | get_input (struct ast_mansession *s, char *output) |
static int | get_user_input (char *msg, char *buf, int buflen) |
static int | has_input (struct ast_mansession *s) |
static int | hide_doing (void) |
static int | input_check (struct ast_mansession *s, struct message **mout) |
int | main (int argc, char *argv[]) |
static int | manage_calls (char *host) |
static int | manager_action (char *action, char *fmt,...) |
static int | manager_login (char *hostname) |
static int | process_message (struct ast_mansession *s, struct message *m) |
static void | rebuild_channels (newtComponent c) |
static int | show_doing (char *title, char *tmp) |
static int | show_message (char *title, char *msg) |
static void | try_hangup (newtComponent c) |
static void | try_redirect (newtComponent c) |
static void | try_status (void) |
static struct message * | wait_for_response (int timeout) |
Variables | |
static struct chans | chans = { .first = NULL, .last = NULL, } |
static struct event | events [] |
static struct ast_mansession | session |
static newtComponent | showform |
#define ASTMM_LIBC ASTMM_IGNORE |
int ast_add_profile | ( | const char * | s, |
uint64_t | scale | ||
) |
support for event profiling
(note, this must be documented a lot more) ast_add_profile allocates a generic 'counter' with a given name, which can be shown with the command 'core show profile <name>'
The counter accumulates positive or negative values supplied by
support for event profiling
Definition at line 92 of file astman.c.
int64_t ast_mark | ( | int | key, |
int | start1_stop0 | ||
) |
Definition at line 103 of file astman.c.
Referenced by __ast_pthread_mutex_lock(), and extension_match_core().
int64_t ast_profile | ( | int | key, |
int64_t | val | ||
) |
|
static |
Definition at line 126 of file astman.c.
References AST_LIST_REMOVE_CURRENT, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, free(), ast_chan::list, ast_chan::name, and name.
Referenced by event_hangup().
|
static |
Definition at line 204 of file astman.c.
References del_chan(), and get_header().
|
static |
|
static |
Definition at line 183 of file astman.c.
References ast_chan::callerid, find_chan(), get_header(), and ast_chan::state.
|
static |
Definition at line 173 of file astman.c.
References ast_chan::context, ast_chan::exten, find_chan(), get_header(), and ast_chan::priority.
|
static |
Definition at line 165 of file astman.c.
References find_chan(), get_header(), and ast_chan::state.
|
static |
Definition at line 215 of file astman.c.
References find_chan(), get_header(), and ast_chan::name.
|
static |
Definition at line 192 of file astman.c.
References ast_chan::callerid, ast_chan::context, ast_chan::exten, find_chan(), get_header(), ast_chan::priority, and ast_chan::state.
|
static |
Definition at line 141 of file astman.c.
References errno.
Referenced by manager_action().
|
static |
Definition at line 110 of file astman.c.
References AST_LIST_INSERT_TAIL, AST_LIST_TRAVERSE, ast_chan::list, malloc(), ast_chan::name, and name.
Referenced by event_newchannel(), event_newexten(), event_newstate(), event_rename(), and event_status().
|
static |
Definition at line 154 of file astman.c.
References message::hdrcount, message::headers, and var.
Referenced by event_hangup(), event_newchannel(), event_newexten(), event_newstate(), event_rename(), event_status(), input_check(), manager_login(), process_message(), try_hangup(), try_redirect(), and try_status().
|
static |
Definition at line 310 of file astman.c.
References errno, ast_mansession::fd, FD_SET, FD_ZERO, ast_mansession::inbuf, inet_ntoa, ast_mansession::inlen, NULL, and ast_mansession::sin.
Referenced by input_check().
|
static |
Definition at line 500 of file astman.c.
References _NEWT_CAST, buf, input(), and NULL.
Referenced by try_redirect().
|
static |
Definition at line 301 of file astman.c.
References ast_mansession::inbuf, and ast_mansession::inlen.
Referenced by manage_calls().
|
static |
Definition at line 462 of file astman.c.
References showform.
Referenced by manage_calls(), and manager_login().
|
static |
Definition at line 350 of file astman.c.
References get_header(), get_input(), message::hdrcount, message::headers, MAX_HEADERS, NULL, and process_message().
Referenced by manage_calls(), and wait_for_response().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 748 of file astman.c.
References manage_calls(), and manager_login().
|
static |
Definition at line 561 of file astman.c.
References channels, ast_mansession::fd, hangup(), has_input(), hide_doing(), input_check(), NULL, rebuild_channels(), session, show_doing(), show_message(), tmp(), try_hangup(), try_redirect(), and try_status().
Referenced by main().
|
static |
Definition at line 410 of file astman.c.
References errno, ast_mansession::fd, fdprintf(), session, and tmp().
Referenced by manager_login(), try_hangup(), try_redirect(), and try_status().
|
static |
Definition at line 629 of file astman.c.
References _NEWT_CAST, challenge(), DEFAULT_MANAGER_PORT, errno, ast_mansession::fd, get_header(), gethostbyname, hide_doing(), hostname, len(), manager_action(), md5(), MD5Final(), MD5Init(), MD5Update(), NULL, pass, session, show_doing(), show_message(), ast_mansession::sin, tmp(), user, and wait_for_response().
Referenced by main().
|
static |
Definition at line 249 of file astman.c.
References ARRAY_LEN, events, get_header(), message::hdrcount, and message::headers.
Referenced by input_check().
|
static |
Definition at line 275 of file astman.c.
References AST_LIST_TRAVERSE, c, ast_chan::callerid, ast_chan::context, ast_chan::exten, ast_chan::list, ast_chan::name, NULL, ast_chan::priority, ast_chan::state, and tmp().
Referenced by manage_calls().
|
static |
Definition at line 449 of file astman.c.
References NULL, showform, and tmp().
Referenced by manage_calls(), and manager_login().
|
static |
Definition at line 429 of file astman.c.
References NULL.
Referenced by manage_calls(), manager_login(), try_hangup(), try_redirect(), and try_status().
|
static |
Definition at line 482 of file astman.c.
References c, get_header(), manager_action(), ast_chan::name, show_message(), and wait_for_response().
Referenced by manage_calls().
|
static |
Definition at line 528 of file astman.c.
References c, voicemailpwcheck::context, get_header(), get_user_input(), manager_action(), ast_chan::name, show_message(), tmp(), and wait_for_response().
Referenced by manage_calls().
|
static |
Definition at line 469 of file astman.c.
References get_header(), manager_action(), show_message(), and wait_for_response().
Referenced by manage_calls().
|
static |
Definition at line 387 of file astman.c.
References ast_mansession::fd, FD_SET, input_check(), NULL, and session.
Referenced by manager_login(), try_hangup(), try_redirect(), and try_status().
Referenced by check_header(), check_header_fmt(), and setup_dahdi_int().
|
static |
Referenced by process_message().
|
static |
Referenced by __manager_event_sessions_va(), __print_debug_details(), add_bundle_groups(), add_crypto_to_stream(), add_date_header(), add_eprofile_to_channel(), add_extmap_to_stream(), add_fingerprints_if_present(), add_header(), add_ice_to_stream(), add_id_headers(), add_msid_to_stream(), add_pai_header(), add_param(), add_party_param(), add_rpid_header(), add_rtcp_fb_to_stream(), add_sdp_streams(), add_ssrc_to_stream(), answer(), aoc_attach_framehook(), aoc_bye_outgoing_request(), aoc_bye_outgoing_response(), aoc_incoming_invite_request(), aoc_invite_outgoing_response(), aoc_outgoing_invite_request(), apply_method_filter(), apply_negotiated_sdp_stream(), assign_uuid(), ast_ari_events_event_websocket_ws_established_cb(), ast_ari_websocket_events_event_websocket_established(), ast_ari_websocket_session_create(), ast_ari_websocket_session_get_remote_addr(), ast_ari_websocket_session_id(), ast_ari_websocket_session_read(), ast_ari_websocket_session_write(), ast_sip_can_present_connected_id(), ast_sip_channel_pvt_alloc(), ast_sip_dialog_get_session(), ast_sip_session_add_datastore(), ast_sip_session_add_reason_header(), ast_sip_session_add_supplements(), ast_sip_session_alloc(), ast_sip_session_create_invite(), ast_sip_session_create_joint_call_cap(), ast_sip_session_create_joint_call_stream(), ast_sip_session_create_outgoing(), ast_sip_session_defer_termination(), ast_sip_session_defer_termination_cancel(), ast_sip_session_end_if_deferred(), ast_sip_session_get_datastore(), ast_sip_session_get_dialog(), ast_sip_session_get_name(), ast_sip_session_get_pjsip_inv_state(), ast_sip_session_is_pending_stream_default(), ast_sip_session_media_add_read_callback(), ast_sip_session_media_get_transport(), ast_sip_session_media_state_add(), ast_sip_session_refresh(), ast_sip_session_regenerate_answer(), ast_sip_session_remove_datastore(), ast_sip_session_remove_supplements(), ast_sip_session_resume_reinvite(), ast_sip_session_send_request(), ast_sip_session_send_request_with_cb(), ast_sip_session_send_response(), ast_sip_session_suspend(), ast_sip_session_terminate(), ast_sip_session_unsuspend(), ast_websocket_close(), ast_websocket_fd(), ast_websocket_is_secure(), ast_websocket_local_address(), ast_websocket_read(), ast_websocket_reconstruct_disable(), ast_websocket_reconstruct_enable(), ast_websocket_ref(), ast_websocket_remote_address(), ast_websocket_session_id(), ast_websocket_set_nonblock(), ast_websocket_set_timeout(), ast_websocket_unref(), ast_websocket_uri_cb(), ast_websocket_wait_for_input(), ast_websocket_write(), astman_is_authed(), astman_verify_session_readpermissions(), astman_verify_session_writepermissions(), auth_http_callback(), call(), call_pickup_incoming_request(), caller_id_incoming_request(), caller_id_incoming_response(), caller_id_outgoing_request(), caller_id_outgoing_response(), chan_pjsip_answer(), chan_pjsip_cng_tone_detected(), chan_pjsip_incoming_ack(), chan_pjsip_incoming_prack(), chan_pjsip_incoming_request(), chan_pjsip_incoming_response(), chan_pjsip_incoming_response_update_cause(), chan_pjsip_new(), chan_pjsip_read_stream(), chan_pjsip_request_with_stream_topology(), chan_pjsip_session_begin(), chan_pjsip_session_end(), chan_pjsip_set_rtp_peer(), chan_pjsip_write_stream(), channel_read_rtcp(), channel_read_rtp(), check_delayed_requests(), check_for_rtp_changes(), check_ice_support(), check_manager_session_inuse(), check_request_status(), clear_session_and_channel(), cli_channelstats_print_body(), create_local_sdp(), create_outgoing_sdp_stream(), create_rtp(), defer_incoming_sdp_stream(), defer_termination_cancel_task(), delay_request(), destroy_session(), direct_media_mitigate_glare(), diversion_incoming_request(), diversion_incoming_response(), diversion_outgoing_request(), diversion_outgoing_response(), dtmf_info_incoming_request(), empty_info_incoming_request(), enable_rtcp(), enable_rtp_extension(), event_session_alloc(), event_session_allocation_error_handler(), event_session_cleanup(), event_session_dtor(), event_session_hash(), event_session_shutdown(), event_session_shutdown_cb(), event_session_update_websocket(), fetch_callerid_num(), filter_session_outgoing_message(), find_session(), find_session_by_nonce(), generate_rtpmap_attr(), generate_rtpmap_attr2(), generate_session_refresh_sdp(), generic_http_callback(), get_codecs(), get_destination(), get_manager_sessions_cb(), get_redirecting_add_diversion(), handle_incoming(), handle_incoming_before_media(), handle_incoming_request(), handle_incoming_response(), handle_incoming_sdp(), handle_kickmanconn(), handle_negotiated_sdp(), handle_negotiated_sdp_session_media(), handle_new_invite_request(), handle_outgoing_request(), handle_outgoing_response(), handle_session_begin(), handle_session_destroy(), handle_session_end(), handle_showmanconn(), handle_topology_request_change(), hangup(), has_supplement(), incoming_in_dialog_request(), incoming_request(), incoming_response(), indicate(), indicate_data_alloc(), info_dtmf_data_alloc(), invite_collision_timeout(), invite_proceeding(), invite_terminated(), is_colp_update_allowed(), is_compatible_format(), jingle_action_hook(), jingle_action_session_accept(), jingle_action_session_info(), jingle_action_session_initiate(), jingle_action_session_terminate(), jingle_action_transport_info(), jingle_add_content(), jingle_add_payloads_to_description(), jingle_alloc(), jingle_answer(), jingle_call(), jingle_digit_begin(), jingle_digit_end(), jingle_enable_video(), jingle_fixup(), jingle_get_rtp_peer(), jingle_hangup(), jingle_indicate(), jingle_interpret_content(), jingle_interpret_description(), jingle_interpret_google_transport(), jingle_interpret_ice_udp_transport(), jingle_new(), jingle_outgoing_hook(), jingle_queue_hangup_with_cause(), jingle_read(), jingle_request(), jingle_send_session_accept(), jingle_send_session_action(), jingle_send_session_info(), jingle_send_session_initiate(), jingle_send_session_terminate(), jingle_send_transport_info(), jingle_sendtext(), jingle_session_destructor(), jingle_session_hash(), jingle_set_owner(), jingle_write(), log_caps(), manage_calls(), manager_action(), manager_displayconnects(), manager_fax_session(), manager_fax_sessions(), manager_fax_sessions_entry(), manager_login(), media_offer_read_av(), nat_incoming_invite_request(), nat_incoming_invite_response(), nat_outgoing_invite_request(), negotiate_incoming_sdp_stream(), notify_ami_channel_data_create(), notify_cli_channel_data_create(), on_topology_change_response(), options_incoming_request(), outbound_invite_auth(), outgoing_request(), path_session_outgoing_request(), path_session_outgoing_response(), pbx_start_incoming_request(), pjsip_log_test_filter(), pjsip_logger_session_alloc(), pjsip_logger_session_destroy(), pjsip_logger_write_to_pcap(), process_extmap_attributes(), process_failure(), process_ice_attributes(), process_ice_auth_attrb(), process_ssrc_attributes(), purge_sessions(), push_notify_channel(), queue_connected_line_update(), read_param(), reason_header_outgoing_response(), refer_incoming_attended_request(), refer_incoming_blind_request(), refer_incoming_invite_request(), refer_incoming_refer_request(), refer_incoming_request(), refer_outgoing_request(), refer_progress_alloc(), reject_incoming_call(), remote_send_hold_refresh(), request(), reschedule_reinvite(), resend_reinvite(), rfc3326_add_reason_header(), rfc3326_incoming_request(), rfc3326_incoming_response(), rfc3326_outgoing_request(), rfc3326_outgoing_response(), rfc3326_use_reason_header(), rfc3329_incoming_response(), rfc3329_outgoing_request(), rtp_direct_media_data_create(), rtp_find_rtcp_fd_position(), sdp_register(), sdp_requires_deferral(), sdp_search(), send_delayed_request(), send_direct_media_request(), send_response(), send_topology_change_refresh(), session_destroy_fn(), session_destructor(), session_do(), session_end(), session_end_completion(), session_end_if_deferred_task(), session_end_if_disconnected(), session_inv_on_create_offer(), session_inv_on_media_update(), session_inv_on_redirected(), session_inv_on_rx_offer(), session_inv_on_state_changed(), session_inv_on_tsx_state_changed(), session_on_rx_request(), session_on_rx_response(), session_on_tsx_state(), session_on_tx_response(), session_outgoing_nat_hook(), session_refresh_state_get_or_alloc(), session_reinvite_on_rx_request(), session_termination_cb(), session_termination_task(), set_caps(), set_channel_on_rtp_instance(), set_from_header(), set_ice_components(), set_incoming_call_offer_cap(), set_mid_and_bundle_group(), set_redirecting(), set_remote_mslabel_and_stream_group(), set_session_media_remotely_held(), set_sipdomain_variable(), setup_dtls_srtp(), setup_media_encryption(), should_queue_connected_line_update(), sip_session_defer_termination_stop_timer(), sip_session_refresh(), sip_session_response_cb(), spandsp_manager_fax_session(), stasis_app_message_handler(), stir_shaken_incoming_request(), stir_shaken_outgoing_request(), t38_attach_framehook(), t38_automatic_reject(), t38_automatic_reject_timer_cb(), t38_change_state(), t38_create_media_state(), t38_incoming_invite_request(), t38_initialize_session(), t38_interpret_sdp(), t38_outgoing_invite_request(), t38_parameters_task_data_alloc(), t38_reinvite_response_cb(), t38_reinvite_sdp_cb(), t38_state_get_or_alloc(), topology_change_refresh_data_alloc(), transfer_data_alloc(), transfer_redirect(), transfer_refer(), transmit_info_dtmf(), transmit_info_with_vidupdate(), transport_read(), unistim_call(), update_completed(), update_connected_line_information(), update_incoming_connected_line(), update_initial_connected_line(), video_info_incoming_request(), wait_for_response(), websocket_cb(), websocket_echo_callback(), websocket_mask_payload(), websocket_outgoing_invite_request(), websocket_session_dtor(), and ws_safe_read().
|
static |
Definition at line 448 of file astman.c.
Referenced by hide_doing(), and show_doing().