It is very common to offer unlimited plans for some destinations. For example:

  • Unlimited calls to United States and Canada
  • Normal rates to other destinations
  • Monthly rent of 9.99 USD

To make this kind of configuration, read the following steps:

  1. Go to App -> LCR menu and configure selling prices. For this example, the plan will be called "NorthAmerica" (without spaces). Add prices as you do normally, but on the "LCR profile" field write "NorthAmerica". This will tell system to use these specific pricing. Don't forget that unlimited destinations must have 0 (zero) cost.
  2. Edit lcr.conf.xml file and add or modify a LCR profile like this (some variations may occur because database type or customizations done):
    <profile name="select">
    <param name="custom_sql" value="
    SELECT
    l.digits AS lcr_digits,
    c.carrier_name AS lcr_carrier_name,
    l.rate as lcr_rate_field,
    cg.prefix AS lcr_gw_prefix,
    cg.suffix AS lcr_gw_suffix,
    l.lead_strip AS lcr_lead_strip,
    l.trail_strip AS lcr_trail_strip,
    l.prefix AS lcr_prefix,
    l.suffix AS lcr_suffix,
    cg.codec AS lcr_codec,
    (SELECT rate FROM v_lcr INNER JOIN v_billings on v_billings.lcr_profile = v_lcr.lcr_profile WHERE v_lcr.carrier_uuid IS NULL AND v_lcr.lcr_dir ection = 'outbound' AND v_lcr.digits IN (${lcr_query_expanded_digits}) AND v_billings.type_value='${accountcode}' ORDER BY digits DESC, rate ASC LIMIT 1) AS lcr_user_rate,
    'carriers' AS lcr_limit_realm,
    c.carrier_name AS lcr_limit_id,
    c.carrier_channels AS lcr_limit_max,
    a.type_value as nibble_account,
    (SELECT rate FROM v_lcr INNER JOIN v_billings on v_billings.lcr_profile = v_lcr.lcr_profile WHERE v_lcr.carrier_uuid IS NULL AND v_lcr.lcr_direction = 'outbound' AND v_lcr.digits IN (${lcr_query_expanded_digits}) AND v_billings.type_value='${accountcode}' ORDER BY digits DESC, rate ASC LIMIT 1) AS nibble_rate,
    l.connect_increment as lcr_first_increment,
    l.talk_increment as lcr_second_increment,
    (SELECT connect_increment FROM v_lcr WHERE v_lcr.lcr_profile = '${lcr_profile}' AND carrier_uuid IS NULL AND v_lcr.lcr_direction = 'outbound' AND digits IN (${lcr_query_expanded_digits}) ORDER BY digits DESC, rate ASC limit 1) AS lcr_user_first_increment,
    (SELECT talk_increment FROM v_lcr WHERE v_lcr.lcr_profile = '${lcr_profile}' AND carrier_uuid IS NULL AND v_lcr.lcr_direction = 'outbound' AND digits IN (${lcr_query_expanded_digits}) ORDER BY digits DESC, rate ASC limit 1) AS lcr_user_second_increment,
    (SELECT IF(strcmp(credit_type,'prepaid'),credit,0.5) FROM v_billings WHERE type_value='${accountcode}') as nobal_amt,
    (SELECT IF(strcmp(credit_type,'prepaid'),credit,1) FROM v_billings WHERE type_value='${accountcode}') as lowbal_amt,
    '${for_fax}' as fax
    FROM v_lcr l
    JOIN v_carriers c ON l.carrier_uuid=c.carrier_uuid
    JOIN v_carrier_gateways cg ON c.carrier_uuid=cg.carrier_uuid
    JOIN v_billings a ON a.type_value='${accountcode}'
    WHERE c.enabled = 'true'
    AND cg.enabled = 'true'
    AND l.enabled = 'true'
    AND l.lcr_direction = 'outbound'
    AND l.lcr_profile = '${lcr_profile}'
    AND NOW() >= l.date_start
    AND NOW() < l.date_end
    AND l.digits IN (${lcr_query_expanded_digits})
    ORDER BY digits DESC, lcr_rate_field ASC, l.date_start DESC;
    "/>
    <param name="export_fields" value="nibble_account,nibble_rate,lcr_first_increment,lcr_second_increment,lcr_user_first_increment,lcr_user_second_increment,nobal_amt,lowbal_amt"/>
    </profile>
  3. Reload the Freeswitch mod_lcr modue with fs_cli -x 'reload mod_lcr' command
  4. Go to App -> Billing menu and create or edit a billing profile as you usually do. Add the "NorthAmerica" label on the "LCR profile" field. This tells the system to use the pricing with the same label.
  5. Edit again the same billing profile and add a static charge with your plan price.
    fusionpbx add static charge billing

About OKay

An IT Compnay whose mission is generating value with low cost of ownership.

We will offer you Linux based solutions that satisfy your needs. We focus on VoIP & Linux, but we are up for any other challenge you may want to bring.