public class MonitorAsteriskActiveChannels
extends java.lang.Object
implements java.util.Observer, java.lang.Runnable
This class is written to test the Asterisk host functionality.
It walks the tree by creating a new AsteriskChanTablePdu out off the previous one, and it collects the values of all the channels.
The information will be printed to System.out .
The host, port, community name and sockettype can be configured in the
properties file.
The name of the properties file can be passed as first argument to
this application. If there is no such argument, it will look for
MonitorAsteriskActiveChannels.properties
. If this file does not exist, the
application will use default parameters.
Modifier and Type | Field and Description |
---|---|
static long |
SLEEPTIME
Use 10 (sec) as interval
|
Constructor and Description |
---|
MonitorAsteriskActiveChannels(java.lang.String propertiesFilename)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
getActiveChannels(SnmpContextBasisFace con,
AsteriskChanTablePdu prev)
Sends a request, asking for the active channels.
|
void |
init() |
static void |
main(java.lang.String[] args)
Main.
|
void |
run() |
void |
start() |
void |
update(java.util.Observable obs,
java.lang.Object ov)
Implementing the Observer interface.
|
public static final long SLEEPTIME
public MonitorAsteriskActiveChannels(java.lang.String propertiesFilename)
propertiesFilename
- The name of the properties file. Can be
null.public void init()
public void getActiveChannels(SnmpContextBasisFace con, AsteriskChanTablePdu prev)
public void start()
public void run()
run
in interface java.lang.Runnable
public void update(java.util.Observable obs, java.lang.Object ov)
update
in interface java.util.Observer
obs
- the pdu variableov
- the array of varbind (not used)AsteriskChanTablePdu
,
getActiveChannels(uk.co.westhawk.snmp.stack.SnmpContextBasisFace, uk.co.westhawk.examplev2c.AsteriskChanTablePdu)
public static void main(java.lang.String[] args)
MonitorAsteriskActiveChannels.properties
, pass the name as first argument.