MIB Study Asterisk
Subscribe

From OpenNMS

Jump to: navigation, search

MIB definition is here.

Contents

What's Wrong Here

Speaking at a high level, this MIB is a good starting point, but it's not very useful for long-term monitoring or data collection for several reasons.

  • Too many strings
  • Too little use of table indexes
  • Channel indexes get reused

Making It Better

As a first phase, the overall MIB stucture should be reorganized into three sections -- configuration, footprint, and performance -- with enumerations and persistent indexes seeing much more use. The resulting "new" MIB should be hung off a new branch of the existing one, so as not to break the existing support that has seen daylight in Asterisk 1.4.

In a second phase, it would be very powerful to expose the Asterisk Manager Interface (AMI) via the MIB. AMI has several classes of commands for which users can be authorized in read and/or write modes. This access control could be duplicated using a combination of MIB views for authorization and v1 / v2c / USM authentication.

I'm working on a new MIB structure here.

The MIB, Deconstructed

A top-level view of the ASTERISK-MIB, with all tables collapsed:

Asterisk-mib-toplevel.gif

asteriskVersion

  • astVersionString
DisplayString: Text version string of the version of Asterisk that
the SNMP Agent was compiled to run against.
    • This object should be broken into a trio of Integers (major, minor, patchlevel)
  • astVersionTag
Unsigned32: SubVersion revision of the version of Asterisk that
the SNMP Agent was compiled to run against -- this is
typically 0 for release-versions of Asterisk.

asteriskConfiguration

  • astConfigUpTime
TimeTicks: Time ticks since Asterisk was started.
  • astConfigReloadTime
TimeTicks: Time ticks since Asterisk was last reloaded.
  • astConfigPid
Integer32: The process id of the running Asterisk process.
    • This object will overflow on platforms that use 64-bit PIDs. An astConfigPidHigh object should be added to hold the high-order 32 bits on such platforms. Also, an astConfigPid64 should be added to hold the entire value on such platforms when Integer64 is available (i.e. SNMPv2c and SNMPv3).
  • astConfigSocket
DisplayString: The control socket for giving Asterisk commands.

asteriskModules

  • astNumModules
Integer32: Number of modules currently loaded into Asterisk.
    • This object should be a Gauge. Also, a table is needed to enumerate the loaded modules.

asteriskIndications

Background: indications represent tones used to convey information within a call, e.g. dial tone, ringback, busy, congestion. Each country may have a different set of indications, typically referred to as "zones". So these objects really should have "zone" in their names for clarity.

  • astNumIndications
Integer32: Number of indications currently defined in Asterisk.
  • astCurrentIndication
DisplayString: Default indication zone to use.
    • This object should be an integer that correlates to the astIndicationsTable via astIndIndex.
  • astIndicationsTable -- see below

asteriskChannels

  • astNumChannels
Integer32: Current number of active channels.
    • This object should really be a Gauge.
  • astChannelTable -- see below
  • astNumChanTypes
Integer32: Number of channel types (technologies) supported.
  • astChanTypeTable -- see below

Tables

astIndicationsTable

Asterisk-mib-indications-table.gif

astChanTable

Asterisk-mib-chan-table.gif

  • astChanIndex
Integer32: Index into the channel table.
    • Currently these indexes are reused, which makes long-term tracking of data in this table impossible.
  • astChanLanguage
DisplayString: Which language the current channel is configured to
use -- used mainly for prompts.
    • Should be an integer that correlates to a (non-existent) table enumerating languages defined in the system.
  • astChanType
DisplayString: Underlying technology for the current channel.
    • Should be an enumerated integer, and should also correlate to the astChanTypeTable.
  • astChanMusicClass
DisplayString: Music class to be used for Music on Hold for this
channel.
    • Should be an integer correlated to a (non-existent) table enumerating MOH classes defined in the system.
    • NOTE: Is this even implemented? In my system running Asterisk SVN-trunk-r60141M (post-1.4), with musiconhold.conf present and both moninterpret and mohsuggest set for all channels, this column is missing from a walk of the astChanTable.
  • astChanBridge
DisplayString: Which channel this channel is currently bridged (in a
conversation) with.
    • Should be split into a TruthValue (is the channel bridged?) and an integer that correlates to another row in this table via astChanIndex. Note that channel index persistence will be a prerequisite for the latter change to be feasible.
  • astChanMasq
DisplayString: Channel masquerading for us.
    • Should be split into a TruthValue (is some channel masquerading for us?) and an integer that correlates to another row in this table via astChanIndex. Note that channel index persistence will be a prerequisite for the latter change to be feasible.
  • astChanMasqr
DisplayString: Channel we are masquerading for.
    • Should be split into a TruthValue (is this channel masquerading for some other channel?) and an integer that correlates to another row in this table via astChanIndex. Note that channel index persistence will be a prerequisite for the latter change to be feasible.
  • astChanWhenHangup
