<br><br><div class="gmail_quote">On Sat, Jan 30, 2010 at 10:57 PM, Mouncif Benniane <span dir="ltr">&lt;<a href="mailto:mouncifbb@gmail.com">mouncifbb@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
OK going back to use default profile to keep things simple below 2 results<br><br>Using:<br><br>lcr 16179470890  default  19785223241  ( this one consult npa_nxx_company_ocn)<br><br>lcr 6179470890  default  9785223241 ( this one don&#39;t!! )<br>

<br><br></blockquote><div><br></div><div>Oh, right!  mod_lcr really expects you to normalize your prefix to e164 format.  I thought there was discussion about this in the wiki, but maybe not.  For simple prefix matching it doesn&#39;t matter, but for things that make decisions based on the # (like the lata/state stuff) it does.</div>
<div><br></div><div>npanxx lookup only makes sense for NANPA numbers.  NANPA numbers have a country code of &quot;1&quot; and a total length of 11 (including the 1).   </div><div><br></div><div>This is the only rational way to do it when you have a rate table with both domestic (NANPA) and international prefixes.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>freeswitch&gt; lcr 16179470890  default  19785223241<br>2010-01-30 23:53:34.681842 [DEBUG] mod_lcr.c:1329 data passed to lcr is [16179470890  default  19785223241]<br>
2010-01-30 23:53:34.681842 [DEBUG] mod_lcr.c:1365 Set Caller ID to [19785223241]<br>
2010-01-30 23:53:34.681842 [DEBUG] mod_lcr.c:736 SQL: SELECT &#39;state&#39;, count(DISTINCT state) FROM npa_nxx_company_ocn WHERE (npa=617 AND nxx=947) OR (npa=978 AND nxx=522) UNION SELECT &#39;lata&#39;, count(DISTINCT lata) FROM npa_nxx_company_ocn WHERE (npa=617 AND nxx=947) OR (npa=978 AND nxx=522)<br>

2010-01-30 23:53:34.910842 [DEBUG] mod_lcr.c:696 Type: state, Count: 1<br>2010-01-30 23:53:34.910842 [DEBUG] mod_lcr.c:696 Type: lata, Count: 1<br>2010-01-30 23:53:34.910842 [DEBUG] mod_lcr.c:786 intra routing [state:1 lata:1] so rate field is [intralata_rate]<br>

2010-01-30 23:53:34.910842 [DEBUG] mod_lcr.c:802 we have an event<br>2010-01-30 23:53:34.910842 [DEBUG] mod_lcr.c:826 SQL: SELECT l.digits, c.carrier_name, l.intralata_rate, cg.prefix AS gw_prefix, cg.suffix AS gw_suffix, l.lead_strip, l.trail_strip, l.prefix, l.suffix , cg.codec , l.cid FROM lcr l JOIN carriers c ON l.carrier_id=<a href="http://c.id" target="_blank">c.id</a> JOIN carrier_gateway cg ON <a href="http://c.id" target="_blank">c.id</a>=cg.carrier_id WHERE c.enabled = &#39;1&#39; AND cg.enabled = &#39;1&#39; AND l.enabled = &#39;1&#39; AND digits IN (16179470890, 1617947089, 161794708, 16179470, 1617947, 161794, 16179, 1617, 161, 16, 1) AND CURRENT_TIMESTAMP BETWEEN date_start AND date_end ORDER BY digits DESC,  intralata_rate, rand();<br>

2010-01-30 23:53:34.910842 [DEBUG] mod_lcr.c:307 Returning Dialstring [lcr_carrier=carrier1,lcr_rate=0.00000]sofia/gateway/carrier1/16179470890<br>2010-01-30 23:53:34.910842 [DEBUG] mod_lcr.c:615 Adding carrier1 to head of list<br>

2010-01-30 23:53:34.910842 [DEBUG] mod_lcr.c:307 Returning Dialstring [lcr_carrier=carrier2,lcr_rate=0.00000]sofia/external/<a href="http://06179470890@proxy.carrier2.net:5060" target="_blank">06179470890@proxy.carrier2.net:5060</a><br>
2010-01-30 23:53:34.910842 [DEBUG] mod_lcr.c:667 adding carrier2 to end of list after carrier1<div class="im"><br>
<br> | Digit Match | Carrier  | Rate     | Codec | CID Regexp | Dialstring                                                                                |<br></div> | 1           | carrier1 | 0.00000  |       |            | [lcr_carrier=carrier1,lcr_rate=0.00000]sofia/gateway/carrier1/16179470890                 |<br>

 | 1           | carrier2 | 0.00000  |       |            | [lcr_carrier=carrier2,lcr_rate=0.00000]sofia/external/<a href="http://06179470890@proxy.carrier2.net:5060" target="_blank">06179470890@proxy.carrier2.net:5060</a> |<br>
<br>2010-01-30 23:53:34.910842 [DEBUG] mod_lcr.c:307 Returning Dialstring [lcr_carrier=carrier1,lcr_rate=0.00000]sofia/gateway/carrier1/16179470890<br>
2010-01-30 23:53:34.910842 [DEBUG] mod_lcr.c:307 Returning Dialstring [lcr_carrier=carrier2,lcr_rate=0.00000]sofia/external/<a href="http://06179470890@proxy.carrier2.net:5060" target="_blank">06179470890@proxy.carrier2.net:5060</a><br>
<br>
<br><br><br><br>freeswitch&gt; lcr 6179470890  default  9785223241<br>2010-01-30 23:52:58.782633 [DEBUG] mod_lcr.c:1329 data passed to lcr is [6179470890  default  9785223241]<br>2010-01-30 23:52:58.782633 [DEBUG] mod_lcr.c:1365 Set Caller ID to [9785223241]<br>

2010-01-30 23:52:58.782633 [DEBUG] mod_lcr.c:786 intra routing [state:0 lata:0] so rate field is [rate]<br>2010-01-30 23:52:58.782633 [DEBUG] mod_lcr.c:802 we have an event<br>2010-01-30 23:52:58.782633 [DEBUG] mod_lcr.c:826 SQL: SELECT l.digits, c.carrier_name, l.rate, cg.prefix AS gw_prefix, cg.suffix AS gw_suffix, l.lead_strip, l.trail_strip, l.prefix, l.suffix , cg.codec , l.cid FROM lcr l JOIN carriers c ON l.carrier_id=<a href="http://c.id" target="_blank">c.id</a> JOIN carrier_gateway cg ON <a href="http://c.id" target="_blank">c.id</a>=cg.carrier_id WHERE c.enabled = &#39;1&#39; AND cg.enabled = &#39;1&#39; AND l.enabled = &#39;1&#39; AND digits IN (6179470890, 617947089, 61794708, 6179470, 617947, 61794, 6179, 617, 61, 6) AND CURRENT_TIMESTAMP BETWEEN date_start AND date_end ORDER BY digits DESC,  rate, rand();<br>

2010-01-30 23:52:58.782633 [DEBUG] mod_lcr.c:307 Returning Dialstring [lcr_carrier=carrier1,lcr_rate=0.09000]sofia/gateway/carrier1/16179470890<br>2010-01-30 23:52:58.782633 [DEBUG] mod_lcr.c:615 Adding carrier1 to head of list<br>

2010-01-30 23:52:58.782633 [DEBUG] mod_lcr.c:307 Returning Dialstring [lcr_carrier=carrier1,lcr_rate=0.09000]sofia/gateway/carrier1/16179470890<div class="im"><br><br> | Digit Match | Carrier  | Rate     | Codec | CID Regexp | Dialstring                                                                |<br>
</div>
 | 617947      | carrier1 | 0.09000  |       |            | [lcr_carrier=carrier1,lcr_rate=0.09000]sofia/gateway/carrier1/16179470890 |<div><div></div><div class="h5"><br><br><br><br><br><br><br><br><br><br><br><div class="gmail_quote">
On Sat, Jan 30, 2010 at 7:45 PM, Rupa Schomaker <span dir="ltr">&lt;<a href="mailto:rupa@rupa.com" target="_blank">rupa@rupa.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">turn up logging to debug again, and then reload mod_lcr.  It&#39;ll spit out a bunch of crap when it tests out each profile you have defined.  Give me the full log (here or in <a href="http://pastebin.freeswitch.org" target="_blank">pastebin.freeswitch.org</a>).  That may show more useful info as to why things are mucked up?<div>

<div></div><div><br>
<br><div class="gmail_quote">On Sat, Jan 30, 2010 at 6:23 PM, Mouncif Benniane <span dir="ltr">&lt;<a href="mailto:mouncifbb@gmail.com" target="_blank">mouncifbb@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">


yes I use NANPA_STD profile instead of default cause I thought the custom profile was causing issues, but looks like it&#39;s returning same results.<br><br>There is this line in thw wiki:<br>intra lata/state selection is done manually by setting the channel variables <b>intrastate</b> or <b>intralata</b> to the value <b>true</b>. <br>



<br>do I have to set these ? if yes how?<br><br>Thanks<div><div></div><div><br><br><div class="gmail_quote">On Sat, Jan 30, 2010 at 6:59 PM, Rupa Schomaker <span dir="ltr">&lt;<a href="mailto:rupa@rupa.com" target="_blank">rupa@rupa.com</a>&gt;</span> wrote:<br>



<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">Stuff inline.<br><br><div class="gmail_quote"><div>On Sat, Jan 30, 2010 at 3:38 PM, Mouncif Benniane <span dir="ltr">&lt;<a href="mailto:mouncifbb@gmail.com" target="_blank">mouncifbb@gmail.com</a>&gt;</span> wrote:<br>



<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">

 <table style="border-collapse:collapse;width:192pt" border="0" cellpadding="0" cellspacing="0" width="256"><col style="width:48pt" span="4" width="64">
 <tbody><tr style="min-height:15pt" height="20">
  <td colspan="4" style="min-height:15pt;width:192pt" height="20" width="256">NPANXX,&quot;LATA&quot;,&quot;OCN&quot;,&quot;NTER&quot;,&quot;INTRA&quot;</td>
 </tr>
 <tr style="min-height:15pt" height="20">
  <td colspan="4" style="min-height:15pt" height="20">201007,&quot;224&quot;,&quot;7229&quot;,&quot;0.0059&quot;,&quot;0.0127&quot;</td>
 </tr>
 <tr style="min-height:15pt" height="20">
  <td colspan="4" style="min-height:15pt" height="20">201040,&quot;224&quot;,&quot;9206&quot;,&quot;0.0036&quot;,&quot;0.0036&quot;</td>
 </tr>
</tbody></table><br></blockquote><div><br></div></div><div>Looks like they give you the LATA and OCN values with the prefix.  We (should) look that up ourselves.</div><div><div> </div><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">




FreeSWITCH Version 1.0.trunk (16540)<br><br><br>Also I noticed the <b>npa_nxx_ocn</b> table never get consulted.<br><br>I also see this now when making a real call instead of running thorugh CLI<br><br>
EXECUTE sofia/external/6179472456@174.x.x.x lcr(16179470890 NANPA_STD)<br>2010-01-30 16:28:56.685457 [DEBUG] mod_lcr.c:1230 <b style="color:rgb(255, 0, 0)">intrastate channel var is [undef]</b></blockquote><div><br></div>




</div><div>This is fine.  it is a leftover from when you would tell mod_lcr via a channel var that it should do intrastate.  I later had mod_lcr do the lookup itself, but we still honor the old var.  There are no channel vars associated with the cli, so you wouldn&#39;t see that msg.</div>



<div>
<div> </div><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex"><br>2010-01-30 16:28:56.685457 [DEBUG] mod_lcr.c:1233 Select routes based on interstate rates<br>




2010-01-30 16:28:56.685457 [DEBUG] mod_lcr.c:1252 LCR Lookup on 16179470893 using profile NANPA_STD<br>2010-01-30 16:28:56.685457 [DEBUG] mod_lcr.c:786 intra routing [state:0 lata:0] so rate field is [rate]<br><br>called number 6179470890  caller ID: 6179472456<br>





<br>any ideas??<div><div></div><div><br></div></div></blockquote><div><br></div></div><div>Only thing that jumps out at me. </div><div><br></div><div>The output from lcr_admin show profiles showed only the default one.  On the dialplan you use the NANPA_STD profile.  Can you check lcr_admin list and see if that profile is defined and if so if it says it is using the npanxx table?</div>



<div><div></div><div>
<div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex"><div><div><br><br><br><br><div class="gmail_quote">

On Sat, Jan 30, 2010 at 10:02 AM, Rupa Schomaker <span dir="ltr">&lt;<a href="mailto:rupa@rupa.com" target="_blank">rupa@rupa.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
Something is still missing from the logs. Note the query of the npanxx<br>
table, the flags being set, and the rate field being chosen.  Umm..<br>
oh, what version of fs are you running?<br>
<br>
Yes, the npa_nxx_ocn table needs to be loaded up as described in:<br>
<a href="http://wiki.freeswitch.org/wiki/Mod_cidlookup#Falling_back_to_.22City_State.22_in_the_absense_of_a_name" target="_blank">http://wiki.freeswitch.org/wiki/Mod_cidlookup#Falling_back_to_.22City_State.22_in_the_absense_of_a_name</a><br>






(there is a link to that from mod_lcr&#39;s wiki page).<br>
<br>
An example from my own setup:<br>
<br>
2010-01-30 08:55:10.633951 [DEBUG] mod_lcr.c:1384 data passed to lcr<br>
is [12148267711 default 12148267712]<br>
2010-01-30 08:55:10.633951 [DEBUG] mod_lcr.c:1420 Set Caller ID to [12148267712]<br>
2010-01-30 08:55:10.633951 [DEBUG] mod_lcr.c:759 SQL: SELECT &#39;state&#39;,<br>
count(DISTINCT state) FROM npa_nxx_company_ocn WHERE (npa=214 AND<br>
nxx=826) OR (npa=214 AND nxx=826) UNION SELECT &#39;lata&#39;, count(DISTINCT<br>
lata) FROM npa_nxx_company_ocn WHERE (npa=214 AND nxx=826) OR (npa=214<br>
AND nxx=826)<br>
2010-01-30 08:55:10.633951 [DEBUG] mod_lcr.c:719 Type: lata, Count: 1<br>
2010-01-30 08:55:10.633951 [DEBUG] mod_lcr.c:719 Type: state, Count: 1<br>
2010-01-30 08:55:10.633951 [DEBUG] mod_lcr.c:809 intra routing<br>
[state:1 lata:1] so rate field is [intralata_rate]<br>
2010-01-30 08:55:10.633951 [DEBUG] mod_lcr.c:825 we have an event<br>
2010-01-30 08:55:10.633951 [DEBUG] mod_lcr.c:849 SQL:  SELECT l.digits<br>
AS lcr_digits,         c.carrier_name AS lcr_carrier_name,<br>
l.intralata_rate as lcr_rate_field,        cg.prefix AS lcr_gw_prefix,<br>
cg.suffix AS lcr_gw_suffix,        l.lead_strip AS lcr_lead_strip,<br>
l.trail_strip AS lcr_trail_strip,        l.prefix AS lcr_prefix,<br>
l.suffix AS lcr_suffix,        cg.codec AS lcr_codec, l.cid AS<br>
lcr_cid,        &#39;carriers&#39; AS lcr_limit_realm, c.carrier_name AS<br>
lcr_limit_id, 5 AS lcr_limit_max   FROM lcr l      JOIN carriers c ON<br>
<div>l.carrier_id=<a href="http://c.id" target="_blank">c.id</a>      JOIN carrier_gateway cg ON <a href="http://c.id" target="_blank">c.id</a>=cg.carrier_id<br>
 WHERE c.enabled = &#39;1&#39; AND cg.enabled = &#39;1&#39; AND l.enabled = &#39;1&#39;<br>
</div>AND digits_prefix @&gt; &#39;12148267711&#39;      AND CURRENT_TIMESTAMP BETWEEN<br>
date_start AND date_end   ORDER BY digits DESC, intralata_rate,<br>
random();<br>
2010-01-30 08:55:10.644013 [DEBUG] mod_lcr.c:314 Returning Dialstring<br>
[lcr_carrier=grnvoip_us,lcr_rate=0.00591]sofia/gateway/grnvoip/XXXX12148267711<br>
2010-01-30 08:55:10.644013 [DEBUG] mod_lcr.c:638 Adding grnvoip_us to<br>
head of list<br>
2010-01-30 08:55:10.644013 [DEBUG] mod_lcr.c:314 Returning Dialstring<br>
[lcr_carrier=teliax,lcr_rate=0.01000]sofia/gateway/teliax_atl/12148267711<br>
2010-01-30 08:55:10.644013 [DEBUG] mod_lcr.c:660 Adding teliax to end of list<br>
2010-01-30 08:55:10.644013 [DEBUG] mod_lcr.c:314 Returning Dialstring<br>
[lcr_carrier=teliax,lcr_rate=0.01000]sofia/gateway/teliax/12148267711<br>
2010-01-30 08:55:10.644013 [DEBUG] mod_lcr.c:660 Adding teliax to end of list<br>
2010-01-30 08:55:10.644013 [DEBUG] mod_lcr.c:314 Returning Dialstring<br>
[lcr_carrier=vitelity,lcr_rate=0.01440]sofia/gateway/vitelity/12148267711<br>
2010-01-30 08:55:10.644013 [DEBUG] mod_lcr.c:660 Adding vitelity to end of list<br>
2010-01-30 08:55:10.644013 [DEBUG] mod_lcr.c:314 Returning Dialstring<br>
[lcr_carrier=grnvoip_std,lcr_rate=0.01500]sofia/gateway/grnvoip/YYYY12148267711<br>
[...]<br>
<div><div></div><div><br>
On Fri, Jan 29, 2010 at 10:42 PM, Mouncif Benniane &lt;<a href="mailto:mouncifbb@gmail.com" target="_blank">mouncifbb@gmail.com</a>&gt; wrote:<br>
&gt; Also the Provider has presented the rates in this format?<br>
&gt; NPANXXLATA OCN INTER INTRA<br>
&gt;<br>
&gt;<br>
&gt; On Fri, Jan 29, 2010 at 11:30 PM, Mouncif Benniane &lt;<a href="mailto:mouncifbb@gmail.com" target="_blank">mouncifbb@gmail.com</a>&gt;<br>
&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Tried it and it&#39;s not giving me intralata  instead I get interstate, does<br>
&gt;&gt; the npa_nxx_company_ocn table needs to be used in this case?, also do I have<br>
&gt;&gt; to have the rate field in lcr table?<br>
&gt;&gt;<br>
&gt;&gt; lcr 617642  default 6176421212<br>
&gt;&gt;  | Digit Match | Carrier  | Rate     | Codec | CID Regexp | Dialstring<br>
&gt;&gt;                                                        |<br>
&gt;&gt;  | 617642      | carrier1 | 0.00500  |       |            |<br>
&gt;&gt; [lcr_carrier=carrier1,lcr_rate=0.00500]sofia/gateway/carrier1/1617642 |<br>
&gt;&gt;<br>
&gt;&gt; 2010-01-29 23:29:45.003307 [DEBUG] mod_lcr.c:1329 data passed to lcr is<br>
&gt;&gt; [617642  default 6176421212]<br>
&gt;&gt; 2010-01-29 23:29:45.003307 [DEBUG] mod_lcr.c:1365 Set Caller ID to<br>
&gt;&gt; [6176421212]<br>
&gt;&gt; 2010-01-29 23:29:45.003307 [DEBUG] mod_lcr.c:786 intra routing [state:0<br>
&gt;&gt; lata:0] so rate field is [rate]<br>
&gt;&gt; 2010-01-29 23:29:45.003307 [DEBUG] mod_lcr.c:802 we have an event<br>
&gt;&gt; 2010-01-29 23:29:45.003307 [DEBUG] mod_lcr.c:826 SQL: SELECT l.digits,<br>
&gt;&gt; c.carrier_name, l.rate, cg.prefix AS gw_prefix, cg.suffix AS gw_suffix,<br>
&gt;&gt; l.lead_strip, l.trail_strip, l.prefix, l.suffix , cg.codec , l.cid FROM lcr<br>
&gt;&gt; l JOIN carriers c ON l.carrier_id=<a href="http://c.id" target="_blank">c.id</a> JOIN carrier_gateway cg ON<br>
&gt;&gt; <a href="http://c.id" target="_blank">c.id</a>=cg.carrier_id WHERE c.enabled = &#39;1&#39; AND cg.enabled = &#39;1&#39; AND l.enabled<br>
&gt;&gt; = &#39;1&#39; AND digits IN (617642, 61764, 6176, 617, 61, 6) AND CURRENT_TIMESTAMP<br>
&gt;&gt; BETWEEN date_start AND date_end ORDER BY digits DESC,  rate, rand();<br>
&gt;&gt; 2010-01-29 23:29:45.003307 [DEBUG] mod_lcr.c:307 Returning Dialstring<br>
&gt;&gt; [lcr_carrier=carrier1,lcr_rate=0.00500]sofia/gateway/carrier1/1617642<br>
&gt;&gt; 2010-01-29 23:29:45.003307 [DEBUG] mod_lcr.c:615 Adding carrier1 to head<br>
&gt;&gt; of list<br>
&gt;&gt; 2010-01-29 23:29:45.003307 [DEBUG] mod_lcr.c:307 Returning Dialstring<br>
&gt;&gt; [lcr_carrier=carrier1,lcr_rate=0.00500]sofia/gateway/carrier1/1617642<br>
&gt;&gt;<br>
&gt;&gt; Thank you Rupa!<br>
&gt;&gt;<br>
&gt;&gt; On Fri, Jan 29, 2010 at 7:37 PM, Rupa Schomaker &lt;<a href="mailto:rupa@rupa.com" target="_blank">rupa@rupa.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; turn console logging up to debug and redo the lcr lookup.  The sql<br>
&gt;&gt;&gt; statements along with status info will show up.  This should give<br>
&gt;&gt;&gt; enough information to debug what is happening.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I&#39;m assuming the npanxx table is actually populated and not just<br>
&gt;&gt;&gt; existing?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; When doing the lookup from the cli you have to tell lcr what CID to<br>
&gt;&gt;&gt; use (remember, it is relative to the src/dest number).  I&#39;m pretty<br>
&gt;&gt;&gt; sure you get something on the console log when you don&#39;t specify a CID<br>
&gt;&gt;&gt; when using the commandline.  Anyway:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; lcr 617642  default 6176421212<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; should give you intralata.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Note that the definition of intralata doesn&#39;t mean &quot;local&quot; for some<br>
&gt;&gt;&gt; providers.  Some providers define local to &quot;same ratecenter&quot; which is<br>
&gt;&gt;&gt; even more restrictive.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Fri, Jan 29, 2010 at 4:43 PM, Mouncif Benniane &lt;<a href="mailto:mouncifbb@gmail.com" target="_blank">mouncifbb@gmail.com</a>&gt;<br>
&gt;&gt;&gt; wrote:<br>
&gt;&gt;&gt; &gt; i can&#39;t make use of mod_lcr using Intra/Interstate rating, I am using<br>
&gt;&gt;&gt; &gt; svn: FreeSWITCH Version 1.0.trunk (16517)<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; lcr mysql table structure:<br>
&gt;&gt;&gt; &gt; CREATE TABLE `lcr` (<br>
&gt;&gt;&gt; &gt;   `id` INT(11) NOT NULL AUTO_INCREMENT,<br>
&gt;&gt;&gt; &gt;   `digits` VARCHAR(15) DEFAULT NULL,<br>
&gt;&gt;&gt; &gt;   `rate` FLOAT(11,5) DEFAULT NULL,<br>
&gt;&gt;&gt; &gt;   `intrastate_rate` FLOAT(11,5) DEFAULT NULL,<br>
&gt;&gt;&gt; &gt;   `intralata_rate` FLOAT(11,5) DEFAULT NULL,<br>
&gt;&gt;&gt; &gt;   `carrier_id` INT(11) NOT NULL,<br>
&gt;&gt;&gt; &gt;   `lead_strip` INT(11) NOT NULL,<br>
&gt;&gt;&gt; &gt;   `trail_strip` INT(11) NOT NULL,<br>
&gt;&gt;&gt; &gt;   `prefix` VARCHAR(16) NOT NULL,<br>
&gt;&gt;&gt; &gt;   `suffix` VARCHAR(16) NOT NULL,<br>
&gt;&gt;&gt; &gt;   `lcr_profile` VARCHAR(32) DEFAULT NULL,<br>
&gt;&gt;&gt; &gt;   `date_start` DATETIME NOT NULL DEFAULT &#39;1970-01-01 00:00:00&#39;,<br>
&gt;&gt;&gt; &gt;   `date_end` DATETIME NOT NULL DEFAULT &#39;2030-12-31 00:00:00&#39;,<br>
&gt;&gt;&gt; &gt;   `quality` FLOAT(10,6) NOT NULL,<br>
&gt;&gt;&gt; &gt;   `reliability` FLOAT(10,6) NOT NULL,<br>
&gt;&gt;&gt; &gt;   `cid` VARCHAR(32) NOT NULL DEFAULT &#39;&#39;,<br>
&gt;&gt;&gt; &gt;   `enabled` TINYINT(1) NOT NULL DEFAULT &#39;1&#39;,<br>
&gt;&gt;&gt; &gt;   PRIMARY KEY  (`id`),<br>
&gt;&gt;&gt; &gt;   KEY `carrier_id` (`carrier_id`),<br>
&gt;&gt;&gt; &gt;   KEY `digits` (`digits`),<br>
&gt;&gt;&gt; &gt;   KEY `lcr_profile` (`lcr_profile`),<br>
&gt;&gt;&gt; &gt;   KEY `digits_profile_cid_rate` USING BTREE (`digits`),<br>
&gt;&gt;&gt; &gt;   CONSTRAINT `carrier_id` FOREIGN KEY (`carrier_id`) REFERENCES<br>
&gt;&gt;&gt; &gt; `carriers`<br>
&gt;&gt;&gt; &gt; (`id`) ON DELETE CASCADE ON UPDATE CASCADE<br>
&gt;&gt;&gt; &gt; ) ENGINE=INNODB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; lcr_admin show profiles<br>
&gt;&gt;&gt; &gt; Name:           default<br>
&gt;&gt;&gt; &gt;  custom sql:    SELECT l.digits, c.carrier_name, l.${lcr_rate_field},<br>
&gt;&gt;&gt; &gt; cg.prefix AS gw_prefix, cg.suffix AS gw_suffix, l.lead_strip,<br>
&gt;&gt;&gt; &gt; l.trail_strip,<br>
&gt;&gt;&gt; &gt; l.prefix, l.suffix , cg.codec , l.cid FROM lcr l JOIN carriers c ON<br>
&gt;&gt;&gt; &gt; l.carrier_id=<a href="http://c.id" target="_blank">c.id</a> JOIN carrier_gateway cg ON <a href="http://c.id" target="_blank">c.id</a>=cg.carrier_id WHERE<br>
&gt;&gt;&gt; &gt; c.enabled = &#39;1&#39; AND cg.enabled = &#39;1&#39; AND l.enabled = &#39;1&#39; AND digits IN<br>
&gt;&gt;&gt; &gt; (${lcr_query_expanded_digits}) AND CURRENT_TIMESTAMP BETWEEN date_start<br>
&gt;&gt;&gt; &gt; AND<br>
&gt;&gt;&gt; &gt; date_end ORDER BY digits DESC,  ${lcr_rate_field},  quality DESC,<br>
&gt;&gt;&gt; &gt;  reliability DESC, rand();<br>
&gt;&gt;&gt; &gt;  has %:         false<br>
&gt;&gt;&gt; &gt;  has vars:      true<br>
&gt;&gt;&gt; &gt;  has intrastate:        true<br>
&gt;&gt;&gt; &gt;  has intralata: true<br>
&gt;&gt;&gt; &gt;  has npanxx:    true<br>
&gt;&gt;&gt; &gt;  Reorder rate:  enabled<br>
&gt;&gt;&gt; &gt;  Info in headers:       disabled<br>
&gt;&gt;&gt; &gt;  Quote IN() List:       disabled<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; lcr 617642  default  returns rate from the rate field table and not<br>
&gt;&gt;&gt; &gt; intra/inter state fields rates.<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; Any ideas? thanks!<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt;&gt; &gt; FreeSWITCH-users mailing list<br>
&gt;&gt;&gt; &gt; <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
&gt;&gt;&gt; &gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
&gt;&gt;&gt; &gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; --<br>
&gt;&gt;&gt; -Rupa<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; FreeSWITCH-users mailing list<br>
&gt;&gt;&gt; <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
&gt;&gt;&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
&gt;&gt;&gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
&gt;&gt;&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; FreeSWITCH-users mailing list<br>
&gt; <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
&gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;<br>
&gt;<br>
<br>
<br>
<br>
--<br>
-Rupa<br>
<br>
_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</div></div></blockquote></div><br>
</div></div><br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div></div></div><br><br clear="all"><br>-- <br><font color="#888888">-Rupa<br>
</font><br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br>
</div></div><br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>-Rupa<br>
</div></div><br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br>
</div></div><br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>-Rupa<br>