[Freeswitch-users] mod_lcr for a-z rates

Rupa Schomaker rupa at rupa.com
Tue Jun 9 17:37:24 PDT 2009


Diego,

Here is how I'd go about doing what I think you want.  As payment, add a
section to the wiki when you have it working.

Create two profiles in lcr.conf.

the first profile is your callingcard rate deck.  Give it a profile id of
1.  Then load your data into the lcr tables.

carriers = define your carrier.  call it whatever you want
carrier_gateteway = you won't care about any real routes, so just load dummy
data in here (linked to your carrier).
lcr = load your rate deck here.  Set profile id to 1.

Now, to look up the customer's code, use the lcr application.

application="lcr" data="$1 profilename" where profilename  is the profile
defined in lcr.conf with id 1.  $1 is the normalized number (I suggest e164
format minus the + -- this is discussed in the wiki).

At this point, you'll have the results of the lcr query in channel vars.

${lcr_route_count} tells you the number of routes found (if you loaded your
rate deck right it should always be 1).  ${lcr_rate_1} will contain the
rate.

So now you can set that to the var you need for nibblebill to work.

If you want to use lcr to actually route the actual call, just call it
again.  This time with the profile id set to whatever you use to load the
full lcr table for all your providers.

On Tue, Jun 9, 2009 at 6:35 PM, Diego Viola <diego.viola at gmail.com> wrote:

> Hi everyone,
>
> I'm trying to write a calling card app with A-Z rates, and I plan to use
> mod_lcr for this case... the only thing I need mod_lcr to do for me is get
> the rate based on the destination number / prefix.
>
> Is there a way I could achieve this with mod_lcr? I seen the wiki page and
> the SQL examples, but the SQL examples does a lot more, so I was thinking if
> I could use a custom SQL query to only do what I need.
>
> Thanks,
>
> Diego
>
> _______________________________________________
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20090609/9e6e5e47/attachment.html 


More information about the Freeswitch-users mailing list