[Freeswitch-users] application set variable problem
FERNANDO VILLARROEL
fvillarroel at yahoo.com
Tue Jun 12 01:02:04 MSD 2012
Hi.
Does anyone could help me.
--- On Mon, 6/11/12, FERNANDO VILLARROEL <fvillarroel at yahoo.com> wrote:
> From: FERNANDO VILLARROEL <fvillarroel at yahoo.com>
> Subject: [Freeswitch-users] application set variable problem
> To: freeswitch-users at lists.freeswitch.org
> Date: Monday, June 11, 2012, 12:52 PM
> Hi All.
>
> i am using mod_lcr
>
>
> <action application="lcr" data="$1
> pg_prefix2"/>
> <action application="set"
> data="nibble_account=${accountcode}"/>
> <action application="set"
> data="nibble_rate=${lcr_rate_1}"/>
> <action application="set" data="foo=11"/>
> <action application="set"
> data="accounts_tarifa=${tarifa}"/>
>
> My custom SQL:
>
>
> <param name="custom_sql" value="
> SELECT l.digits AS lcr_digits,
> 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 accounts a ON a.id = '${accountcode}'
> JOIN tarifas t ON a.id_tarifa = t.id
> 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();
>
>
> Log :
>
>
> 2012-06-11 11:33:52.336613 [DEBUG] mod_lcr.c:940 SQL:
> 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, a.id AS
> nibble_account, l.rate 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 accounts a
> ON a.id = '1004' JOIN tarifas t ON
> a.id_tarifa = t.id WHERE c.enabled = '1' AND
> cg.enabled = '1' AND l.enabled = '1'
> AND l.digits @> '1006'
> AND CURRENT_TIMESTAMP BETWEEN date_start
> AND date_end ORDER BY digits DESC, rate,
> random();
> 2012-06-11 11:33:52.356514 [DEBUG] mod_lcr.c:338 Returning
> Dialstring
> [lcr_carrier=carrier2,lcr_rate=0.14000,nibble_account=1004,nibble_rate=0.14000,lowbal_amt=0,nobal_amt=0,tarifa=1]user/gateway/0006
> 2012-06-11 11:33:52.356514 [DEBUG] mod_lcr.c:677 Adding
> carrier2 to head of list
> 2012-06-11 11:33:52.356514 [DEBUG] mod_lcr.c:338 Returning
> Dialstring
> [lcr_carrier=carrier1,lcr_rate=0.15000,nibble_account=1004,nibble_rate=0.15000,lowbal_amt=0,nobal_amt=0,tarifa=1]user/1006
> 2012-06-11 11:33:52.356514 [DEBUG] mod_lcr.c:705 Adding
> carrier1 to end of list
> EXECUTE sofia/internal/1004 at 192.168.1.108
> set(nibble_account=1004)
> 2012-06-11 11:33:52.356514 [DEBUG] mod_dptools.c:1294
> sofia/internal/1004 at 192.168.1.108 SET
> [nibble_account]=[1004]
> EXECUTE sofia/internal/1004 at 192.168.1.108
> set(nibble_rate=0.14000)
> 2012-06-11 11:33:52.356514 [DEBUG] mod_dptools.c:1294
> sofia/internal/1004 at 192.168.1.108 SET
> [nibble_rate]=[0.14000]
> EXECUTE sofia/internal/1004 at 192.168.1.108 set(foo=11)
> 2012-06-11 11:33:52.356514 [DEBUG] mod_dptools.c:1294
> sofia/internal/1004 at 192.168.1.108 SET [foo]=[11]
> EXECUTE sofia/internal/1004 at 192.168.1.108
> set(accounts_tarifa=)
> 2012-06-11 11:33:52.356514 [DEBUG] mod_dptools.c:1294
> sofia/internal/1004 at 192.168.1.108 SET
> [accounts_tarifa]=[UNDEF]
>
>
> My accounts_tarifa variable is UNDEF
>
> What i am doing wrong?
>
> Regard
>
> _________________________________________________________________________
> 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
>
> Join Us At ClueCon - Aug 7-9, 2012
>
> 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
>
Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users
mailing list