mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-06 10:26:41 +00:00
freetdm: handle timer id wrap-around
This commit is contained in:
parent
b3f9bfcba5
commit
baead3ddf0
@ -325,6 +325,13 @@ FT_DECLARE(ftdm_status_t) ftdm_sched_timer(ftdm_sched_t *sched, const char *name
|
|||||||
}
|
}
|
||||||
newtimer->id = sched->currid;
|
newtimer->id = sched->currid;
|
||||||
sched->currid++;
|
sched->currid++;
|
||||||
|
if (!sched->currid) {
|
||||||
|
ftdm_log(FTDM_LOG_NOTICE, "Timer id wrap around for sched %s\n", sched->name);
|
||||||
|
/* we do not want currid to be zero since is an invalid id
|
||||||
|
* TODO: check that currid does not exists already in the context, it'd be insane
|
||||||
|
* though, having a timer to live all that time */
|
||||||
|
sched->currid++;
|
||||||
|
}
|
||||||
|
|
||||||
ftdm_set_string(newtimer->name, name);
|
ftdm_set_string(newtimer->name, name);
|
||||||
newtimer->callback = callback;
|
newtimer->callback = callback;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user