(Page 6 of 7 in this chapter)
Version
dtmStartTrunkMonitor
Description
Starts monitoring a specified trunk.
Prototype
DWORD
dtmStartTrunkMonitor
(
CTAHD
ctahd
,
unsigned
board
,
unsigned
trunk
,
DTMHD *
dtmhd
,
DTM_START_PARMS
*parms
)
ctahd
Handle returned by
ctaCreateContext
.
board
AG board number as specified in the configuration file.
trunk
The specific trunk on the board. The first trunk is 0.
dtmhd
Pointer to the returned monitor handle.
parms
Pointer to a parameter structure. Set this to
NULL
to use default values. The
DTM_START_PARMS
structure is:
typedef struct
{
DWORD size;
DWORD maxevents;
DWORD reportmask;
} DTM_START_PARMS;
Return Values
SUCCESS
CTAERR_BAD_ARGUMENT
Specified trunk number is invalid.
CTAERR_FUNCTION_ACTIVE
Already monitoring the specified trunk in the current context.
Events
DTMEVN_MONITOR_DONE
Monitoring ended. The
size
field contains board number in the high word and trunk number in the low word. The
value
field of the event contains an error code.
DTMEVN_MONITOR_STARTED
Monitoring started. The
value
and
size
fields are the same as for
DTMEVN_TRUNK_STATUS.
DTMEVN_TRUNK_STATUS
The
value
field contains a four-byte
DTM_TRUNK_STATE
structure. When the trunk is operational, all bytes are set to 0. The
size
field contains the
dtmhd
.
Details
This function starts monitoring a particular digital trunk and returns a DTM handle,
dtmhd
. Monitoring is active until it is stopped with
dtmStopTrunkMonitor
, until the DTM service is closed, or until the context associated with
ctahd
is destroyed. The
dtmhd
is valid until the application receives the
DONE
event from the call to
dtmStopTrunkMonitor
.
dtmStartTrunkMonitor
can be called multiple times on the same context for different trunks. Also, the same trunk can be simultaneously monitored by multiple contexts.
parms
points to a
DTM_START_PARMS
parameter structure. If
parms
is
NULL
, the default parameter values are used. Use NMS parameter management functions to change default parameter values for a processing context.
The fields in the
DTM_START_PARMS
structure include:
maxevents
, which defines the maximum number of status events that the DTM service can generate in a one second interval. Its default setting is 1. If status changes occur after the event limit is reached, there will be an event at the beginning of the next one second interval. Events that are solely the result of changes in the errored seconds counters are not included in the event limit.
reportmask
, which controls when the DTM services sends events. Its default setting is 1. It can be set to any of the following values:
Value
Sends events...
0
Only in response to
dtmRefreshTrunkStatus
.
1
Only when going in or out of alarm (ignoring type).
2
On any change in received alarms.
4
On any status/synchronization change (including Loss Of Signal).
8
On any slip.
0x10
On change in errored seconds counter
0x20
On change in failed seconds counter
0x40
On change in severe errored seconds counter
An application that wants to know when a trunk fails and when it is restored should use the default value of 1 for
reportmask
. Set
reportmask
to
0x7F
to get events when anything changes.
A
DTMEVN_MONITOR_STARTED
event, containing the current alarm status, will always be sent as soon as the monitoring is started.
dtmStartTrunkMonitor
fails if the board type does not support monitoring.
See Also
dtmStopTrunkMonitor
(Page 6 of 7 in this chapter)
Version
Want to send us feedback on our documentation? Email:
Tech_Pubs@nmss.com
Copyright © 2001, Natural MicroSystems, Inc. All rights reserved.