ioctl(ixj, PHONE_EXCEPTION)
Return Value
Returns an integer with the low 14 bits holding the exception type.
Parameters
None.
Remarks
When an exception occurs this routine will return a bitflag encoded value carrying the exception that occurred.
Bit 0 | DTMF is available |
Bit 1 | Hook State Change. |
Bit 2 | Flash hook detected on the POTS port. |
Bit 3 | PSTN line is ringing. |
Bit 4 | Caller ID data is available. |
Bit 5 | PSTN Wink detected (other end hung up). |
Bit 6 | Filter 0 has changed state. |
Bit 7 | Filter 1 has changed state. |
Bit 8 | Filter 2 has changed state. |
Bit 9 | Filter 3 has changed state. |
Bit 10 | Filter Cadence 0 was detected. |
Bit 11 | Filter Cadence 1 was detected. |
Bit 12 | Filter Cadence 2 was detected. |
Bit 13 | Filter Cadence 3 was detected. |
The value for Bit 1 represents a hook state change. It is set both at the time the phone goes off hook, and when it goes back on hook. It is an indication that the application should call IXJCTL_HOOKSTATE because the hook state has changed. Calling IXJCTL_HOOKSTATE clears this exception. IXJCTL_EXCEPTION should be called when select() has set the exception set on the file descriptor.
See Also:
Example:
#include telephony.h union telephony_exception ixje; ixje.bytes = ioctl(ixj, PHONE_EXCEPTION); if(ixje.bits.dtmf_ready) { // Deal with DTMF printf("DTMF from card 0 = %c\n",ioctl(ixj, PHONE_GET_DTMF_ASCII)); } if(ixje.bits.hookstate) { if(ioctl(ixj, PHONE_HOOKSTATE)) printf("Off Hook\n"); else printf("On Hook\n"); } fflush(stdout);
©1996-2001 Quicknet Technologies, Inc.