Previous PageTable Of Contents../index.htmlIndexNext Page

dx_setevtmsk( )

Description | Cautions | synchronous processing | asynchronous processing | Errors | See Also

Name:

int dx_setevtmsk(chdev,mask)

Inputs:

int chdev

  valid Dialogic channel device handle

 

unsigned int mask

  event mask of events to enable

Returns:

0 if successful

 

-1 if failure

Includes:

srllib.h

 

dxxxlib.h

Category:

Call Status Transition Event

Top Of PageDescription

The dx_setevtmsk( ) function enables detection of Call Status Transition (CST) events. When you enable detection of a CST event and the event occurs, it will be placed on the event queue. You can collect the event by getting it or waiting for it with an event handling function, such as sr_waitevt( ), sr_waitevtEx( ), or dx_getevt( ). The dx_setevtmsk( ) function can be used by synchronous or asynchronous applications waiting for a CST event.

NOTES:
1. This function can enable detection for all CST events except user-defined tone detection. See dx_addtone( ) and dx_enbtone( ) for information.
2. The dx_wtring( ) function also affects the CST events that are enabled. It enables detection of the DM_RINGS event and disables detection of other events.

The function parameters are defined as follows:

Parameter

Description

chdev

specifies the valid channel device handle obtained when the channel was opened using dx_open( ).

mask

specifies the events to enable. To enable multiple events, perform an OR operation on the bit masks of the events you want to enable. The first enabled CST event to occur will be returned. If an event is not specified in the mask, the event will be disabled. If an event is enabled, it will remain enabled until it is disabled through another function call. (Exception: See DM_DIGITS and DM_DIGOFF.) One or more of the following values can be specified:

 

DM_LCOFF

  wait for loop current to be off

 

DM_LCON

  wait for loop current to be on

 

DM_RINGS

  wait for rings; see also dx_wtring( )

 

DM_RNGOFF

  wait for ring to drop (hang-up)

 

DM_SILOF

  wait for non-silence

 

DM_SILON

  wait for silence

 

DM_WINK

  wait for wink to occur on an E&M line. If DM_WINK is not specified in the mask parameter and DM_RINGS is specified, a wink may be interpreted as an incoming call, depending upon the setting of the DXBD_R_ON parameter.

 

DM_DIGITS

  enable digit reporting on the event queue (each detected digit is reported as a separate event on the event queue)

When the event mask is set with DM_DIGITS, a digits flag is set that causes individual digit events to queue until this flag is turned off by the DM_DIGOFF equate. Setting the event mask for DM_DIGITS and then subsequently resetting the event mask without DM_DIGITS does not disable the queueing of digit events. Digit events will remain in the queue until collected by an event handling function such as sr_waitevt( ), sr_waitevtEx( ), or dx_getevt( ). The event queue is not affected by dx_getdig( ) calls. Example of enabling DM_DIGITS:

    /* Set event mask to collect digits */
    if (dx_setevtmsk(chdev, DM_DIGITS) == -1) {
 

DM_DIGOFF

  disable digit reporting on the event queue (as enabled by DM_DIGITS). This is the only way to disable DM_DIGITS. Example of disabling DM_DIGITS:

    dx_setevtmsk(DM_DIGOFF);
    dx_clrdigbuf(chdev); /*Clear out queue*/
 

DM_LCREV

  wait for flow of current to reverse (D/41ESC and D/160SC-LS boards only). On the D/21E, D/41E, or D/160SC-LS board, when the DM_LCREV bit is enabled, a DE_LCREV event message is queued when the flow of current over the line is reversed.

The following table outlines the synchronous or asynchronous handling of CST events:

Synchronous

Asynchronous

  1. Call dx_setevtmsk( ) to enable CST events

Call dx_setevtmsk( ) to enable CSTevents

  1. Call dx_getevt( ) to wait for CST events. Events are returned to the DX_EBLK structure.

Use SRL to asynchronously wait for for TDX_CST events.

Use sr_getevtdatap( ) to retrieve DX_CST structure.

Top Of PageCautions

If you call this function on a busy device, and specify DM_DIGITS as the mask argument, the function will fail.

Top Of Pagesynchronous processing

Top Of Pageasynchronous processing

Top Of PageErrors

If this function returns -1 to indicate failure, use ATDV_LASTERR( ) and ATDV_ERRMSGP( ) to retrieve one of the following error reasons:

EDX_BADPARM

  • Invalid Parameter

EDX_SYSTEM

Top Of PageSee Also

CST Event Handling and Retrieval:

Enabling User-Defined Tone Detection:


Previous PageTable Of ContentsTop Of PageIndexNext Page

Click here to contact Dialogic Customer Engineering

Copyright 2002, Dialogic Corporation
All rights reserved
This page generated February, 2002