[Freeswitch-users] Set channel variable lcr

FERNANDO VILLARROEL fvillarroel at yahoo.com
Sat Nov 16 21:09:19 MSK 2013


Hi Victor thank you for you answer.

If i have:

    <profile name="pg_prefix2">
      <param name="order_by" value="rate,quality,reliability"/>
      <param name="export_fields" value="nibble_account,nibble_rate,lowbal_amt,nobal_amt,lcr_carrierid_field,tarifa"/>
      <param name="custom_sql" value="
        SELECT l.digits AS lcr_digits,
               c.id AS lcr_carrierid_field,
               c.carrier_name AS lcr_carrier_name,
               l.${lcr_rate_field} 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,
               a.id AS nibble_account,
               l.${lcr_rate_field} AS nibble_rate,
               a.warn_limit AS lowbal_amt,
               a.nobal_limit AS nobal_amt,
               a.id_tarifa AS tarifa 
          FROM lcr l
            JOIN carriers c ON l.carrier_id=c.id
            JOIN carrier_gateway cg ON c.id=cg.carrier_id
            JOIN auth_user a ON a.id = ${accountcode} 
            JOIN tarifas t ON t.id = a.id_tarifa 
          WHERE c.enabled = '1' AND cg.enabled = '1' AND l.enabled = '1'
            AND l.digits @> '${lcr_query_digits}'
            AND CURRENT_TIMESTAMP BETWEEN date_start AND date_end
          ORDER BY digits DESC, ${lcr_rate_field}, random();
      "/>
    </profile>


How i can set  variable tarifa in my dialplan like

       <action application="lcr" data="$1 pg_prefix2"/>
        <action application="set" data="tarifa=${tarifa}"/>
        <action application="bridge" data="${lcr_auto_route}"/>

Regards




On Saturday, November 16, 2013 2:58 PM, Victor Chukalovskiy <victor.chukalovskiy at gmail.com> wrote:
 
mod_lcr sets variable that you can use as a dial-strings:
${lcr_auto_route}
${lcr_route_1}
${lcr_route_2} etc.

You can check all the variables with "info" dialplan app.

Not sure if this answers your question.


On 13-11-16 12:30 PM, Fernando Villarroel wrote:
> Hi.
>
> How i can set a channel variable from lcr select  (mod_lcr)
>
> Or how i can set some variable from ${lcr_auto_route}
>
> Any idea how i can do?
>
> Enviado desde mi iPhone
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> 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


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org
http://www.freeswitchsolutions.com




Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com

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/20131116/7eca978a/attachment-0001.html 


Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users mailing list