TimeTicks: How long until this channel will be hung up.
    • Should be split into a TruthValue (is this channel scheduled to be hung up?) and a TimeTicks indicating when hangup is scheduled.
  • astChanApp
DisplayString: Current application for the channel.
    • Should be an integer that correlates to a (non-existent) table enumerating the applications defined in the system.
  • astChanData
DisplayString: Arguments passed to the current application.
    • Name is unclear -- should be perhaps astChanAppData
  • astChanContext
DisplayString: Current extension context.
  • astChanMacroContext
DisplayString: Current macro context.
  • astChanMacroExten
DisplayString: Current macro extension.
  • astChanMacroPri
Integer32: Current macro priority.
    • The name of this object is ambiguous in the context of a telephony server (PRI =~ primary rate interface), and should be changed to astChanMacroPrio.
  • astChanExten
DisplayString: Current extension.
  • astChanPri
Integer32: Current priority.
    • The name of this object is ambiguous in the context of a telephony server (PRI =~ primary rate interface), and should be changed to astChanPrio.
  • astChanAccountCode
DisplayString: Account Code for billing.
  • astChanForwardTo
DisplayString: Where to forward to if asked to dial on this
interface.
    • TODO: I have no idea what this object is used for. It's not populated in my system running Asterisk SVN-trunk-r60141M (post-1.4), but that may be due to my configuration being fairly minimal.
  • astChanUniqueId
DisplayString: Unique Channel Identifier.
    • In my system running Asterisk SVN-trunk-r60141M (post-1.4), this string is of the form "1178624006.2", where

1178624006 is a Unix timestamp and 2 is an ordinal accounting for multiple channels being spawned within the same clock second.

  • astChanCallGroup
Unsigned32: Call Group.
  • astChanPickupGroup
Unsigned32: Pickup Group.
  • astChanState
INTEGER:  stateDown(0), stateReserved(1), stateOffHook(2), stateDialing(3),
stateRing(4), stateRinging(5), stateUp(6), stateBusy(7), stateDialingOffHook(8),
statePreRing(9)
  • astChanMuted
TruthValue: Transmission of voice data has been muted.
    • Suggests that the original MIB author did know about TruthValue!
  • astChanRings
Integer32: Number of rings so far.
    • Should be explicitly denoted as a Counter.
  • astChanCidDNID
DisplayString: Dialled Number ID.
  • astChanCidNum
DisplayString: Caller Number.
  • astChanCidName
DisplayString: Caller Name.
  • astCanCidANI
DisplayString: ANI.
    • Object name is misspelt, should be astChanCidANI
  • astChanCidRDNIS
DisplayString: Redirected Dialled Number Service.
    • RDNIS would come into play when calls to one extension are automatically forwarded to another extension (RDNIS defined). Unclear whether this column is implemented; it is missing from walks of this table in my system running Asterisk SVN-trunk-r60141M (post-1.4), but I don't currently have a reliable way to generate a call that carries RDNIS data.
  • astChanCidPresentation
DisplayString: Number Presentation/Screening.
    • Unclear whether this column is implemented, and what its value should look like. In my system running Asterisk SVN-trunk-r60141M (post-1.4), the column is present but empty in walks of this table.
  • astChanCidANI2
Integer32: ANI 2 (info digit).
    • ANI2 carries information about the kind of station that terminated the call (regular POTS line, pay phone, etc.)
  • astChanCidTON
Integer32: Type of Number.
    • TON is an RDNIS-specific concept (see above)
  • astChanCidTNS
Integer32: Transit Network Select.
    • I can't find any information on what TNS is. In my walks of this table, this column's value has always been zero.
  • astChanAMAFlags
INTEGER: Default(0), Omit(1), Billing(2), Documentation(3)
    • AMA is Automated Message Accounting, a standard CDR format. The Asterisk application command to set this value is SetAMAFlags.
  • astChanADSI
INTEGER: Whether or not ADSI is detected on CPE.
Unknown(0), Available(1), Unavailable(2), OffHookOnly(3)
  • astChanToneZone
DisplayString: Indication zone to use for channel.
    • Should be an integer that correlates to the astIndicationsTable via astIndIndex.
  • astChanHangupCause
INTEGER: Why is the channel hung up.
NotDefined(0), Unregistered(3), Normal(16), Busy(17), NoAnswer(19),
Congestion(34), Failure(38), NoSuchDriver(66)
  • astChanVariables
DisplayString: Channel Variables defined for this channel.
  • astChanFlags
BITS: Flags set on this channel.
WantsJitter(0), DeferDTMF(1), WriteInterrupt(2), Blocking(3), Zombie(4), Exception(5),
MusicOnHold(6), Spying(7), NativeBridge(8), AutoIncrementingLoop(9)
  • astChanTransferCap
INTEGER: Transfer Capabilities for this channel.
Speech(0), Digital(8), RestrictedDigital(9), Audio3k(16), DigitalWithTones(17), Video(24)

astChanTypeTable

Asterisk-mib-chan-type-table.gif