ftmod_libpri: Reset timer parameters in lpwrap_run_expired() before invoking the callback.
Allowing us to restart the timer from the callback with lpwrap_start_timer(). Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
This commit is contained in:
parent
de0f311f2d
commit
1a47eb933b
|
@ -275,15 +275,17 @@ static int lpwrap_run_expired(struct lpwrap_pri *spri, ftdm_time_t now_ms)
|
||||||
|
|
||||||
/* fire callbacks */
|
/* fire callbacks */
|
||||||
while ((cur = expired_list)) {
|
while ((cur = expired_list)) {
|
||||||
|
timeout_handler handler = cur->callback;
|
||||||
expired_list = cur->next;
|
expired_list = cur->next;
|
||||||
if (cur->callback)
|
|
||||||
cur->callback(spri, cur);
|
/* Stop timer */
|
||||||
/* stop timer */
|
|
||||||
cur->next = NULL;
|
cur->next = NULL;
|
||||||
cur->timeout = 0;
|
cur->timeout = 0;
|
||||||
cur->callback = NULL;
|
cur->callback = NULL;
|
||||||
}
|
|
||||||
|
|
||||||
|
if (handler)
|
||||||
|
handler(spri, cur);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue