]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-2917
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 21 Jan 2011 20:27:51 +0000 (14:27 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 21 Jan 2011 20:51:38 +0000 (14:51 -0600)
src/switch_core.c

index b531111a6d6e5582a2c915bb453e4a2351d821ae..43fb36d70572d3e38e1687fdf0b7be8bead27fc9 100644 (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);