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:
Stefan Knoblich 2012-09-05 00:13:18 +02:00
parent de0f311f2d
commit 1a47eb933b
1 changed files with 6 additions and 4 deletions

View File

@ -275,15 +275,17 @@ static int lpwrap_run_expired(struct lpwrap_pri *spri, ftdm_time_t now_ms)
/* fire callbacks */
while ((cur = expired_list)) {
timeout_handler handler = cur->callback;
expired_list = cur->next;
if (cur->callback)
cur->callback(spri, cur);
/* stop timer */
/* Stop timer */
cur->next = NULL;
cur->timeout = 0;
cur->callback = NULL;
}
if (handler)
handler(spri, cur);
}
return 0;
}