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.
Defines | |
| #define | ASTCHANACCOUNTCODE 18 |
| #define | ASTCHANADSI 36 |
| #define | ASTCHANAMAFLAGS 35 |
| #define | ASTCHANAPP 10 |
| #define | ASTCHANBRIDGE 6 |
| #define | ASTCHANBRIDGECOUNT 1 |
| #define | ASTCHANCALLGROUP 21 |
| #define | ASTCHANCIDANI 29 |
| #define | ASTCHANCIDANI2 32 |
| #define | ASTCHANCIDDNID 26 |
| #define | ASTCHANCIDNAME 28 |
| #define | ASTCHANCIDNUM 27 |
| #define | ASTCHANCIDPRES 31 |
| #define | ASTCHANCIDRDNIS 30 |
| #define | ASTCHANCIDTNS 34 |
| #define | ASTCHANCIDTON 33 |
| #define | ASTCHANCONTEXT 12 |
| #define | ASTCHANCOUNT 1 |
| #define | ASTCHANDATA 11 |
| #define | ASTCHANEXTEN 16 |
| #define | ASTCHANFLAGS 40 |
| #define | ASTCHANFORWARDTO 19 |
| #define | ASTCHANHANGUPCAUSE 38 |
| #define | ASTCHANINDEX 1 |
| #define | ASTCHANLANGUAGE 3 |
| #define | ASTCHANMACROCONTEXT 13 |
| #define | ASTCHANMACROEXTEN 14 |
| #define | ASTCHANMACROPRI 15 |
| #define | ASTCHANMASQ 7 |
| #define | ASTCHANMASQR 8 |
| #define | ASTCHANMUSICCLASS 5 |
| #define | ASTCHANMUTED 24 |
| #define | ASTCHANNAME 2 |
| #define | ASTCHANNELS 5 |
| #define | ASTCHANPICKUPGROUP 22 |
| #define | ASTCHANPRI 17 |
| #define | ASTCHANRINGS 25 |
| #define | ASTCHANSCALARS 5 |
| #define | ASTCHANSTATE 23 |
| #define | ASTCHANTABLE 2 |
| #define | ASTCHANTONEZONE 37 |
| #define | ASTCHANTRANSFERCAP 41 |
| #define | ASTCHANTYPE 4 |
| #define | ASTCHANTYPECHANNELS 7 |
| #define | ASTCHANTYPECOUNT 3 |
| #define | ASTCHANTYPEDESC 3 |
| #define | ASTCHANTYPEDEVSTATE 4 |
| #define | ASTCHANTYPEINDEX 1 |
| #define | ASTCHANTYPEINDICATIONS 5 |
| #define | ASTCHANTYPENAME 2 |
| #define | ASTCHANTYPETABLE 4 |
| #define | ASTCHANTYPETRANSFER 6 |
| #define | ASTCHANUNIQUEID 20 |
| #define | ASTCHANVARIABLES 39 |
| #define | ASTCHANWHENHANGUP 9 |
| #define | ASTCONFACTIVECALLS 5 |
| #define | ASTCONFIGURATION 2 |
| #define | ASTCONFPID 3 |
| #define | ASTCONFPROCESSEDCALLS 6 |
| #define | ASTCONFRELOADTIME 2 |
| #define | ASTCONFSOCKET 4 |
| #define | ASTCONFUPTIME 1 |
| #define | ASTINDALIAS 3 |
| #define | ASTINDCOUNT 1 |
| #define | ASTINDCOUNTRY 2 |
| #define | ASTINDCURRENT 2 |
| #define | ASTINDDESCRIPTION 4 |
| #define | ASTINDICATIONS 4 |
| #define | ASTINDINDEX 1 |
| #define | ASTINDTABLE 3 |
| #define | ASTMODCOUNT 1 |
| #define | ASTMODULES 3 |
| #define | ASTVERSION 1 |
| #define | ASTVERSTRING 1 |
| #define | ASTVERTAG 2 |
| #define | HAVE_DMALLOC_H 0 |
| #define | unload_module ast_unload_module |
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 *like) |
| 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 ASTCHANACCOUNTCODE 18 |
Definition at line 142 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANADSI 36 |
Definition at line 160 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANAMAFLAGS 35 |
Definition at line 159 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANAPP 10 |
Definition at line 134 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANBRIDGE 6 |
Definition at line 130 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANBRIDGECOUNT 1 |
Definition at line 179 of file agent.c.
Referenced by ast_var_channel_bridge(), and init_asterisk_mib().
| #define ASTCHANCALLGROUP 21 |
Definition at line 145 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANCIDANI 29 |
Definition at line 153 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANCIDANI2 32 |
Definition at line 156 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANCIDDNID 26 |
Definition at line 150 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANCIDNAME 28 |
Definition at line 152 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANCIDNUM 27 |
Definition at line 151 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANCIDPRES 31 |
Definition at line 155 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANCIDRDNIS 30 |
Definition at line 154 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANCIDTNS 34 |
Definition at line 158 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANCIDTON 33 |
Definition at line 157 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANCONTEXT 12 |
Definition at line 136 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANCOUNT 1 |
Definition at line 122 of file agent.c.
Referenced by ast_var_channels(), and init_asterisk_mib().
| #define ASTCHANDATA 11 |
Definition at line 135 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANEXTEN 16 |
Definition at line 140 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANFLAGS 40 |
Definition at line 164 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANFORWARDTO 19 |
Definition at line 143 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANHANGUPCAUSE 38 |
Definition at line 162 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANINDEX 1 |
Definition at line 125 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANLANGUAGE 3 |
Definition at line 127 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANMACROCONTEXT 13 |
Definition at line 137 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANMACROEXTEN 14 |
Definition at line 138 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANMACROPRI 15 |
Definition at line 139 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANMASQ 7 |
Definition at line 131 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANMASQR 8 |
Definition at line 132 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANMUSICCLASS 5 |
Definition at line 129 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANMUTED 24 |
Definition at line 148 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANNAME 2 |
Definition at line 126 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANNELS 5 |
Definition at line 121 of file agent.c.
Referenced by init_asterisk_mib().
| #define ASTCHANPICKUPGROUP 22 |
Definition at line 146 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANPRI 17 |
Definition at line 141 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANRINGS 25 |
Definition at line 149 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANSCALARS 5 |
Definition at line 178 of file agent.c.
Referenced by init_asterisk_mib().
| #define ASTCHANSTATE 23 |
Definition at line 147 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANTABLE 2 |
Definition at line 124 of file agent.c.
Referenced by init_asterisk_mib().
| #define ASTCHANTONEZONE 37 |
Definition at line 161 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANTRANSFERCAP 41 |
Definition at line 165 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANTYPE 4 |
Definition at line 128 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANTYPECHANNELS 7 |
Definition at line 176 of file agent.c.
Referenced by ast_var_channel_types_table(), and init_asterisk_mib().
| #define ASTCHANTYPECOUNT 3 |
Definition at line 167 of file agent.c.
Referenced by ast_var_channel_types(), and init_asterisk_mib().
| #define ASTCHANTYPEDESC 3 |
Definition at line 172 of file agent.c.
Referenced by ast_var_channel_types_table(), and init_asterisk_mib().
| #define ASTCHANTYPEDEVSTATE 4 |
Definition at line 173 of file agent.c.
Referenced by ast_var_channel_types_table(), and init_asterisk_mib().
| #define ASTCHANTYPEINDEX 1 |
Definition at line 170 of file agent.c.
Referenced by ast_var_channel_types_table(), and init_asterisk_mib().
| #define ASTCHANTYPEINDICATIONS 5 |
Definition at line 174 of file agent.c.
Referenced by ast_var_channel_types_table(), and init_asterisk_mib().
| #define ASTCHANTYPENAME 2 |
Definition at line 171 of file agent.c.
Referenced by ast_var_channel_types_table(), and init_asterisk_mib().
| #define ASTCHANTYPETABLE 4 |
Definition at line 169 of file agent.c.
Referenced by init_asterisk_mib().
| #define ASTCHANTYPETRANSFER 6 |
Definition at line 175 of file agent.c.
Referenced by ast_var_channel_types_table(), and init_asterisk_mib().
| #define ASTCHANUNIQUEID 20 |
Definition at line 144 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANVARIABLES 39 |
Definition at line 163 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCHANWHENHANGUP 9 |
Definition at line 133 of file agent.c.
Referenced by ast_var_channels_table(), and init_asterisk_mib().
| #define ASTCONFACTIVECALLS 5 |
Definition at line 105 of file agent.c.
Referenced by ast_var_Config(), and init_asterisk_mib().
| #define ASTCONFIGURATION 2 |
Definition at line 100 of file agent.c.
Referenced by init_asterisk_mib().
| #define ASTCONFPID 3 |
Definition at line 103 of file agent.c.
Referenced by ast_var_Config(), and init_asterisk_mib().
| #define ASTCONFPROCESSEDCALLS 6 |
Definition at line 106 of file agent.c.
Referenced by ast_var_Config(), and init_asterisk_mib().
| #define ASTCONFRELOADTIME 2 |
Definition at line 102 of file agent.c.
Referenced by ast_var_Config(), and init_asterisk_mib().
| #define ASTCONFSOCKET 4 |
Definition at line 104 of file agent.c.
Referenced by ast_var_Config(), and init_asterisk_mib().
| #define ASTCONFUPTIME 1 |
Definition at line 101 of file agent.c.
Referenced by ast_var_Config(), and init_asterisk_mib().
| #define ASTINDALIAS 3 |
Definition at line 118 of file agent.c.
Referenced by ast_var_indications_table(), and init_asterisk_mib().
| #define ASTINDCOUNT 1 |
Definition at line 112 of file agent.c.
Referenced by ast_var_indications(), and init_asterisk_mib().
| #define ASTINDCOUNTRY 2 |
Definition at line 117 of file agent.c.
Referenced by ast_var_indications_table(), and init_asterisk_mib().
| #define ASTINDCURRENT 2 |
Definition at line 113 of file agent.c.
Referenced by ast_var_indications(), and init_asterisk_mib().
| #define ASTINDDESCRIPTION 4 |
Definition at line 119 of file agent.c.
Referenced by ast_var_indications_table(), and init_asterisk_mib().
| #define ASTINDICATIONS 4 |
Definition at line 111 of file agent.c.
Referenced by init_asterisk_mib().
| #define ASTINDINDEX 1 |
Definition at line 116 of file agent.c.
Referenced by ast_var_indications_table(), and init_asterisk_mib().
| #define ASTINDTABLE 3 |
Definition at line 115 of file agent.c.
Referenced by init_asterisk_mib().
| #define ASTMODCOUNT 1 |
Definition at line 109 of file agent.c.
Referenced by ast_var_Modules(), and init_asterisk_mib().
| #define ASTMODULES 3 |
Definition at line 108 of file agent.c.
Referenced by init_asterisk_mib().
| #define ASTVERSION 1 |
Definition at line 96 of file agent.c.
Referenced by init_asterisk_mib().
| #define ASTVERSTRING 1 |
Definition at line 97 of file agent.c.
Referenced by ast_var_Version(), and init_asterisk_mib().
| #define ASTVERTAG 2 |
Definition at line 98 of file agent.c.
Referenced by ast_var_Version(), and init_asterisk_mib().
| void* agent_thread | ( | void * | arg | ) |
Definition at line 181 of file agent.c.
References ast_verb, init_asterisk_mib(), res_snmp_agentx_subagent, and res_snmp_dont_stop.
Referenced by load_module().
{
ast_verb(2, "Starting %sAgent\n", res_snmp_agentx_subagent ? "Sub" : "");
snmp_enable_stderrlog();
if (res_snmp_agentx_subagent)
netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
NETSNMP_DS_AGENT_ROLE,
1);
init_agent("asterisk");
init_asterisk_mib();
init_snmp("asterisk");
if (!res_snmp_agentx_subagent)
init_master_agent();
while (res_snmp_dont_stop)
agent_check_and_process(1);
snmp_shutdown("asterisk");
ast_verb(2, "Terminating %sAgent\n", res_snmp_agentx_subagent ? "Sub" : "");
return NULL;
}
| 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] |
Definition at line 612 of file agent.c.
References ast_bridged_channel(), ast_channel_iterator_all_new(), ast_channel_iterator_destroy(), ast_channel_iterator_next(), ast_channel_lock, ast_channel_unlock, ast_channel_unref, ASTCHANBRIDGECOUNT, and header_generic().
Referenced by init_asterisk_mib().
{
static unsigned long long_ret;
struct ast_channel *chan = NULL;
struct ast_channel_iterator *iter;
long_ret = 0;
if (header_generic(vp, name, length, exact, var_len, write_method)) {
return NULL;
}
if (!(iter = ast_channel_iterator_all_new())) {
return NULL;
}
while ((chan = ast_channel_iterator_next(iter))) {
ast_channel_lock(chan);
if (ast_bridged_channel(chan)) {
long_ret++;
}
ast_channel_unlock(chan);
chan = ast_channel_unref(chan);
}
ast_channel_iterator_destroy(iter);
*var_len = sizeof(long_ret);
return (vp->magic == ASTCHANBRIDGECOUNT) ? (u_char *) &long_ret : NULL;
}
| 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] |
Definition at line 526 of file agent.c.
References ast_channeltype_list(), ast_variables_destroy(), ASTCHANTYPECOUNT, header_generic(), and ast_variable::next.
Referenced by init_asterisk_mib().
{
static unsigned long long_ret;
struct ast_variable *channel_types, *next;
if (header_generic(vp, name, length, exact, var_len, write_method))
return NULL;
if (vp->magic != ASTCHANTYPECOUNT)
return NULL;
for (long_ret = 0, channel_types = next = ast_channeltype_list(); next; next = next->next)
long_ret++;
ast_variables_destroy(channel_types);
return (u_char *)&long_ret;
}
| 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] |
Definition at line 545 of file agent.c.
References ast_channel_iterator_all_new(), ast_channel_iterator_destroy(), ast_channel_iterator_next(), 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, ast_variable::name, ast_variable::next, ast_channel::tech, ast_channel_tech::transfer, and ast_channel_tech::type.
Referenced by init_asterisk_mib().
{
const struct ast_channel_tech *tech = NULL;
struct ast_variable *channel_types, *next;
static unsigned long long_ret;
struct ast_channel *chan;
u_long i;
if (header_simple_table(vp, name, length, exact, var_len, write_method, -1))
return NULL;
channel_types = ast_channeltype_list();
for (i = 1, next = channel_types; next && i != name[*length - 1]; next = next->next, i++)
;
if (next != NULL)
tech = ast_get_channel_tech(next->name);
ast_variables_destroy(channel_types);
if (next == NULL || tech == NULL)
return NULL;
switch (vp->magic) {
case ASTCHANTYPEINDEX:
long_ret = name[*length - 1];
return (u_char *)&long_ret;
case ASTCHANTYPENAME:
*var_len = strlen(tech->type);
return (u_char *)tech->type;
case ASTCHANTYPEDESC:
*var_len = strlen(tech->description);
return (u_char *)tech->description;
case ASTCHANTYPEDEVSTATE:
long_ret = tech->devicestate ? 1 : 2;
return (u_char *)&long_ret;
case ASTCHANTYPEINDICATIONS:
long_ret = tech->indicate ? 1 : 2;
return (u_char *)&long_ret;
case ASTCHANTYPETRANSFER:
long_ret = tech->transfer ? 1 : 2;
return (u_char *)&long_ret;
case ASTCHANTYPECHANNELS:
{
struct ast_channel_iterator *iter;
long_ret = 0;
if (!(iter = ast_channel_iterator_all_new())) {
return NULL;
}
while ((chan = ast_channel_iterator_next(iter))) {
if (chan->tech == tech) {
long_ret++;
}
chan = ast_channel_unref(chan);
}
ast_channel_iterator_destroy(iter);
return (u_char *)&long_ret;
}
default:
break;
}
return NULL;
}
| static u_char* ast_var_channels | ( | struct variable * | vp, |
| oid * | name, | ||
| size_t * | length, | ||
| int | exact, | ||
| size_t * | var_len, | ||
| WriteMethod ** | write_method | ||
| ) | [static] |
Definition at line 212 of file agent.c.
References ast_active_channels(), ASTCHANCOUNT, and header_generic().
Referenced by init_asterisk_mib().
{
static unsigned long long_ret;
if (header_generic(vp, name, length, exact, var_len, write_method))
return NULL;
if (vp->magic != ASTCHANCOUNT)
return NULL;
long_ret = ast_active_channels();
return (u_char *)&long_ret;
}
| 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] |
Definition at line 228 of file agent.c.
References ast_channel::_state, ast_channel::accountcode, ast_channel::adsicpe, ast_channel::amaflags, ast_party_caller::ani, ast_party_caller::ani2, ast_channel::appl, ast_active_channels(), ast_bridged_channel(), ast_channel_iterator_all_new(), ast_channel_iterator_destroy(), ast_channel_iterator_next(), ast_channel_lock, ast_channel_unlock, ast_channel_unref, 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, ASTCHANMACROCONTEXT, ASTCHANMACROEXTEN, ASTCHANMACROPRI, ASTCHANMASQ, ASTCHANMASQR, ASTCHANMUSICCLASS, ASTCHANMUTED, ASTCHANNAME, ASTCHANPICKUPGROUP, ASTCHANPRI, ASTCHANRINGS, ASTCHANSTATE, ASTCHANTONEZONE, ASTCHANTRANSFERCAP, ASTCHANTYPE, ASTCHANUNIQUEID, ASTCHANVARIABLES, ASTCHANWHENHANGUP, ast_channel::bridge, ast_channel::call_forward, ast_channel::caller, ast_channel::callgroup, ast_channel::context, ast_tone_zone::country, ast_channel::data, ast_channel::dialed, ast_channel::exten, ast_channel::flags, ast_party_redirecting::from, ast_channel::hangupcause, header_simple_table(), ast_party_caller::id, ast_channel::language, ast_channel::macrocontext, ast_channel::macroexten, ast_channel::macropriority, ast_channel::masq, ast_channel::masqr, ast_channel::musicclass, ast_party_id::name, ast_channel::name, ast_party_id::number, ast_party_dialed::number, pbx_builtin_serialize_variables(), ast_channel::pickupgroup, ast_party_number::plan, ast_channel::priority, ast_channel::redirecting, ast_channel::rings, ast_party_name::str, ast_party_number::str, ast_party_dialed::str, ast_channel::tech, ast_channel::transfercapability, ast_party_dialed::transit_network_select, ast_channel_tech::type, ast_channel::uniqueid, ast_party_name::valid, ast_party_number::valid, ast_channel::whentohangup, and ast_channel::zone.
Referenced by init_asterisk_mib().
{
static unsigned long long_ret;
static u_char bits_ret[2];
static char string_ret[256];
struct ast_channel *chan, *bridge;
struct timeval tval;
u_char *ret = NULL;
int i, bit;
struct ast_str *out = ast_str_alloca(2048);
struct ast_channel_iterator *iter;
if (header_simple_table(vp, name, length, exact, var_len, write_method, ast_active_channels()))
return NULL;
i = name[*length - 1] - 1;
if (!(iter = ast_channel_iterator_all_new())) {
return NULL;
}
while ((chan = ast_channel_iterator_next(iter)) && i) {
ast_channel_unref(chan);
i--;
}
iter = ast_channel_iterator_destroy(iter);
if (chan == NULL) {
return NULL;
}
*var_len = sizeof(long_ret);
ast_channel_lock(chan);
switch (vp->magic) {
case ASTCHANINDEX:
long_ret = name[*length - 1];
ret = (u_char *)&long_ret;
break;
case ASTCHANNAME:
if (!ast_strlen_zero(chan->name)) {
strncpy(string_ret, chan->name, sizeof(string_ret));
string_ret[sizeof(string_ret) - 1] = '\0';
*var_len = strlen(string_ret);
ret = (u_char *)string_ret;
}
break;
case ASTCHANLANGUAGE:
if (!ast_strlen_zero(chan->language)) {
strncpy(string_ret, chan->language, sizeof(string_ret));
string_ret[sizeof(string_ret) - 1] = '\0';
*var_len = strlen(string_ret);
ret = (u_char *)string_ret;
}
break;
case ASTCHANTYPE:
strncpy(string_ret, chan->tech->type, sizeof(string_ret));
string_ret[sizeof(string_ret) - 1] = '\0';
*var_len = strlen(string_ret);
ret = (u_char *)string_ret;
break;
case ASTCHANMUSICCLASS:
if (!ast_strlen_zero(chan->musicclass)) {
strncpy(string_ret, chan->musicclass, sizeof(string_ret));
string_ret[sizeof(string_ret) - 1] = '\0';
*var_len = strlen(string_ret);
ret = (u_char *)string_ret;
}
break;
case ASTCHANBRIDGE:
if ((bridge = ast_bridged_channel(chan)) != NULL) {
strncpy(string_ret, bridge->name, sizeof(string_ret));
string_ret[sizeof(string_ret) - 1] = '\0';
*var_len = strlen(string_ret);
ret = (u_char *)string_ret;
}
break;
case ASTCHANMASQ:
if (chan->masq && !ast_strlen_zero(chan->masq->name)) {
strncpy(string_ret, chan->masq->name, sizeof(string_ret));
string_ret[sizeof(string_ret) - 1] = '\0';
*var_len = strlen(string_ret);
ret = (u_char *)string_ret;
}
break;
case ASTCHANMASQR:
if (chan->masqr && !ast_strlen_zero(chan->masqr->name)) {
strncpy(string_ret, chan->masqr->name, sizeof(string_ret));
string_ret[sizeof(string_ret) - 1] = '\0';
*var_len = strlen(string_ret);
ret = (u_char *)string_ret;
}
break;
case ASTCHANWHENHANGUP:
if (!ast_tvzero(chan->whentohangup)) {
gettimeofday(&tval, NULL);
long_ret = difftime(chan->whentohangup.tv_sec, tval.tv_sec) * 100 - tval.tv_usec / 10000;
ret= (u_char *)&long_ret;
}
break;
case ASTCHANAPP:
if (chan->appl) {
strncpy(string_ret, chan->appl, sizeof(string_ret));
string_ret[sizeof(string_ret) - 1] = '\0';
*var_len = strlen(string_ret);
ret = (u_char *)string_ret;
}
break;
case ASTCHANDATA:
if (chan->data) {
strncpy(string_ret, chan->data, sizeof(string_ret));
string_ret[sizeof(string_ret) - 1] = '\0';
*var_len = strlen(string_ret);
ret = (u_char *)string_ret;
}
break;
case ASTCHANCONTEXT:
strncpy(string_ret, chan->context, sizeof(string_ret));
string_ret[sizeof(string_ret) - 1] = '\0';
*var_len = strlen(string_ret);
ret = (u_char *)string_ret;
break;
case ASTCHANMACROCONTEXT:
strncpy(string_ret, chan->macrocontext, sizeof(string_ret));
string_ret[sizeof(string_ret) - 1] = '\0';
*var_len = strlen(string_ret);
ret = (u_char *)string_ret;
break;
case ASTCHANMACROEXTEN:
strncpy(string_ret, chan->macroexten, sizeof(string_ret));
string_ret[sizeof(string_ret) - 1] = '\0';
*var_len = strlen(string_ret);
ret = (u_char *)string_ret;
break;
case ASTCHANMACROPRI:
long_ret = chan->macropriority;
ret = (u_char *)&long_ret;
break;
case ASTCHANEXTEN:
strncpy(string_ret, chan->exten, sizeof(string_ret));
string_ret[sizeof(string_ret) - 1] = '\0';
*var_len = strlen(string_ret);
ret = (u_char *)string_ret;
break;
case ASTCHANPRI:
long_ret = chan->priority;
ret = (u_char *)&long_ret;
break;
case ASTCHANACCOUNTCODE:
if (!ast_strlen_zero(chan->accountcode)) {
strncpy(string_ret, chan->accountcode, sizeof(string_ret));
string_ret[sizeof(string_ret) - 1] = '\0';
*var_len = strlen(string_ret);
ret = (u_char *)string_ret;
}
break;
case ASTCHANFORWARDTO:
if (!ast_strlen_zero(chan->call_forward)) {
strncpy(string_ret, chan->call_forward, sizeof(string_ret));
string_ret[sizeof(string_ret) - 1] = '\0';
*var_len = strlen(string_ret);
ret = (u_char *)string_ret;
}
break;
case ASTCHANUNIQUEID:
strncpy(string_ret, chan->uniqueid, sizeof(string_ret));
string_ret[sizeof(string_ret) - 1] = '\0';
*var_len = strlen(string_ret);
ret = (u_char *)string_ret;
break;
case ASTCHANCALLGROUP:
long_ret = chan->callgroup;
ret = (u_char *)&long_ret;
break;
case ASTCHANPICKUPGROUP:
long_ret = chan->pickupgroup;
ret = (u_char *)&long_ret;
break;
case ASTCHANSTATE:
long_ret = chan->_state & 0xffff;
ret = (u_char *)&long_ret;
break;
case ASTCHANMUTED:
long_ret = chan->_state & AST_STATE_MUTE ? 1 : 2;
ret = (u_char *)&long_ret;
break;
case ASTCHANRINGS:
long_ret = chan->rings;
ret = (u_char *)&long_ret;
break;
case ASTCHANCIDDNID:
if (chan->dialed.number.str) {
strncpy(string_ret, chan->dialed.number.str, sizeof(string_ret));
string_ret[sizeof(string_ret) - 1] = '\0';
*var_len = strlen(string_ret);
ret = (u_char *)string_ret;
}
break;
case ASTCHANCIDNUM:
if (chan->caller.id.number.valid && chan->caller.id.number.str) {
strncpy(string_ret, chan->caller.id.number.str, sizeof(string_ret));
string_ret[sizeof(string_ret) - 1] = '\0';
*var_len = strlen(string_ret);
ret = (u_char *)string_ret;
}
break;
case ASTCHANCIDNAME:
if (chan->caller.id.name.valid && chan->caller.id.name.str) {
strncpy(string_ret, chan->caller.id.name.str, sizeof(string_ret));
string_ret[sizeof(string_ret) - 1] = '\0';
*var_len = strlen(string_ret);
ret = (u_char *)string_ret;
}
break;
case ASTCHANCIDANI:
if (chan->caller.ani.number.valid && chan->caller.ani.number.str) {
strncpy(string_ret, chan->caller.ani.number.str, sizeof(string_ret));
string_ret[sizeof(string_ret) - 1] = '\0';
*var_len = strlen(string_ret);
ret = (u_char *)string_ret;
}
break;
case ASTCHANCIDRDNIS:
if (chan->redirecting.from.number.valid && chan->redirecting.from.number.str) {
strncpy(string_ret, chan->redirecting.from.number.str, sizeof(string_ret));
string_ret[sizeof(string_ret) - 1] = '\0';
*var_len = strlen(string_ret);
ret = (u_char *)string_ret;
}
break;
case ASTCHANCIDPRES:
long_ret = ast_party_id_presentation(&chan->caller.id);
ret = (u_char *)&long_ret;
break;
case ASTCHANCIDANI2:
long_ret = chan->caller.ani2;
ret = (u_char *)&long_ret;
break;
case ASTCHANCIDTON:
long_ret = chan->caller.id.number.plan;
ret = (u_char *)&long_ret;
break;
case ASTCHANCIDTNS:
long_ret = chan->dialed.transit_network_select;
ret = (u_char *)&long_ret;
break;
case ASTCHANAMAFLAGS:
long_ret = chan->amaflags;
ret = (u_char *)&long_ret;
break;
case ASTCHANADSI:
long_ret = chan->adsicpe;
ret = (u_char *)&long_ret;
break;
case ASTCHANTONEZONE:
if (chan->zone) {
strncpy(string_ret, chan->zone->country, sizeof(string_ret));
string_ret[sizeof(string_ret) - 1] = '\0';
*var_len = strlen(string_ret);
ret = (u_char *)string_ret;
}
break;
case ASTCHANHANGUPCAUSE:
long_ret = chan->hangupcause;
ret = (u_char *)&long_ret;
break;
case ASTCHANVARIABLES:
if (pbx_builtin_serialize_variables(chan, &out)) {
*var_len = ast_str_strlen(out);
ret = (u_char *)ast_str_buffer(out);
}
break;
case ASTCHANFLAGS:
bits_ret[0] = 0;
for (bit = 0; bit < 8; bit++)
bits_ret[0] |= ((chan->flags & (1 << bit)) >> bit) << (7 - bit);
bits_ret[1] = 0;
for (bit = 0; bit < 8; bit++)
bits_ret[1] |= (((chan->flags >> 8) & (1 << bit)) >> bit) << (7 - bit);
*var_len = 2;
ret = bits_ret;
break;
case ASTCHANTRANSFERCAP:
long_ret = chan->transfercapability;
ret = (u_char *)&long_ret;
default:
break;
}
ast_channel_unlock(chan);
chan = ast_channel_unref(chan);
return ret;
}
| static u_char* ast_var_Config | ( | struct variable * | vp, |
| oid * | name, | ||
| size_t * | length, | ||
| int | exact, | ||
| size_t * | var_len, | ||
| WriteMethod ** | write_method | ||
| ) | [static] |
Definition at line 645 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, and header_generic().
Referenced by init_asterisk_mib().
{
static unsigned long long_ret;
struct timeval tval;
if (header_generic(vp, name, length, exact, var_len, write_method))
return NULL;
switch (vp->magic) {
case ASTCONFUPTIME:
gettimeofday(&tval, NULL);
long_ret = difftime(tval.tv_sec, ast_startuptime.tv_sec) * 100 + tval.tv_usec / 10000 - ast_startuptime.tv_usec / 10000;
return (u_char *)&long_ret;
case ASTCONFRELOADTIME:
gettimeofday(&tval, NULL);
if (ast_lastreloadtime.tv_sec)
long_ret = difftime(tval.tv_sec, ast_lastreloadtime.tv_sec) * 100 + tval.tv_usec / 10000 - ast_lastreloadtime.tv_usec / 10000;
else
long_ret = difftime(tval.tv_sec, ast_startuptime.tv_sec) * 100 + tval.tv_usec / 10000 - ast_startuptime.tv_usec / 10000;
return (u_char *)&long_ret;
case ASTCONFPID:
long_ret = getpid();
return (u_char *)&long_ret;
case ASTCONFSOCKET:
*var_len = strlen(ast_config_AST_SOCKET);
return (u_char *)ast_config_AST_SOCKET;
case ASTCONFACTIVECALLS:
long_ret = ast_active_calls();
return (u_char *)&long_ret;
case ASTCONFPROCESSEDCALLS:
long_ret = ast_processed_calls();
return (u_char *)&long_ret;
default:
break;
}
return NULL;
}
| static u_char* ast_var_indications | ( | struct variable * | vp, |
| oid * | name, | ||
| size_t * | length, | ||
| int | exact, | ||
| size_t * | var_len, | ||
| WriteMethod ** | write_method | ||
| ) | [static] |
Definition at line 684 of file agent.c.
References ao2_iterator_next, ast_copy_string(), ast_get_indication_zone(), ast_tone_zone_iterator_init(), ast_tone_zone_unref(), ASTINDCOUNT, ASTINDCURRENT, ast_tone_zone::country, header_generic(), and tz.
Referenced by init_asterisk_mib().
{
static unsigned long long_ret;
static char ret_buf[128];
struct ast_tone_zone *tz = NULL;
if (header_generic(vp, name, length, exact, var_len, write_method))
return NULL;
switch (vp->magic) {
case ASTINDCOUNT:
{
struct ao2_iterator i;
long_ret = 0;
i = ast_tone_zone_iterator_init();
while ((tz = ao2_iterator_next(&i))) {
tz = ast_tone_zone_unref(tz);
long_ret++;
}
return (u_char *) &long_ret;
}
case ASTINDCURRENT:
tz = ast_get_indication_zone(NULL);
if (tz) {
ast_copy_string(ret_buf, tz->country, sizeof(ret_buf));
*var_len = strlen(ret_buf);
tz = ast_tone_zone_unref(tz);
return (u_char *) ret_buf;
}
*var_len = 0;
return NULL;
default:
break;
}
return NULL;
}
| 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] |
Definition at line 725 of file agent.c.
References 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, ast_tone_zone::country, ast_tone_zone::description, header_simple_table(), and tz.
Referenced by init_asterisk_mib().
{
static unsigned long long_ret;
static char ret_buf[256];
struct ast_tone_zone *tz = NULL;
int i;
struct ao2_iterator iter;
if (header_simple_table(vp, name, length, exact, var_len, write_method, -1)) {
return NULL;
}
i = name[*length - 1] - 1;
iter = ast_tone_zone_iterator_init();
while ((tz = ao2_iterator_next(&iter)) && i) {
tz = ast_tone_zone_unref(tz);
i--;
}
if (tz == NULL) {
return NULL;
}
switch (vp->magic) {
case ASTINDINDEX:
long_ret = name[*length - 1];
return (u_char *)&long_ret;
case ASTINDCOUNTRY:
ast_copy_string(ret_buf, tz->country, sizeof(ret_buf));
tz = ast_tone_zone_unref(tz);
*var_len = strlen(ret_buf);
return (u_char *) ret_buf;
case ASTINDALIAS:
/* No longer exists */
return NULL;
case ASTINDDESCRIPTION:
ast_tone_zone_lock(tz);
ast_copy_string(ret_buf, tz->description, sizeof(ret_buf));
ast_tone_zone_unlock(tz);
tz = ast_tone_zone_unref(tz);
*var_len = strlen(ret_buf);
return (u_char *) ret_buf;
default:
break;
}
return NULL;
}
| static u_char* ast_var_Modules | ( | struct variable * | vp, |
| oid * | name, | ||
| size_t * | length, | ||
| int | exact, | ||
| size_t * | var_len, | ||
| WriteMethod ** | write_method | ||
| ) | [static] |
Definition at line 781 of file agent.c.
References ast_update_module_list(), ASTMODCOUNT, countmodule(), and header_generic().
Referenced by init_asterisk_mib().
{
static unsigned long long_ret;
if (header_generic(vp, name, length, exact, var_len, write_method))
return NULL;
if (vp->magic != ASTMODCOUNT)
return NULL;
long_ret = ast_update_module_list(countmodule, NULL);
return (u_char *)&long_ret;
}
| static u_char* ast_var_Version | ( | struct variable * | vp, |
| oid * | name, | ||
| size_t * | length, | ||
| int | exact, | ||
| size_t * | var_len, | ||
| WriteMethod ** | write_method | ||
| ) | [static] |
Definition at line 797 of file agent.c.
References ast_get_version(), ast_get_version_num(), ASTVERSTRING, ASTVERTAG, header_generic(), and version.
Referenced by init_asterisk_mib().
{
static unsigned long long_ret;
if (header_generic(vp, name, length, exact, var_len, write_method))
return NULL;
switch (vp->magic) {
case ASTVERSTRING:
{
const char *version = ast_get_version();
*var_len = strlen(version);
return (u_char *)version;
}
case ASTVERTAG:
sscanf(ast_get_version_num(), "%30lu", &long_ret);
return (u_char *)&long_ret;
default:
break;
}
return NULL;
}
| static int countmodule | ( | const char * | mod, |
| const char * | desc, | ||
| int | use, | ||
| const char * | like | ||
| ) | [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 void init_asterisk_mib | ( | void | ) | [static] |
Definition at line 827 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, ASTCHANMACROCONTEXT, ASTCHANMACROEXTEN, ASTCHANMACROPRI, 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, ASTINDALIAS, ASTINDCOUNT, ASTINDCOUNTRY, ASTINDCURRENT, ASTINDDESCRIPTION, ASTINDICATIONS, ASTINDINDEX, ASTINDTABLE, ASTMODCOUNT, ASTMODULES, ASTVERSION, ASTVERSTRING, ASTVERTAG, register_sysORTable(), and term_asterisk_mib().
Referenced by agent_thread().
{
static struct variable4 asterisk_vars[] = {
{ASTVERSTRING, ASN_OCTET_STR, RONLY, ast_var_Version, 2, {ASTVERSION, ASTVERSTRING}},
{ASTVERTAG, ASN_UNSIGNED, RONLY, ast_var_Version, 2, {ASTVERSION, ASTVERTAG}},
{ASTCONFUPTIME, ASN_TIMETICKS, RONLY, ast_var_Config, 2, {ASTCONFIGURATION, ASTCONFUPTIME}},
{ASTCONFRELOADTIME, ASN_TIMETICKS, RONLY, ast_var_Config, 2, {ASTCONFIGURATION, ASTCONFRELOADTIME}},
{ASTCONFPID, ASN_INTEGER, RONLY, ast_var_Config, 2, {ASTCONFIGURATION, ASTCONFPID}},
{ASTCONFSOCKET, ASN_OCTET_STR, RONLY, ast_var_Config, 2, {ASTCONFIGURATION, ASTCONFSOCKET}},
{ASTCONFACTIVECALLS, ASN_GAUGE, RONLY, ast_var_Config, 2, {ASTCONFIGURATION, ASTCONFACTIVECALLS}},
{ASTCONFPROCESSEDCALLS, ASN_COUNTER, RONLY, ast_var_Config, 2, {ASTCONFIGURATION, ASTCONFPROCESSEDCALLS}},
{ASTMODCOUNT, ASN_INTEGER, RONLY, ast_var_Modules , 2, {ASTMODULES, ASTMODCOUNT}},
{ASTINDCOUNT, ASN_INTEGER, RONLY, ast_var_indications, 2, {ASTINDICATIONS, ASTINDCOUNT}},
{ASTINDCURRENT, ASN_OCTET_STR, RONLY, ast_var_indications, 2, {ASTINDICATIONS, ASTINDCURRENT}},
{ASTINDINDEX, ASN_INTEGER, RONLY, ast_var_indications_table, 4, {ASTINDICATIONS, ASTINDTABLE, 1, ASTINDINDEX}},
{ASTINDCOUNTRY, ASN_OCTET_STR, RONLY, ast_var_indications_table, 4, {ASTINDICATIONS, ASTINDTABLE, 1, ASTINDCOUNTRY}},
{ASTINDALIAS, ASN_OCTET_STR, RONLY, ast_var_indications_table, 4, {ASTINDICATIONS, ASTINDTABLE, 1, ASTINDALIAS}},
{ASTINDDESCRIPTION, ASN_OCTET_STR, RONLY, ast_var_indications_table, 4, {ASTINDICATIONS, ASTINDTABLE, 1, ASTINDDESCRIPTION}},
{ASTCHANCOUNT, ASN_GAUGE, RONLY, ast_var_channels, 2, {ASTCHANNELS, ASTCHANCOUNT}},
{ASTCHANINDEX, ASN_INTEGER, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANINDEX}},
{ASTCHANNAME, ASN_OCTET_STR, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANNAME}},
{ASTCHANLANGUAGE, ASN_OCTET_STR, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANLANGUAGE}},
{ASTCHANTYPE, ASN_OCTET_STR, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANTYPE}},
{ASTCHANMUSICCLASS, ASN_OCTET_STR, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANMUSICCLASS}},
{ASTCHANBRIDGE, ASN_OCTET_STR, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANBRIDGE}},
{ASTCHANMASQ, ASN_OCTET_STR, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANMASQ}},
{ASTCHANMASQR, ASN_OCTET_STR, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANMASQR}},
{ASTCHANWHENHANGUP, ASN_TIMETICKS, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANWHENHANGUP}},
{ASTCHANAPP, ASN_OCTET_STR, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANAPP}},
{ASTCHANDATA, ASN_OCTET_STR, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANDATA}},
{ASTCHANCONTEXT, ASN_OCTET_STR, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANCONTEXT}},
{ASTCHANMACROCONTEXT, ASN_OCTET_STR, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANMACROCONTEXT}},
{ASTCHANMACROEXTEN, ASN_OCTET_STR, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANMACROEXTEN}},
{ASTCHANMACROPRI, ASN_INTEGER, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANMACROPRI}},
{ASTCHANEXTEN, ASN_OCTET_STR, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANEXTEN}},
{ASTCHANPRI, ASN_INTEGER, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANPRI}},
{ASTCHANACCOUNTCODE, ASN_OCTET_STR, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANACCOUNTCODE}},
{ASTCHANFORWARDTO, ASN_OCTET_STR, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANFORWARDTO}},
{ASTCHANUNIQUEID, ASN_OCTET_STR, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANUNIQUEID}},
{ASTCHANCALLGROUP, ASN_UNSIGNED, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANCALLGROUP}},
{ASTCHANPICKUPGROUP, ASN_UNSIGNED, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANPICKUPGROUP}},
{ASTCHANSTATE, ASN_INTEGER, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANSTATE}},
{ASTCHANMUTED, ASN_INTEGER, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANMUTED}},
{ASTCHANRINGS, ASN_INTEGER, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANRINGS}},
{ASTCHANCIDDNID, ASN_OCTET_STR, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANCIDDNID}},
{ASTCHANCIDNUM, ASN_OCTET_STR, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANCIDNUM}},
{ASTCHANCIDNAME, ASN_OCTET_STR, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANCIDNAME}},
{ASTCHANCIDANI, ASN_OCTET_STR, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANCIDANI}},
{ASTCHANCIDRDNIS, ASN_OCTET_STR, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANCIDRDNIS}},
{ASTCHANCIDPRES, ASN_OCTET_STR, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANCIDPRES}},
{ASTCHANCIDANI2, ASN_INTEGER, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANCIDANI2}},
{ASTCHANCIDTON, ASN_INTEGER, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANCIDTON}},
{ASTCHANCIDTNS, ASN_INTEGER, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANCIDTNS}},
{ASTCHANAMAFLAGS, ASN_INTEGER, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANAMAFLAGS}},
{ASTCHANADSI, ASN_INTEGER, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANADSI}},
{ASTCHANTONEZONE, ASN_OCTET_STR, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANTONEZONE}},
{ASTCHANHANGUPCAUSE, ASN_INTEGER, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANHANGUPCAUSE}},
{ASTCHANVARIABLES, ASN_OCTET_STR, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANVARIABLES}},
{ASTCHANFLAGS, ASN_OCTET_STR, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANFLAGS}},
{ASTCHANTRANSFERCAP, ASN_INTEGER, RONLY, ast_var_channels_table, 4, {ASTCHANNELS, ASTCHANTABLE, 1, ASTCHANTRANSFERCAP}},
{ASTCHANTYPECOUNT, ASN_INTEGER, RONLY, ast_var_channel_types, 2, {ASTCHANNELS, ASTCHANTYPECOUNT}},
{ASTCHANTYPEINDEX, ASN_INTEGER, RONLY, ast_var_channel_types_table, 4, {ASTCHANNELS, ASTCHANTYPETABLE, 1, ASTCHANTYPEINDEX}},
{ASTCHANTYPENAME, ASN_OCTET_STR, RONLY, ast_var_channel_types_table, 4, {ASTCHANNELS, ASTCHANTYPETABLE, 1, ASTCHANTYPENAME}},
{ASTCHANTYPEDESC, ASN_OCTET_STR, RONLY, ast_var_channel_types_table, 4, {ASTCHANNELS, ASTCHANTYPETABLE, 1, ASTCHANTYPEDESC}},
{ASTCHANTYPEDEVSTATE, ASN_INTEGER, RONLY, ast_var_channel_types_table, 4, {ASTCHANNELS, ASTCHANTYPETABLE, 1, ASTCHANTYPEDEVSTATE}},
{ASTCHANTYPEINDICATIONS, ASN_INTEGER, RONLY, ast_var_channel_types_table, 4, {ASTCHANNELS, ASTCHANTYPETABLE, 1, ASTCHANTYPEINDICATIONS}},
{ASTCHANTYPETRANSFER, ASN_INTEGER, RONLY, ast_var_channel_types_table, 4, {ASTCHANNELS, ASTCHANTYPETABLE, 1, ASTCHANTYPETRANSFER}},
{ASTCHANTYPECHANNELS, ASN_GAUGE, RONLY, ast_var_channel_types_table, 4, {ASTCHANNELS, ASTCHANTYPETABLE, 1, ASTCHANTYPECHANNELS}},
{ASTCHANBRIDGECOUNT, ASN_GAUGE, RONLY, ast_var_channel_bridge, 3, {ASTCHANNELS, ASTCHANSCALARS, ASTCHANBRIDGECOUNT}},
};
register_sysORTable(asterisk_oid, OID_LENGTH(asterisk_oid),
"ASTERISK-MIB implementation for Asterisk.");
REGISTER_MIB("res_snmp", asterisk_vars, variable4, asterisk_oid);
snmp_register_callback(SNMP_CALLBACK_LIBRARY,
SNMP_CALLBACK_SHUTDOWN,
term_asterisk_mib, NULL);
}
| int register_sysORTable | ( | oid * | , |
| size_t | , | ||
| const char * | |||
| ) |
Referenced by init_asterisk_mib().
| static int term_asterisk_mib | ( | int | majorID, |
| int | minorID, | ||
| void * | serverarg, | ||
| void * | clientarg | ||
| ) | [static] |
Definition at line 821 of file agent.c.
References unregister_sysORTable().
Referenced by init_asterisk_mib().
{
unregister_sysORTable(asterisk_oid, OID_LENGTH(asterisk_oid));
return 0;
}
| int unregister_sysORTable | ( | oid * | , |
| size_t | |||
| ) |
Referenced by term_asterisk_mib().
oid asterisk_oid[] = { 1, 3, 6, 1, 4, 1, 22736, 1 } [static] |