From a44aea11061a4dcb373d677090b87c43d19dea9f Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 24 Jan 2014 00:36:52 +0500 Subject: [PATCH] FS-5676 --resolve --- src/mod/applications/mod_fifo/mod_fifo.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_fifo/mod_fifo.c b/src/mod/applications/mod_fifo/mod_fifo.c index 7225d9713c..039f8776da 100644 --- a/src/mod/applications/mod_fifo/mod_fifo.c +++ b/src/mod/applications/mod_fifo/mod_fifo.c @@ -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);