This commit is contained in:
Anthony Minessale 2011-01-21 14:27:51 -06:00
parent e086b80632
commit 1cf79386c8

View File

@ -151,13 +151,21 @@ static void check_ip(void)
SWITCH_STANDARD_SCHED_FUNC(heartbeat_callback)
{
send_heartbeat();
check_ip();
/* reschedule this task */
task->runtime = switch_epoch_time_now(NULL) + 20;
}
SWITCH_STANDARD_SCHED_FUNC(check_ip_callback)
{
check_ip();
/* reschedule this task */
task->runtime = switch_epoch_time_now(NULL) + 60;
}
SWITCH_DECLARE(switch_status_t) switch_core_set_console(const char *console)
{
if ((runtime.console = fopen(console, "a")) == 0) {
@ -1357,6 +1365,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc
switch_scheduler_add_task(switch_epoch_time_now(NULL), heartbeat_callback, "heartbeat", "core", 0, NULL, SSHF_NONE | SSHF_NO_DEL);
switch_scheduler_add_task(switch_epoch_time_now(NULL), check_ip_callback, "check_ip", "core", 0, NULL, SSHF_NONE | SSHF_NO_DEL | SSHF_OWN_THREAD);
switch_uuid_get(&uuid);
switch_uuid_format(runtime.uuid_str, &uuid);