[Freeswitch-users] mod_lcr problem
Mouncif Benniane
mouncifbb at gmail.com
Fri Jan 29 20:30:36 PST 2010
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?
lcr 617642 default 6176421212
| Digit Match | Carrier | Rate | Codec | CID Regexp | Dialstring
|
| 617642 | carrier1 | 0.00500 | | |
[lcr_carrier=carrier1,lcr_rate=0.00500]sofia/gateway/carrier1/1617642 |
2010-01-29 23:29:45.003307 [DEBUG] mod_lcr.c:1329 data passed to lcr is
[617642 default 6176421212]
2010-01-29 23:29:45.003307 [DEBUG] mod_lcr.c:1365 Set Caller ID to
[6176421212]
2010-01-29 23:29:45.003307 [DEBUG] mod_lcr.c:786 intra routing [state:0
lata:0] so rate field is [rate]
2010-01-29 23:29:45.003307 [DEBUG] mod_lcr.c:802 we have an event
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=c.id JOIN carrier_gateway cg ON
c.id=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();
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
2010-01-29 23:29:45.003307 [DEBUG] mod_lcr.c:615 Adding carrier1 to head of
list
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
Thank you Rupa!
On Fri, Jan 29, 2010 at 7:37 PM, Rupa Schomaker <rupa at rupa.com> wrote:
> turn console logging up to debug and redo the lcr lookup. The sql
> statements along with status info will show up. This should give
> enough information to debug what is happening.
>
> I'm assuming the npanxx table is actually populated and not just existing?
>
> When doing the lookup from the cli you have to tell lcr what CID to
> use (remember, it is relative to the src/dest number). I'm pretty
> sure you get something on the console log when you don't specify a CID
> when using the commandline. Anyway:
>
> lcr 617642 default 6176421212
>
> should give you intralata.
>
> Note that the definition of intralata doesn't mean "local" for some
> providers. Some providers define local to "same ratecenter" which is
> even more restrictive.
>
> On Fri, Jan 29, 2010 at 4:43 PM, Mouncif Benniane <mouncifbb at gmail.com>
> wrote:
> > i can't make use of mod_lcr using Intra/Interstate rating, I am using
> > svn: FreeSWITCH Version 1.0.trunk (16517)
> >
> > lcr mysql table structure:
> > CREATE TABLE `lcr` (
> > `id` INT(11) NOT NULL AUTO_INCREMENT,
> > `digits` VARCHAR(15) DEFAULT NULL,
> > `rate` FLOAT(11,5) DEFAULT NULL,
> > `intrastate_rate` FLOAT(11,5) DEFAULT NULL,
> > `intralata_rate` FLOAT(11,5) DEFAULT NULL,
> > `carrier_id` INT(11) NOT NULL,
> > `lead_strip` INT(11) NOT NULL,
> > `trail_strip` INT(11) NOT NULL,
> > `prefix` VARCHAR(16) NOT NULL,
> > `suffix` VARCHAR(16) NOT NULL,
> > `lcr_profile` VARCHAR(32) DEFAULT NULL,
> > `date_start` DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00',
> > `date_end` DATETIME NOT NULL DEFAULT '2030-12-31 00:00:00',
> > `quality` FLOAT(10,6) NOT NULL,
> > `reliability` FLOAT(10,6) NOT NULL,
> > `cid` VARCHAR(32) NOT NULL DEFAULT '',
> > `enabled` TINYINT(1) NOT NULL DEFAULT '1',
> > PRIMARY KEY (`id`),
> > KEY `carrier_id` (`carrier_id`),
> > KEY `digits` (`digits`),
> > KEY `lcr_profile` (`lcr_profile`),
> > KEY `digits_profile_cid_rate` USING BTREE (`digits`),
> > CONSTRAINT `carrier_id` FOREIGN KEY (`carrier_id`) REFERENCES
> `carriers`
> > (`id`) ON DELETE CASCADE ON UPDATE CASCADE
> > ) ENGINE=INNODB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1
> >
> >
> > lcr_admin show profiles
> > Name: default
> > custom sql: SELECT l.digits, c.carrier_name, l.${lcr_rate_field},
> > 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=c.id JOIN carrier_gateway cg ON c.id=cg.carrier_id WHERE
> > c.enabled = '1' AND cg.enabled = '1' AND l.enabled = '1' AND digits IN
> > (${lcr_query_expanded_digits}) AND CURRENT_TIMESTAMP BETWEEN date_start
> AND
> > date_end ORDER BY digits DESC, ${lcr_rate_field}, quality DESC,
> > reliability DESC, rand();
> > has %: false
> > has vars: true
> > has intrastate: true
> > has intralata: true
> > has npanxx: true
> > Reorder rate: enabled
> > Info in headers: disabled
> > Quote IN() List: disabled
> >
> >
> >
> > lcr 617642 default returns rate from the rate field table and not
> > intra/inter state fields rates.
> >
> > Any ideas? thanks!
> >
> >
> >
> >
> > _______________________________________________
> > FreeSWITCH-users mailing list
> > FreeSWITCH-users at lists.freeswitch.org
> > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> > UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> > http://www.freeswitch.org
> >
> >
>
>
>
> --
> -Rupa
>
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20100129/11f0a912/attachment-0002.html
More information about the FreeSWITCH-users
mailing list