ipm_SendDigits( )
Termination Events | Cautions | Errors | Example | See Also
Name: int ipm_SendDigits(nDeviceHandle, *pDigitInfo, usMode) Inputs:
Returns: 0 on success -1 on failure Includes: srllib.h ipmlib.h Category: Mode: Platform: Description
The ipm_SendDigits( ) function generates the supplied digits in the specified direction.
- Note: This function is not supported on Intel® NetStructure Host Media Processing (HMP) software.
nDeviceHandle handle of the IP Media device pDigitInfo pointer to structure that contains digit type, direction, and digits; see IPM_DIGIT_INFO for details. Note that the application must fill in the digit type, direction, number of digits, and the actual digits to be sent. usMode operation mode. Set to EV_ASYNC for asynchronous execution or to EV_SYNC for synchronous execution. Termination Events
- IPMEV_SEND_DIGITS
- indicates successful completion, that is, the supplied digits were sent. This event does not return data.
- IPMEV_ERROR
- indicates the function failed.
Cautions
- If this function is called synchronously and returns 0, it does not indicate that the digits have been sent, but that the function was successfully processed by the firmware. The application must enable event reporting and check for the IPMEV_SEND_DIGITS event.
- The only supported value for eIPM_DIGIT_DIRECTION is to send digits toward the TDM bus.
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_MODE
- Invalid mode
- 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 <string.h> #include <srllib.h> #include <ipmlib.h> typedef long int(*HDLR)(unsigned long); void CheckEvent(); void main() { int nDeviceHandle; IPM_DIGIT_INFO myDigitInfo; // Register event handler function with srl sr_enbhdlr( EV_ANYDEV ,EV_ANYEVT ,(HDLR)CheckEvent); /* . . Main Processing . . . */ /* Generate a set of digits using IP device handle, nDeviceHandle. ASSUMPTION: A valid nDeviceHandle was obtained from prior call to ipm_Open(). */ myDigitInfo.eDigitType = DIGIT_ALPHA_NUMERIC; myDigitInfo.eDigitDirection = DIGIT_TDM; strcpy(myDigitInfo.cDigits,"12345678901234567890"); myDigitInfo.unNumberOfDigits = 20; if(ipm_SendDigits(nDeviceHandle, &myDigitInfo, EV_ASYNC) == -1) { printf("ipm_SendDigits failed for device name = %s with error = %d\n", ATDV_NAMEP(nDeviceHandle), ATDV_LASTERR(nDeviceHandle)); /* . . Perform Error Processing . . */ } /* . . . . Continue Main processing . . */ } void CheckEvent() { int nDeviceID = sr_getevtdev(); int nEventType = sr_getevttype(); void* pVoid = sr_getevtdatap(); switch(nEventType) { /* . . . Other events . . */ //Successful reply to ipm_SendDigits() case IPMEV_SEND_DIGITS: printf("Received IPMEV_SEND_DIGITS 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