ipm_UnListen( )
Termination Events | Cautions | Errors | Example | See Also
Name: int ipm_UnListen(nDeviceHandle, usMode) Inputs:
Returns: 0 on success -1 on failure Includes: srllib.h ipmlib.h Category: Mode: Platform: Description
The ipm_UnListen( ) function stops listening to the TDM time slot specified in a previous call to ipm_Listen( ). When ipm_Stop( ) is called to stop a media session on DM3 hardware, ipm_UnListen( ) is called automatically.
If ipm_Listen( ) is called to connect to a different TDM time slot, the firmware automatically breaks an existing connection and reconnects it to the new time slot. In this case, the application does not need to call the ipm_UnListen( ) function.
nDeviceHandle handle of the IP Media device usMode operation mode. Set to EV_ASYNC for asynchronous execution or to EV_SYNC for synchronous execution. Termination Events
- IPMEV_UNLISTEN
- indicates successful completion, that is, the IP channel was disconnected from the specified TDM time slot. This event does not return data.
- IPMEV_ERROR
- indicates the function failed.
Cautions
The IP Media library allows ipm_Listen( ) and ipm_UnListen( ) to be called either synchronously or asynchronously. Other Intel libraries may not support asynchronous execution of the similar xx_Listen and xx_UnListen functions.
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_FWERROR
- Firmware error
- EIPM_INTERNAL
- Internal error
- EIPM_INV_STATE
- Invalid state. Initial command did not complete before another function call was made.
- EIPM_SYSTEM
- System error
Example
#include <stdio.h> #include <srllib.h> #include <ipmlib.h> typedef long int(*HDLR)(unsigned long); void CheckEvent(); void main() { int nDeviceHandle; // Register event handler function with srl sr_enbhdlr( EV_ANYDEV ,EV_ANYEVT ,(HDLR)CheckEvent); /* . . Main Processing . . . */ /* Stop an IP device handle, nDeviceHandle, from listening to a time slot. ASSUMPTION: A valid nDeviceHandle was obtained from prior call to ipm_Open(). */ if(ipm_UnListen(nDeviceHandle, EV_ASYNC) == -1) { printf("ipm_UnListen failed for device name = %s with error = %d\n", ATDV_NAMEP(nDeviceHandle), ATDV_LASTERR(nDeviceHandle)); /* . . Perform Error Processing . . */ } /* . . Continue processing . */ } void CheckEvent() { int nEventType = sr_getevttype(); int nDeviceID = sr_getevtdev(); switch(nEventType) { /* . . . Other events . . */ /*Expected reply from ipm_UnListen*/ case IPMEV_UNLISTEN: printf("Received IPMEV_UNLISTEN 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