gc_SetEvtMsk( )
Termination Events | Cautions | Errors | Example | See Also
Description
- Note: For technologies that support the gc_SetConfigData( ) function, it is recommended that the gc_SetConfigData( ) function be used instead of the gc_SetEvtMsk( ) function to set event masks. See the gc_SetConfigData( ) function description for more information.
The gc_SetEvtMsk( ) function sets the event mask associated with a specified line device. If an event mask parameter is cleared, the event will be disabled and will not be sent to the application. The default is to enable all events.
The linedev parameter may represent a network interface trunk or an individual channel, for example, a time slot. See the appropriate Global Call Technology User's Guide to determine the level of the event masks needed.
linedev Global Call line device handle mask specifies the events to be enabled or disabled by setting the bitmask. Multiple transition events may be enabled or disabled with one function call if the bitmask values are bitwise ORed. Possible mask values are listed in Table 15. action application may either set or reset the mask bit(s) as specified in mask. Possible actions are:
The GCEV_BLOCKED and GCEV_UNBLOCKED events are maskable on a line device representing a trunk or a time slot level. The application may disable (mask) the event on any line device so that the event is not sent to that line device. For example, when a trunk alarm occurs, this alarm is reported via the GCEV_BLOCKED event. If the application has not masked (disabled) the GCEV_BLOCKED event on some or all of the opened time-slot level line devices on the trunk, the GCEV_BLOCKED event will be sent to each of the line devices on the trunk. Also, if this GCEV_BLOCKED event is not disabled on the board-level line device, the alarm is sent to the board.
The GCEV_ALERTING event is maskable as described above except that this event is always call related and always associated with a time-slot level line device. The time-slot level line device should be passed to the gc_SetEvtMsk( ) function.
See the appropriate Global Call Technology User's Guide for additional details.
Termination Events
Cautions
In the event of a failure, it is possible that there may be partial success; that is, some masks may be set or reset while others are not.
Errors
If this function returns <0 to indicate failure, use the gc_ErrorInfo( ) function to retrieve the reason for the error. See the "Error Handling" section in the Global Call API Programming Guide. All Global Call error codes are defined in the gcerr.h file. If the error returned is technology specific, see the technology-specific error header file(s) for the error definition (for example, ccerr.h or isdnerr.h file for the ISDN call control library).
Example
#include <stdio.h> #include <srllib.h> #include <gclib.h> #include <gcerr.h> /* * Assume the following has been done: * 1. The line device has been opened. */ int set_event_mask(LINEDEV ldev) { GC_INFO gc_error_info; /* GlobalCall error information data */ /* * Set the event Detected and Dialing event masks to enable * for this application. */ /* * Enable the Detected and Dialing events. */ if (gc_SetEvtMsk(ldev, (GCMSK_DETECTED | GCMSK_DIALING), GCACT_ADDMSK) != GC_SUCCESS) { /* process error return as shown */ gc_ErrorInfo( &gc_error_info ); printf ("Error: gc_SetEvtMsk() on device handle: 0x%lx, GC ErrorValue: 0x%hx - %s, CCLibID: %i - %s, CC ErrorValue: 0x%lx - %s\n", ldev, gc_error_info.gcValue, gc_error_info.gcMsg, gc_error_info.ccLibId, gc_error_info.ccLibName, gc_error_info.ccValue, gc_error_info.ccMsg); return (gc_error_info.gcValue); } /* * Proceed to generate or accept calls on this line device. */ /* * Now disable notification of Detected and Dialing events, * and enable notification of Alerting event, without * affecting any other event masks which may have been set. */ if (gc_SetEvtMsk(ldev, (GCMSK_DETECTED | GCMSK_DIALING), GCACT_SUBMSK) != GC_SUCCESS) { /* Process error */ } if (gc_SetEvtMsk(ldev, GCMSK_ALERTING, GCACT_ADDMSK) != GC_SUCCESS) { /* Process error */ } return (0); }See Also
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation