Date: Fri, 13 Dec 2013 15:58:54 -0500
From: intralanman@freeswitch.org
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] Mod LCR SQL sub-query for better routing
On 12/12/2013 02:42 PM, Victor
Chukalovskiy wrote:
Hello,
For those interested, I added a piece to mod lcr wiki. It makes sorting
/ routing logic better than default logic:
http://wiki.freeswitch.org/wiki/Mod_lcr#Custom_SQL_with_sub-query_-_for_real-life_ratesheet_complexities
Why it helps:
Rates rates can often be given both on per-NPA or per-NPANXX level
depending on the carrier and on the NPA. Moreover, some carriers may
have NPANXX rate lower than the corresponding NPA rate, while others
will have it inverse. Neither simple ORDER BY rate, prefix; nor ORDER BY
prefix, rate; give the truly cheapest route. The LCR logic should be
two-step process to accommodate this.
Cheers,
-Victor
Unless I misunderstand what you're saying, this is what the
reorder_by_rate param does.
You'll always want to pick the longest digit match per carrier.
Then you probably want to grab the cheapest overall rate of the
matches you got back.
-Ray
_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com
Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org