
Description | Cautions | Example | Errors | See Also
Name: |
int cc_SetEvtMsk(linedev, mask, action) | |
Inputs: |
LINEDEV linedev |
|
unsigned long mask |
| |
int action |
| |
Returns: |
0 on success | |
Includes: |
cclib.h | |
Category: |
System tools | |
Mode: |
synchronous | |
Technology: |
BRI/2; BRI/SC; PRI (all protocols) | |
The cc_SetEvtMsk( ) function sets the event mask associated with the specified line device to support specific events in the application.
Parameter |
Description |
linedev: |
The line device handle. |
mask: |
The event to be enabled or disabled by setting the bitmask for that event (see Table 24). Multiple transition events may be enabled or disabled with one function call if the bitmask values are bitwise OR'ed. |
action: |
Specifies whether to set, add, or subtract the mask bit(s) as specified in the bitmask (see Table 25). |
The possible bitmask values and the actions that they control are described in Table 24 below.
Table 24. Bitmask Values
Bitmask Type |
Action |
Default |
CCMSK_ALERT |
Receiving CCEV_ALERTING |
Enabled |
CCMSK_CALLACK_SEND |
Application sends first response to SETUP CCMSK_CALLPROC_SEND message, either CALL_SETUP_ACK or |
Firmware sends first response to SETUP message |
CCMSK_PROCEEDING |
Receiving CCEV_PROCEEDING |
Enabled |
CCMSK_PROGRESS |
Receiving CCEV_PROGRESSING |
Enabled |
CCMSK_SERVICE |
Receiving CCEV_SERVICE. When this event arrives, the application should respond with a status message using cc_SndMsg( ). The firmware will not automatically respond to this message. |
Not enabled |
CCMSK_SERVICE_ACK |
Receiving CCEV_SETCHANSTATE. When this event is masked, cc_SetChanState( ) may be blocked. |
Not enabled |
CCMSK_SETUP_ACK |
Receiving CCEV_SETUP_ACK |
Not enabled |
CCMSK_STATUS |
Receiving CCEV_STATUS |
Not enabled |
CCMSK_STATUS_ |
Receiving CCEV_STATUS_ |
Not enabled |
CCMSK_TMREXPEVENT |
Receiving the CCEV_TIMER event. This event is generated when some timer expires at the firmware in Layer 3. Timer ID, Call ID and the value of the timer are returned. |
Not enabled |
The action parameter may either set or reset the mask bit(s) as specified in the bitmask. Possible actions are shown in Table 25 below.
Table 25. Bitmask Actions
Action |
Description |
CCACT_SETMSK: |
Enables notification of events specified in the bitmask and disables notification of previously set events. |
CCACT_ADDMSK: |
Enables notification of events specified in the bitmask in addition to previously set events. |
CCACT_SUBMSK: |
Disables notification of events specified in the bitmask. |
None
#include <windows.h> /* For Windows applications only */
#include <stdio.h>
#include <errno.h>
#include "srllib.h"
#include "dtilib.h"
#include "cclib.h"
void main()
{
short devhdl; /* device handle for D channel */
.
.
.
if ( cc_Open(devhdl,"dtiB1", 0 ) < 0 )
exit(1);
/*
* using cc_ SetEvtMsk (devhdl,CCMSK_PROGRESS
* | CCMSK_ALERT, CCACT_ADDMSK) to block the incoming ISDN
* message ALERTING and PROGRESSING. Note that the devhdl is a
* board level device.
*/
if ( cc_SetEvtMsk (devhdl, CCMSK_PROGRESS | CCMSK_ALERT,
CCACT_ADDMSK) < 0 )
procdevfail(devhdl);
/* continue the program. */
.
.
.
.
.
if ( cc_Close(devhdl) < 0 )
printf("Error closing device, errno = %d\n", errno);
procdevfail(devhdl);
}
int callfail(CRN crn)
{
LINEDEV ld;
cc_CRN2LineDev(crn,&ld);
procdevfail(ld);
}
int procdevfail(LINEDEV handle)
{
int reason;
char *msg;
reason = cc_CauseValue(handle);
cc_ResultMsg(handle, reason, &msg);
printf("reason = %x - %s\n",reason,msg);
}
If the function returns < 0 to indicate failure, use the cc_CauseValue( ) function to retrieve the reason code for the failure. The cc_ResultMsg( ) function can be used to interpret the reason code. Error codes are defined in the files ccerr.h, isdnerr.h, and isdncmd.h.
Error codes from the cc_SetEvtMask( ) function include the following:
Error Code |
Description |
ERR_ISDN_LIB | E_ISBADIF |
Bad interface number |
ERR_ISDN_LIB | E_ISBADPAR |
Bad input parameter |
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation