From 73da063cc929d63a4a9ae2932bac788dd4cdc021 Mon Sep 17 00:00:00 2001 From: Raymond Chandler Date: Thu, 13 Oct 2011 23:05:59 -0400 Subject: [PATCH] we probably wanna skip the first one if it's over max_rate too :-P --- src/mod/applications/mod_lcr/mod_lcr.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mod/applications/mod_lcr/mod_lcr.c b/src/mod/applications/mod_lcr/mod_lcr.c index f3e18cc175..41c9d0f85b 100644 --- a/src/mod/applications/mod_lcr/mod_lcr.c +++ b/src/mod/applications/mod_lcr/mod_lcr.c @@ -662,6 +662,13 @@ static int route_add_callback(void *pArg, int argc, char **argv, char **columnNa additional->dialstring = get_bridge_data(pool, cbt->lookup_number, cbt->cid, additional, cbt->profile, cbt->session); if (cbt->head == NULL) { + if (cbt->max_rate && (cbt->max_rate < additional->rate)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Skipping [%s] because [%f] is higher than the max_rate of [%f]\n", + additional->carrier_name, additional->rate, cbt->max_rate); + lcr_skipped = SWITCH_FALSE; + r = 0; goto end; + } + key = switch_core_sprintf(pool, "%s:%s", additional->gw_prefix, additional->gw_suffix); additional->next = cbt->head; cbt->head = additional;