Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
SNMP Agent / SubAgent support for Asterisk. More...
#include "asterisk.h"
#include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-includes.h>
#include <net-snmp/agent/net-snmp-agent-includes.h>
#include "asterisk/paths.h"
#include "asterisk/channel.h"
#include "asterisk/logger.h"
#include "asterisk/options.h"
#include "asterisk/indications.h"
#include "asterisk/ast_version.h"
#include "asterisk/pbx.h"
#include "asterisk/module.h"
#include "agent.h"
Go to the source code of this file.
Functions | |
void * | agent_thread (void *arg) |
static u_char * | ast_var_channel_bridge (struct variable *vp, oid *name, size_t *length, int exact, size_t *var_len, WriteMethod **write_method) |
static u_char * | ast_var_channel_types (struct variable *vp, oid *name, size_t *length, int exact, size_t *var_len, WriteMethod **write_method) |
static u_char * | ast_var_channel_types_table (struct variable *vp, oid *name, size_t *length, int exact, size_t *var_len, WriteMethod **write_method) |
static u_char * | ast_var_channels (struct variable *vp, oid *name, size_t *length, int exact, size_t *var_len, WriteMethod **write_method) |
static u_char * | ast_var_channels_table (struct variable *vp, oid *name, size_t *length, int exact, size_t *var_len, WriteMethod **write_method) |
static u_char * | ast_var_Config (struct variable *vp, oid *name, size_t *length, int exact, size_t *var_len, WriteMethod **write_method) |
static u_char * | ast_var_indications (struct variable *vp, oid *name, size_t *length, int exact, size_t *var_len, WriteMethod **write_method) |
static u_char * | ast_var_indications_table (struct variable *vp, oid *name, size_t *length, int exact, size_t *var_len, WriteMethod **write_method) |
static u_char * | ast_var_Modules (struct variable *vp, oid *name, size_t *length, int exact, size_t *var_len, WriteMethod **write_method) |
static u_char * | ast_var_Version (struct variable *vp, oid *name, size_t *length, int exact, size_t *var_len, WriteMethod **write_method) |
static int | countmodule (const char *mod, const char *desc, int use, const char *status, const char *like, enum ast_module_support_level support_level) |
int | header_generic (struct variable *, oid *, size_t *, int, size_t *, WriteMethod **) |
int | header_simple_table (struct variable *, oid *, size_t *, int, size_t *, WriteMethod **, int) |
static void | init_asterisk_mib (void) |
int | register_sysORTable (oid *, size_t, const char *) |
static int | term_asterisk_mib (int majorID, int minorID, void *serverarg, void *clientarg) |
int | unregister_sysORTable (oid *, size_t) |
Variables | |
static oid | asterisk_oid [] = { 1, 3, 6, 1, 4, 1, 22736, 1 } |
SNMP Agent / SubAgent support for Asterisk.
Definition in file agent.c.
#define ASTMM_LIBC ASTMM_IGNORE |
void * agent_thread | ( | void * | arg | ) |
Definition at line 186 of file agent.c.
References ast_verb, init_asterisk_mib(), NULL, res_snmp_agentx_subagent, and res_snmp_dont_stop.
Referenced by load_module().
|
static |
Definition at line 588 of file agent.c.
References ast_channel_is_bridged(), ast_channel_iterator_all_new(), ast_channel_iterator_destroy(), ast_channel_iterator_next(), ast_channel_lock, ast_channel_unlock, ast_channel_unref, ASTCHANBRIDGECOUNT, header_generic(), name, and NULL.
Referenced by init_asterisk_mib().
|
static |
Definition at line 502 of file agent.c.
References ast_channeltype_list(), ast_variables_destroy(), ASTCHANTYPECOUNT, header_generic(), name, ast_variable::next, and NULL.
Referenced by init_asterisk_mib().
|
static |
Definition at line 521 of file agent.c.
References ast_channel_iterator_all_new(), ast_channel_iterator_destroy(), ast_channel_iterator_next(), ast_channel_tech(), ast_channel_unref, ast_channeltype_list(), ast_get_channel_tech(), ast_variables_destroy(), ASTCHANTYPECHANNELS, ASTCHANTYPEDESC, ASTCHANTYPEDEVSTATE, ASTCHANTYPEINDEX, ASTCHANTYPEINDICATIONS, ASTCHANTYPENAME, ASTCHANTYPETRANSFER, ast_channel_tech::description, ast_channel_tech::devicestate, header_simple_table(), ast_channel_tech::indicate, name, ast_variable::name, ast_variable::next, NULL, ast_channel::tech, ast_channel_tech::transfer, and ast_channel_tech::type.
Referenced by init_asterisk_mib().
|
static |
Definition at line 217 of file agent.c.
References ast_active_channels(), ASTCHANCOUNT, header_generic(), name, and NULL.
Referenced by init_asterisk_mib().
|
static |
Definition at line 233 of file agent.c.
References ast_party_caller::ani, ast_party_caller::ani2, ast_active_channels(), ast_channel_accountcode(), ast_channel_amaflags(), ast_channel_appl(), ast_channel_bridge_peer(), ast_channel_call_forward(), ast_channel_caller(), ast_channel_callgroup(), ast_channel_context(), ast_channel_data(), ast_channel_dialed(), ast_channel_exten(), ast_channel_flags(), ast_channel_hangupcause(), ast_channel_iterator_all_new(), ast_channel_iterator_destroy(), ast_channel_iterator_next(), ast_channel_language(), ast_channel_lock, ast_channel_masq(), ast_channel_masqr(), ast_channel_musicclass(), ast_channel_name(), ast_channel_pickupgroup(), ast_channel_priority(), ast_channel_redirecting(), ast_channel_rings(), ast_channel_tech(), ast_channel_transfercapability(), ast_channel_uniqueid(), ast_channel_unlock, ast_channel_unref, ast_channel_whentohangup(), ast_channel_zone(), ast_copy_string(), ast_party_id_presentation(), AST_STATE_MUTE, ast_str_alloca, ast_str_buffer(), ast_str_strlen(), ast_strlen_zero(), ast_tvzero(), ASTCHANACCOUNTCODE, ASTCHANADSI, ASTCHANAMAFLAGS, ASTCHANAPP, ASTCHANBRIDGE, ASTCHANCALLGROUP, ASTCHANCIDANI, ASTCHANCIDANI2, ASTCHANCIDDNID, ASTCHANCIDNAME, ASTCHANCIDNUM, ASTCHANCIDPRES, ASTCHANCIDRDNIS, ASTCHANCIDTNS, ASTCHANCIDTON, ASTCHANCONTEXT, ASTCHANDATA, ASTCHANEXTEN, ASTCHANFLAGS, ASTCHANFORWARDTO, ASTCHANHANGUPCAUSE, ASTCHANINDEX, ASTCHANLANGUAGE, ASTCHANMASQ, ASTCHANMASQR, ASTCHANMUSICCLASS, ASTCHANMUTED, ASTCHANNAME, ASTCHANPICKUPGROUP, ASTCHANPRI, ASTCHANRINGS, ASTCHANSTATE, ASTCHANTONEZONE, ASTCHANTRANSFERCAP, ASTCHANTYPE, ASTCHANUNIQUEID, ASTCHANVARIABLES, ASTCHANWHENHANGUP, ast_channel::bridge, country, ast_party_redirecting::from, header_simple_table(), ast_party_caller::id, name, ast_party_id::name, NULL, ast_party_id::number, ast_party_dialed::number, out, pbx_builtin_serialize_variables(), ast_party_number::plan, ast_party_name::str, ast_party_number::str, ast_party_dialed::str, ast_party_dialed::transit_network_select, type, ast_party_name::valid, and ast_party_number::valid.
Referenced by init_asterisk_mib().
|
static |
Definition at line 621 of file agent.c.
References ast_active_calls(), ast_config_AST_SOCKET, ast_lastreloadtime, ast_processed_calls(), ast_startuptime, ASTCONFACTIVECALLS, ASTCONFPID, ASTCONFPROCESSEDCALLS, ASTCONFRELOADTIME, ASTCONFSOCKET, ASTCONFUPTIME, header_generic(), name, and NULL.
Referenced by init_asterisk_mib().
|
static |
Definition at line 660 of file agent.c.
References ao2_iterator_destroy(), ao2_iterator_next, ast_copy_string(), ast_get_indication_zone(), ast_tone_zone_iterator_init(), ast_tone_zone_unref(), ASTINDCOUNT, ASTINDCURRENT, header_generic(), name, NULL, and tz.
Referenced by init_asterisk_mib().
|
static |
Definition at line 702 of file agent.c.
References ao2_iterator_destroy(), ao2_iterator_next, ast_copy_string(), ast_tone_zone_iterator_init(), ast_tone_zone_lock, ast_tone_zone_unlock, ast_tone_zone_unref(), ASTINDALIAS, ASTINDCOUNTRY, ASTINDDESCRIPTION, ASTINDINDEX, header_simple_table(), name, NULL, and tz.
Referenced by init_asterisk_mib().
|
static |
Definition at line 763 of file agent.c.
References ast_update_module_list(), ASTMODCOUNT, countmodule(), header_generic(), name, and NULL.
Referenced by init_asterisk_mib().
|
static |
Definition at line 779 of file agent.c.
References ast_get_version(), ast_get_version_num(), ASTVERSTRING, ASTVERTAG, header_generic(), name, NULL, and version.
Referenced by init_asterisk_mib().
|
static |
int header_generic | ( | struct variable * | , |
oid * | , | ||
size_t * | , | ||
int | , | ||
size_t * | , | ||
WriteMethod ** | |||
) |
int header_simple_table | ( | struct variable * | , |
oid * | , | ||
size_t * | , | ||
int | , | ||
size_t * | , | ||
WriteMethod ** | , | ||
int | |||
) |
Referenced by ast_var_channel_types_table(), ast_var_channels_table(), and ast_var_indications_table().
|
static |
Definition at line 809 of file agent.c.
References ast_var_channel_bridge(), ast_var_channel_types(), ast_var_channel_types_table(), ast_var_channels(), ast_var_channels_table(), ast_var_Config(), ast_var_indications(), ast_var_indications_table(), ast_var_Modules(), ast_var_Version(), ASTCHANACCOUNTCODE, ASTCHANADSI, ASTCHANAMAFLAGS, ASTCHANAPP, ASTCHANBRIDGE, ASTCHANBRIDGECOUNT, ASTCHANCALLGROUP, ASTCHANCIDANI, ASTCHANCIDANI2, ASTCHANCIDDNID, ASTCHANCIDNAME, ASTCHANCIDNUM, ASTCHANCIDPRES, ASTCHANCIDRDNIS, ASTCHANCIDTNS, ASTCHANCIDTON, ASTCHANCONTEXT, ASTCHANCOUNT, ASTCHANDATA, ASTCHANEXTEN, ASTCHANFLAGS, ASTCHANFORWARDTO, ASTCHANHANGUPCAUSE, ASTCHANINDEX, ASTCHANLANGUAGE, ASTCHANMASQ, ASTCHANMASQR, ASTCHANMUSICCLASS, ASTCHANMUTED, ASTCHANNAME, ASTCHANNELS, ASTCHANPICKUPGROUP, ASTCHANPRI, ASTCHANRINGS, ASTCHANSCALARS, ASTCHANSTATE, ASTCHANTABLE, ASTCHANTONEZONE, ASTCHANTRANSFERCAP, ASTCHANTYPE, ASTCHANTYPECHANNELS, ASTCHANTYPECOUNT, ASTCHANTYPEDESC, ASTCHANTYPEDEVSTATE, ASTCHANTYPEINDEX, ASTCHANTYPEINDICATIONS, ASTCHANTYPENAME, ASTCHANTYPETABLE, ASTCHANTYPETRANSFER, ASTCHANUNIQUEID, ASTCHANVARIABLES, ASTCHANWHENHANGUP, ASTCONFACTIVECALLS, ASTCONFIGURATION, ASTCONFPID, ASTCONFPROCESSEDCALLS, ASTCONFRELOADTIME, ASTCONFSOCKET, ASTCONFUPTIME, asterisk_oid, ASTINDALIAS, ASTINDCOUNT, ASTINDCOUNTRY, ASTINDCURRENT, ASTINDDESCRIPTION, ASTINDICATIONS, ASTINDINDEX, ASTINDTABLE, ASTMODCOUNT, ASTMODULES, ASTVERSION, ASTVERSTRING, ASTVERTAG, NULL, register_sysORTable(), and term_asterisk_mib().
Referenced by agent_thread().
int register_sysORTable | ( | oid * | , |
size_t | , | ||
const char * | |||
) |
Referenced by init_asterisk_mib().
|
static |
Definition at line 803 of file agent.c.
References asterisk_oid, and unregister_sysORTable().
Referenced by init_asterisk_mib().
int unregister_sysORTable | ( | oid * | , |
size_t | |||
) |
Referenced by term_asterisk_mib().
|
static |
Definition at line 97 of file agent.c.
Referenced by init_asterisk_mib(), and term_asterisk_mib().