ipm_DisableEvents( )
Termination Events | Cautions | Errors | Example | See Also
Name: int ipm_DisableEvents(nDeviceHandle, *pEvents, unNumOfEvents, usMode) Inputs:
Returns: Includes: Category: Mode: Platform: Description
The ipm_DisableEvents( ) function disables IP notification events. Some events are used for Quality of Service (QoS) notifications. Other events are used to indicate status, for example, if fax tone has been detected.
Notification events are different from asynchronous function termination events, such as IPMEV_OPEN, which cannot be disabled. Once events are successfully disabled, if any events occur, the application is not notified.
Termination Events
- IPMEV_EVENT_DISABLED
- indicates successful completion, that is, specified events were disabled. This event does not return any data.
- IPMEV_ERROR
- indicates the function failed.
Cautions
Errors
If the function returns -1 to indicate failure, call ATDV_LASTERR( ) and ATDV_ERRMSGP( ) to return one of the following errors:
- EIPM_BADPARM
- Invalid parameter
- EIPM_INTERNAL
- Internal error
- EIPM_INV_EVT
- Invalid event
- EIPM_INV_STATE
- Invalid state. Initial command did not complete before another function call was made.
- EIPM_SYSTEM
- System error
- EIPM_UNSUPPORTED
- Function unsupported
Example
#include <stdio.h> #include <srllib.h> #include <ipmlib.h> typedef long int(*HDLR)(unsigned long); void CheckEvent(); void main() { int nDeviceHandle; eIPM_EVENT myEvents[3] ={EVT_DTMFDISCARDED, EVT_LOSTPACKETS, EVT_JITTER}; // Register event handler function with srl sr_enbhdlr( EV_ANYDEV ,EV_ANYEVT ,(HDLR)CheckEvent); /* . . Main Processing . . . */ /* Application is shutting down Need to disable all enabled events for IP device handle, nDeviceHandle. ASSUMPTION: A valid nDeviceHandle was obtained from prior call to ipm_Open() and The events listed in myEvents were enabled sometime earlier. */ if(ipm_DisableEvents(nDeviceHandle, myEvents, 3, EV_ASYNC) == -1) { printf("ipm_DisableEvents failed for device name = %s with error = %d\n", ATDV_NAMEP(nDeviceHandle), ATDV_LASTERR(nDeviceHandle)); /* . . Perform Error Processing . . */ } /* . Continue shut down . */ } void CheckEvent() { int nEventType = sr_getevttype(); int nDeviceID = sr_getevtdev(); switch(nEventType) { /* . . Other events . */ /* Expected reply to ipm_DisableEvents */ case IPMEV_EVENT_DISABLED: printf("Received IPMEV_EVENT_DISABLED for device = %s\n", ATDV_NAMEP(nDeviceID)); break; default: printf("Received unknown event = %d for device = %s\n", nEventType, ATDV_NAMEP(nDeviceID)); break; } }See Also
Click here to contact Telecom Support Resources
Copyright 2002, Intel Corporation