ms_getevtmsk( )
Cautions | Errors | Example | See Also
Name: int ms_getevtmsk (devh, event, bitmaskp) Inputs:
Returns: Includes: Category: Mode: Platform: Description
The ms_getevtmsk( ) function returns a station event mask for a specified event.
devh the valid station device handle returned by a call to ms_open( ) event specifies an event's mask:MSEV_SIGMSKOn-hook transition eventOff-hook transition eventHookflash event bitmaskp pointer to a variable that will contain the value of the bitmask. Refer to ms_setevtmsk( ) for the valid bitmask values.
Ringing was stopped by ms_stopfn( ).
Ringing was stopped by ms_stopfn( ).
Cautions
Errors
If this function returns -1 to indicate failure, obtain the reason for the error by calling the SRL standard attribute function ATDV_LASTERR( ) or ATDV_ERRMSGP( ) to retrieve either the error code or a pointer to the error description, respectively.
Refer to the error type tables found in Chapter 5, "Error Codes". Error defines can be found in dtilib.h or msilib.h.
Example
#include <windows.h> /* For Windows applications only */ #include <errno.h> #include "srllib.h" #include "dtilib.h" #include "msilib.h" /* Basic error handler */ do_error( devh, funcname ) int devh; char *funcname; { int errorval = ATDV_LASTERR( devh ); printf( "Error while calling function %s.\n", funcname ); printf( "Error value = %d.", errorval ); printf( "\n" ); } main() { int tsdev; /* Station device descriptor variable */ unsigned short bitmask; /* Bitmask variable */ /* Open board 1 device */ if ( ( tsdev = ms_open( "msiB1C1", 0 ) ) == -1 ) { printf( "Cannot open board msiB1C1. errno = %d", errno ); exit( 1 ); } /* Get signaling event mask*/ if ( ms_getevtmsk( tsdev, MSEV_SIGMSK, &bitmask ) == -1 ) { do_error( tsdev, "ms_getevtmsk( )"); } if ( bitmask & MS_ONHOOK) { /* continue processing (ON-HOOK event is set) */ printf("ON-HOOK event is set\n"); } if ( bitmask & MS_OFFHOOK) { /* continue processing (OFF-HOOK event is set) */ printf("OFF-HOOK event is set\n"); } if ( bitmask & MS_HOOKFLASH) { /* continue processing (HOOK FLASH event is set) */ printf("HOOK FLASH event is set\n"); } /* * . * Continue processing * . */ /* Done processing - close device */ if ( ms_close( tsdev ) == -1 ) { printf( "Cannot close board msiB1C1. errno = %d", errno ); } }See Also
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation