Timers

The VPBAPI includes support for programmable timers that operate through the API event queue. The timers are useful for integrating timer functions into state machine based computer telephony applications.

The following functions support the API timers:

vpb_timer_open()
vpb_timer_close()
vpb_timer_start()
vpb_timer_stop()
vpb_timer_restart()
vpb_timer_get_unique_timer_id()
vpb_timer_change_period()

Timers have two states, running, and stopped. When a timer is first created with vpb_timer_open(), the timer is in the stopped state. The timer can be placed in the running state using vpb_timer_start() or vpb_timer_restart().

When the timer period expires, it posts a VPB_TIMER event and resets itself to the stopped state. The timer can then be restarted using vpb_timer_start() or vpb_timer_restart() and the cycle repeated. The timer can be restarted before its period has expired using vpb_timer_restart(). Timer events are classed as solicited events, they will always be posted to the event queue and cannot be masked out.