]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
we probably wanna skip the first one if it's over max_rate too :-P
authorRaymond Chandler <intralanman@gmail.com>
Fri, 14 Oct 2011 03:05:59 +0000 (23:05 -0400)
committerRaymond Chandler <intralanman@gmail.com>
Fri, 14 Oct 2011 03:05:59 +0000 (23:05 -0400)
src/mod/applications/mod_lcr/mod_lcr.c

index f3e18cc17517ba2e0fd7be2e6e48197b413ef1ec..41c9d0f85bb87860246d5efd7f6bfdc5e9d949e8 100644 (file)
@@ -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;