ipm_Stop( )
Termination Events | Cautions | Errors | Example | See Also
Name: int ipm_Stop(nDeviceHandle, eOperation, usMode) Inputs:
Returns: 0 on success -1 on failure Includes: srllib.h ipmlib.h Category: Mode: Platform: Description
The ipm_Stop( ) function stops operations on the specified IP channel.
To run this function asynchronously, set mode to EV_ASYNC. The function returns 0 if successful and the application must wait for the IPMEV_STOPPED event.
nDeviceHandle handle of the IP Media device eOperation media operation enumeration. Only one value can be set at a time. The eIPM_STOP_OPERATION data type is an enumeration that defines the following values:
- STOP_SEND_DIGITS
- STOP_RECEIVE_DIGITS
- STOP_RECEIVE_DIGITS_RFC2833
- STOP_MEDIA
- operation of media session.This enumeration disconnects the session. The application must call ipm_StartMedia( ) to start a new session.
- STOP_ALL
usMode operation mode. Set to EV_ASYNC for asynchronous execution or to EV_SYNC for synchronous execution. Termination Events
- IPMEV_STOPPED
- indicates that activity of the type specified in eIPM_STOP_OPERATION has terminated on this channel. This event does not return 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_FWERROR
- Firmware 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 . . */ /* Application needs to stop a current session on IP device handle, nDeviceHandle ASSUMPTION: A valid nDeviceHandle was obtained from prior call to ipm_Open() and a session has been started by calling ipm_StartMedia() sometime earlier. */ if(ipm_Stop(nDeviceHandle, STOP_ALL, EV_ASYNC) == -1) { printf("ipm_Stop 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) { /* . . List of expected events . */ /* Expected reply from ipm_Stop() */ case IPMEV_STOPPED: printf("Received IPMEV_STOPPED 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