Maxim Integrated 73M1822/73M1922 Modem API User Manual
Page 34

73M1822/73M1922 Modem API User Guide
UG_1x22_055
34
Rev. 1.0
M1X22_RET M1X22_MdmApiRelease (void);
Return (0);
}
/*
*****************************************************************************
***********************
* FUNCTION NAME:
* fxoEventCallback
*
* DESCRIPTION:
* This is the event callback function. It is invoked by the API
* subsystem when an event occurs. Currently, this callback function
* only handles the RING start event. It takes the line off-hook when
* the ring burst is detected.
*
* PARAMETERS:
* event_id - Event ID
* channelId - channel where event is occurring
* data1 - Additional data (1)
* data2 - Additional data (2)
* data3 - Additional data (3)
* data4 - Additional data (4)
*
* RETURNS:
* N/A
*****************************************************************************
***********************
*/
void fxoEventCallback (M1X22_EVENT_ID event_id,
unsigned int channelId,
unsigned int data1,
unsigned int data2,
unsigned int data3,
unsigned int data4)
{
int ret;
M1X22_HANDLE pHandle;
pHandle = channels[channelId].pHandle;
switch (event_id)
{
case M1X22_EVENT_RING_START:
printf("\nRING(%d)",channelId);
printf("\n Frequency: %d(hz)",data1);
printf("...auto answer...\n");
ret = M1X22_HookSwitch (pHandle, M1X22_OFF_HOOK);
if (ret == M1X22_FAILED)
break;
else
printf("\nSuccessful");
break;
case M1X22_EVENT_RING_END:
printf("\nRING_END(%d)\n\r",channelId);