From: Raymond Chandler Date: Fri, 14 Oct 2011 03:05:59 +0000 (-0400) Subject: we probably wanna skip the first one if it's over max_rate too :-P X-Git-Tag: v1.2-rc1~27^2~346 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=73da063cc929d63a4a9ae2932bac788dd4cdc021;p=thirdparty%2Ffreeswitch.git we probably wanna skip the first one if it's over max_rate too :-P --- 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;