![]() |
Classes | |
struct | VPB_EVENT |
Container for VPB event data. More... | |
Typedefs | |
typedef void(WINAPI * | vpb_event_callback )(VPB_EVENT *e, void *context) |
The callback function type for vpb_set_event_callback() . | |
Enumerations | |
enum | VPB_EVT_TYPE { VPB_EVT_NONE = -1, VPB_RING = 0, VPB_DIGIT = 1, VPB_TONEDETECT = 2, VPB_TIMEREXP = 3, VPB_VOXON = 4, VPB_VOXOFF = 5, VPB_DTMF = 8, VPB_STATION_OFFHOOK = 9, VPB_STATION_ONHOOK = 10, VPB_RING_OFF = 11, VPB_DROP = 12, VPB_STATION_FLASH = 13, VPB_LOOP_OFFHOOK = 14, VPB_LOOP_ONHOOK = 15, VPB_LOOP_POLARITY = 16, VPB_DTMF_DOWN = 17, VPB_PLAYEND = 100, VPB_RECORDEND = 101, VPB_DIALEND = 102, VPB_TONE_DEBUG_END = 103, VPB_CALLEND = 104, VPB_ISDN_ANS = 110, VPB_ISDN_BUSY = 111, VPB_ISDN_CINFO = 112, VPB_ISDN_CALL_FAIL = 113, VPB_ISDN_ANS_FAIL = 114, VPB_ISDN_PROCEEDING = 115, VPB_ISDN_RINGING = 116, VPB_USER_EVT = 255 } |
VPB_EVENT type values More... | |
Functions | |
int WINAPI | vpb_enable_event (int handle, unsigned long mask) |
int WINAPI | vpb_disable_event (int handle, unsigned long mask) |
unsigned long WINAPI | vpb_get_event_mask (int handle) |
Return the current event mask for handle. | |
int WINAPI | vpb_set_event_mask (int handle, unsigned long mask) |
Set the event mask for handle. | |
int WINAPI | vpb_get_event_async (VPB_EVENT *event) |
Fetch the next event from the global event queue. | |
int WINAPI | vpb_get_event_ch_async (int handle, VPB_EVENT *event) |
Fetch the next event from a port specific event queue. | |
int WINAPI | vpb_get_event_sync (VPB_EVENT *event, unsigned int time_out=0) |
Wait for an event on the global event queue. | |
int WINAPI | vpb_get_event_ch_sync (int handle, VPB_EVENT *event, unsigned int time_out=0) |
Wait for an event on a port specific event queue. | |
int WINAPI | vpb_put_event (VPB_EVENT *event) |
Places an event on the global and port specific event queues. | |
void WINAPI | vpb_translate_event (VPB_EVENT *event, char *str) |
Converts a given event into a string describing it. | |
int WINAPI | vpb_set_event_callback (int handle, vpb_event_callback callback, void *context=NULL) |
Sets an event callback function to use instead of the APIQ . | |
int WINAPI | vpb_get_event_count (void) |
Returns the number of events on the global event queue. | |
int WINAPI | vpb_get_event_count_ch (int handle) |
Returns the number of events on the port specific event queue for handle. | |
Event mask values | |
#define | VPB_MRING (1<<VPB_RING) |
#define | VPB_MDIGIT (1<<VPB_DIGIT) |
#define | VPB_MDTMF (1<<VPB_DTMF) |
#define | VPB_MTONEDETECT (1<<VPB_TONEDETECT) |
#define | VPB_MTIMEREXP (1<<VPB_TIMEREXP) |
#define | VPB_MVOXON (1<<VPB_VOXON) |
#define | VPB_MVOXOFF (1<<VPB_VOXOFF) |
#define | VPB_MSTATION_OFFHOOK (1<<VPB_STATION_OFFHOOK) |
#define | VPB_MSTATION_ONHOOK (1<<VPB_STATION_ONHOOK) |
#define | VPB_MRING_OFF (1<<VPB_RING_OFF) |
#define | VPB_MDROP (1<<VPB_DROP) |
#define | VPB_MSTATION_FLASH (1<<VPB_STATION_FLASH) |
#define | VPB_MLOOP_OFFHOOK (1<<VPB_LOOP_OFFHOOK) |
#define | VPB_MLOOP_ONHOOK (1<<VPB_LOOP_ONHOOK) |
#define | VPB_MLOOP_POLARITY (1<<VPB_LOOP_POLARITY) |
#define | VPB_MDTMF_DOWN (1<<VPB_DTMF_DOWN) |
#define | VPB_MALL_EVENTS ((unsigned long)-1) |
vpb_play_file_async()
is called, a solicited event of the type VPB_PLAYEND
is generated when the file has finished playing.DTMF
tone has been detected by the card. enum VPB_EVT_TYPE |
VPB_EVENT
type values
VPB_EVT_NONE |
Invalid event value. Used where no event is returned from api functions that take a VPB_EVENT return parameter. |
VPB_USER_EVT |
User defined event message. Different types of user events may be differentiated using the VPB_EVENT::data or VPB_EVENT::extra fields as appropriate. |
int WINAPI vpb_get_event_async | ( | VPB_EVENT * | event | ) |
Fetch the next event from the global event queue.
This function will always return immediately whether there is an event on the queue or not.
event | The returned event from the queue, if any. |
VPB_OK
if an event is returned, or VPB_NO_EVENTS
if the queue is currently empty.References HostFifo::Read(), and VPB_EVT_NONE.
int WINAPI vpb_get_event_ch_async | ( | int | handle, | |
VPB_EVENT * | event | |||
) |
Fetch the next event from a port specific event queue.
This function will always return immediately whether there is an event on the queue or not.
handle | The handle to the port of interest. | |
event | The returned event from the queue. |
VPB_OK
if an event is returned, or VPB_NO_EVENTS
if the queue is currently empty.References HostFifo::Read(), and VPB_EVT_NONE.
int WINAPI vpb_get_event_ch_sync | ( | int | handle, | |
VPB_EVENT * | event, | |||
unsigned int | time_out = 0 | |||
) |
Wait for an event on a port specific event queue.
This function will return immediately if there is already an event on the queue, else it will block until one arrives or the time out expires.
handle | The handle to the port of interest. | |
event | The returned event from the queue. | |
time_out | An optional maximum time to wait, in milliseconds. If the time_out is set to 0 this function will block indefinitely until an event arrives. |
VPB_OK
if an event occurred, or VPB_TIME_OUT
if time_out elapsed with no event to return.References HostFifo::Read(), sleepms, and VPB_EVT_NONE.
Referenced by vpb_send_cid_t2_sync().
int WINAPI vpb_get_event_sync | ( | VPB_EVENT * | event, | |
unsigned int | time_out = 0 | |||
) |
Wait for an event on the global event queue.
This function will return immediately if there is already an event on the queue, else it will block until one arrives or the time out expires.
event | The returned event from the queue. | |
time_out | An optional maximum time to wait, in milliseconds. If the time_out is set to 0 this function will block indefinitely until an event arrives. |
VPB_OK
if an event occurred, or VPB_TIME_OUT
if time_out elapsed with no event to return.References HostFifo::Read(), sleepms, and VPB_EVT_NONE.
int WINAPI vpb_set_event_callback | ( | int | handle, | |
vpb_event_callback | callback, | |||
void * | context = NULL | |||
) |
Sets an event callback function to use instead of the APIQ
.
handle | The handle returned by a call to vpb_open() . | |
callback | A pointer to the function to call, or NULL to disable the use of a callback for this port again. | |
context | An optional pointer to user defined data that will be passed to the callback function. |
Any event which is processed after this function returns will be subject to the new callback state, however since events are buffered at the kernel driver level, this may also include some events that occurred before the call was made, but which had not been processed at that time.
References VPB_DEV::callback_mutex, VPB_DEV::context, and VPB_DEV::event_callback.
void WINAPI vpb_translate_event | ( | VPB_EVENT * | event, | |
char * | str | |||
) |
Converts a given event into a string describing it.
event | The event to process. | |
str | The returned string. |
Referenced by vpb_send_cid_t2_sync().