How to do a periodic check?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 31, 2008 at 10:01 AM, Markus Vechiorno <finalpfc at hotmail.com> wrote:
>  Hi,
>
>  I want to make a check of some parameters every x seconds (periodically).
> Is there a way to call to a function periodically?
>  I can use the functions implemented in "dq" in pjsua because what I need is
> to check the packet loss rate.
>
>  I saw smth about pjmedia clock, but I need to know how to control it.
>
>  For example, if I want to call pjsua_call_dump ecery 2 seconds what could
> be the way?

You can use pjsip_endpt_schedule_timer() to schedule a timer. The
pjmedia clock probably is too heavy for this since it creates a worker
thread with real-time priority to wait for the timer (although you can
disable the priority boost). But you can use that, just set
samples_per_frame to N*clock_rate if you want the callback to be
called once every N seconds.

Cheers
 Benny



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux