Also the Provider has presented the rates in this format?<div><br></div><div>NPANXXLATA
OCN
INTER
INTRA<br><br><br><div class="gmail_quote">On Fri, Jan 29, 2010 at 11:30 PM, Mouncif Benniane <span dir="ltr"><<a href="mailto:mouncifbb@gmail.com">mouncifbb@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Tried it and it's not giving me intralata instead I get interstate, does the npa_nxx_company_ocn table needs to be used in this case?, also do I have to have the rate field in lcr table?<div><br></div><div><br></div>
<div>
<div>lcr 617642 default 6176421212</div><div><br></div><div> | Digit Match | Carrier | Rate | Codec | CID Regexp | Dialstring |</div><div> | 617642 | carrier1 | 0.00500 | | | [lcr_carrier=carrier1,lcr_rate=0.00500]sofia/gateway/carrier1/1617642 |</div>
<div><br></div><div><br></div><div><div>2010-01-29 23:29:45.003307 [DEBUG] mod_lcr.c:1329 data passed to lcr is [617642 default 6176421212]</div><div>2010-01-29 23:29:45.003307 [DEBUG] mod_lcr.c:1365 Set Caller ID to [6176421212]</div>
<div>2010-01-29 23:29:45.003307 [DEBUG] mod_lcr.c:786 intra routing [state:0 lata:0] so rate field is [rate]</div><div>2010-01-29 23:29:45.003307 [DEBUG] mod_lcr.c:802 we have an event</div><div>2010-01-29 23:29:45.003307 [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 = '1' AND cg.enabled = '1' AND l.enabled = '1' AND digits IN (617642, 61764, 6176, 617, 61, 6) AND CURRENT_TIMESTAMP BETWEEN date_start AND date_end ORDER BY digits DESC, rate, rand();</div>
<div>2010-01-29 23:29:45.003307 [DEBUG] mod_lcr.c:307 Returning Dialstring [lcr_carrier=carrier1,lcr_rate=0.00500]sofia/gateway/carrier1/1617642</div><div>2010-01-29 23:29:45.003307 [DEBUG] mod_lcr.c:615 Adding carrier1 to head of list</div>
<div>2010-01-29 23:29:45.003307 [DEBUG] mod_lcr.c:307 Returning Dialstring [lcr_carrier=carrier1,lcr_rate=0.00500]sofia/gateway/carrier1/1617642</div><div><br></div></div><div><br></div><div>Thank you Rupa!<div><div></div>
<div class="h5"><br><br><div class="gmail_quote">
On Fri, Jan 29, 2010 at 7:37 PM, Rupa Schomaker <span dir="ltr"><<a href="mailto:rupa@rupa.com" target="_blank">rupa@rupa.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
turn console logging up to debug and redo the lcr lookup. The sql<br>
statements along with status info will show up. This should give<br>
enough information to debug what is happening.<br>
<br>
I'm assuming the npanxx table is actually populated and not just existing?<br>
<br>
When doing the lookup from the cli you have to tell lcr what CID to<br>
use (remember, it is relative to the src/dest number). I'm pretty<br>
sure you get something on the console log when you don't specify a CID<br>
when using the commandline. Anyway:<br>
<br>
lcr 617642 default 6176421212<br>
<br>
should give you intralata.<br>
<br>
Note that the definition of intralata doesn't mean "local" for some<br>
providers. Some providers define local to "same ratecenter" which is<br>
even more restrictive.<br>
<div><div></div><div><br>
On Fri, Jan 29, 2010 at 4:43 PM, Mouncif Benniane <<a href="mailto:mouncifbb@gmail.com" target="_blank">mouncifbb@gmail.com</a>> wrote:<br>
> i can't make use of mod_lcr using Intra/Interstate rating, I am using<br>
> svn: FreeSWITCH Version 1.0.trunk (16517)<br>
><br>
> lcr mysql table structure:<br>
> CREATE TABLE `lcr` (<br>
> `id` INT(11) NOT NULL AUTO_INCREMENT,<br>
> `digits` VARCHAR(15) DEFAULT NULL,<br>
> `rate` FLOAT(11,5) DEFAULT NULL,<br>
> `intrastate_rate` FLOAT(11,5) DEFAULT NULL,<br>
> `intralata_rate` FLOAT(11,5) DEFAULT NULL,<br>
> `carrier_id` INT(11) NOT NULL,<br>
> `lead_strip` INT(11) NOT NULL,<br>
> `trail_strip` INT(11) NOT NULL,<br>
> `prefix` VARCHAR(16) NOT NULL,<br>
> `suffix` VARCHAR(16) NOT NULL,<br>
> `lcr_profile` VARCHAR(32) DEFAULT NULL,<br>
> `date_start` DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00',<br>
> `date_end` DATETIME NOT NULL DEFAULT '2030-12-31 00:00:00',<br>
> `quality` FLOAT(10,6) NOT NULL,<br>
> `reliability` FLOAT(10,6) NOT NULL,<br>
> `cid` VARCHAR(32) NOT NULL DEFAULT '',<br>
> `enabled` TINYINT(1) NOT NULL DEFAULT '1',<br>
> PRIMARY KEY (`id`),<br>
> KEY `carrier_id` (`carrier_id`),<br>
> KEY `digits` (`digits`),<br>
> KEY `lcr_profile` (`lcr_profile`),<br>
> KEY `digits_profile_cid_rate` USING BTREE (`digits`),<br>
> CONSTRAINT `carrier_id` FOREIGN KEY (`carrier_id`) REFERENCES `carriers`<br>
> (`id`) ON DELETE CASCADE ON UPDATE CASCADE<br>
> ) ENGINE=INNODB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1<br>
><br>
><br>
> lcr_admin show profiles<br>
> Name: default<br>
> custom sql: SELECT l.digits, c.carrier_name, l.${lcr_rate_field},<br>
> cg.prefix AS gw_prefix, cg.suffix AS gw_suffix, l.lead_strip, l.trail_strip,<br>
> l.prefix, l.suffix , cg.codec , l.cid FROM lcr l JOIN carriers c ON<br>
> 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>
> c.enabled = '1' AND cg.enabled = '1' AND l.enabled = '1' AND digits IN<br>
> (${lcr_query_expanded_digits}) AND CURRENT_TIMESTAMP BETWEEN date_start AND<br>
> date_end ORDER BY digits DESC, ${lcr_rate_field}, quality DESC,<br>
> reliability DESC, rand();<br>
> has %: false<br>
> has vars: true<br>
> has intrastate: true<br>
> has intralata: true<br>
> has npanxx: true<br>
> Reorder rate: enabled<br>
> Info in headers: disabled<br>
> Quote IN() List: disabled<br>
><br>
><br>
><br>
> lcr 617642 default returns rate from the rate field table and not<br>
> intra/inter state fields rates.<br>
><br>
> Any ideas? thanks!<br>
><br>
><br>
><br>
><br>
</div></div>> _______________________________________________<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>
><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>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>