]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5676 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 23 Jan 2014 19:36:52 +0000 (00:36 +0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 23 Jan 2014 19:37:06 +0000 (00:37 +0500)
src/mod/applications/mod_fifo/mod_fifo.c

index f09236539acd4b2c54e44a5df514173a2be094d9..076bd67a998dbb86822a3f6c4e71f333b6a2836d 100644 (file)
@@ -313,6 +313,7 @@ struct fifo_node {
        int ring_timeout;
        int default_lag;
        char *domain_name;
+       int retry_delay;
        struct fifo_node *next;
 };
 
@@ -1576,7 +1577,7 @@ static void *SWITCH_THREAD_FUNC ringall_thread_run(switch_thread_t *thread, void
                                                                                           "outbound_fail_count=outbound_fail_count+1, "
                                                                                           "outbound_fail_total_count = outbound_fail_total_count+1, "
                                                                                           "next_avail=%ld + lag + 1 where uuid='%q' and ring_count > 0",
-                                                                                          (long) switch_epoch_time_now(NULL), h->uuid);
+                                                                                          (long) switch_epoch_time_now(NULL) + node->retry_delay, h->uuid);
                                        fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_TRUE);
 
                                }
@@ -1755,7 +1756,7 @@ static void *SWITCH_THREAD_FUNC o_thread_run(switch_thread_t *thread, void *obj)
 
                sql = switch_mprintf("update fifo_outbound set ring_count=ring_count-1, "
                                                         "outbound_fail_count=outbound_fail_count+1, next_avail=%ld + lag + 1 where uuid='%q'",
-                                                        (long) switch_epoch_time_now(NULL), h->uuid);
+                                                        (long) switch_epoch_time_now(NULL) + node->retry_delay, h->uuid);
                fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_TRUE);
 
                if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, FIFO_EVENT) == SWITCH_STATUS_SUCCESS) {
@@ -4437,6 +4438,16 @@ static switch_status_t load_config(int reload, int del_all)
                                node->has_outbound = 1;
                        }
 
+                       if ((val = switch_xml_attr(fifo, "retry_delay"))) {
+                               int tmp;
+
+                               if ((tmp = atoi(val)) < 0) {
+                                       tmp = 0;
+                               }
+
+                               node->retry_delay = tmp;
+                       }
+
                        if ((val = switch_xml_attr(fifo, "outbound_priority"))) {
                                outbound_priority = atoi(val);