ipm_SendRFC2833SignalIDToIP( )
Termination Events | Cautions | Errors | Example | See Also
Name: int ipm_SendRFC2833SignalIDToIP(nDeviceHandle, * pSignalInfo, usMode) Inputs:
Returns: 0 on success -1 on failure Includes: srllib.h ipmlib.h Category: Mode: Platform: Description
The ipm_SendRFC2833SignalIDToIP( ) function sends the supplied RFC 2833 signal to IP.
- Note: This function is not supported on Intel® NetStructure IPT Series boards.
nDeviceHandle handle of the IP Media device pSignalInfo pointer to structure that contains RFC 2833 signal ID and state information; see IPM_RFC2833_SIGNALID_INFO for details. Note that the application must fill in the RFC 2833 signal to be sent. usMode operation mode. Set to EV_ASYNC for asynchronous execution or to EV_SYNC for synchronous execution. Termination Events
- IPMEV_SEND_SIGNAL_TO_IP
- indicates successful completion, that is, the supplied RFC 2833 signal was sent. 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_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_RFC2833_SIGNALID_INFO SignalInfo; // Register event handler function with srl sr_enbhdlr( EV_ANYDEV ,EV_ANYEVT ,(HDLR)CheckEvent); /* . . Main Processing . . . */ /* Generate the start of an RFC2833 ringback packet to IP. ASSUMPTION: A valid nDeviceHandle was obtained from prior call to ipm_Open(). */ SignalInfo.eSignalID = SIGNAL_ID_EVENT_LINE_RINGING_TONE; SignalInfo.eState = SIGNAL_STATE_ON; if(ipm_SendRFC2833SignalIDToIP(nDeviceHandle, &SignalInfo, EV_ASYNC) == -1) { printf("ipm_SendRFC2833SignalIDToIP failed for device name = %s with error = %d\n", ATDV_NAMEP(nDeviceHandle), ATDV_LASTERR(nDeviceHandle)); /* . . Perform Error Processing . . */ } /* . . . . Continue Main processing . . */ /* Generate the end of an RFC2833 ringback packet to IP. ASSUMPTION: A valid nDeviceHandle was obtained from prior call to ipm_Open(). */ SignalInfo.eSignalID = SIGNAL_ID_EVENT_LINE_RINGING_TONE; SignalInfo.eState = SIGNAL_STATE_OFF; if(ipm_SendRFC2833SignalIDToIP(nDeviceHandle, &SignalInfo, EV_ASYNC) == -1) { printf("ipm_SendRFC2833SignalIDToIP failed for device name = %s with error = %d\n", ATDV_NAMEP(nDeviceHandle), ATDV_LASTERR(nDeviceHandle)); /* . . Perform Error 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_SIGNAL_TO_IP: printf("Received IPMEV_SEND_SIGNAL_TO_IP 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