PREV TOC HOME INDEX NEXT


ms_getevtmsk( )


Cautions | Errors | Example | See Also

Name: int ms_getevtmsk (devh, event, bitmaskp)
Inputs:

int devh

  • MSI station device handle

int event

  • event to retrieve

unsigned short *bitmaskp

  • pointer to bitmask variable
Returns:

0 on success

-1 on failure

Includes:

srllib.h

dtilib.h

msilib.h

Category:

Configuration

Mode:

synchronous

Platform:

DI, HDSI, Springware

Description

The ms_getevtmsk( ) function returns a station event mask for a specified event.

Parameter

Description

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.

Table 3. MSI Events and Event Types 

Event Type

Event

Description

MSEV_SIGEVT

MSMM_ONHOOK

Line device has gone on-hook.

MSMM_OFFHOOK

Line device has gone off-hook.

MSMM_HOOKFLASH

Line device detected hookflash.

MSEV_RING

MSMM_RNGOFFHK

Solicited off-hook was detected.

MSMM_RNGSTOP

Ringing was stopped by ms_stopfn( ).

MSMM_TERM

Ringing was terminated.

E_MSBADRNGSTA

Station was off-hook when the ring was attempted.

MSEV_NORING

MSMM_RNGOFFHK

Solicited off-hook was detected.

MSMM_RNGSTOP

Ringing was stopped by ms_stopfn( ).

MSMM_TERM

Ringing was terminated.

E_MSBADRNGSTA

Station was off-hook when the ring was attempted.

Cautions

This function fails when:

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


PREV TOC HOME INDEX NEXT

Click here to contact Telecom Support Resources

Copyright 2003, Intel Corporation
All rights reserved
This page generated January, 2003