Hello,

Thanks for replying!

It was not set, but i understood from the wiki that if you don't want any rounding, you dont't set it.

I set it to "10", i want the user to be charged tvery 10 seconds, you nibblebil is charging 10 DOLLARS!
I must be getting something wrong...


Here's my nibblebill.conf.xml. 

(BTW, the two highlighted lines, is it possible to do that? I want the custom SQLs to use channel variables, is it possible?)


    <section name="configuration">
        <configuration name="nibblebill.conf" description="Nibble Billing">
            <settings>
                <param name="db_username" value="myroot" />
                <param name="db_password" value="mypass" />
                <param name="odbc-dsn" value="odbc://viking" />
                <param name="db_table" value="sip_users" />
                <param name="db_column_cash" value="balance" />
                <param name="db_column_account" value="id" />
                <param name="custom_sql_lookup" value="SELECT ${variable_card_db_column_cash} AS nibble_balance FROM ${variable_card_db_table} WHERE ${variable_card_db_column_account}=${nibble_account};" />
                <param name="custom_sql_save" value="UPDATE ${variable_card_db_table} SET ${variable_card_db_column_cash}=${variable_card_db_column_cash}-${nibble_increment} WHERE ${variable_card_db_column_account}=${nibble_account};" />
                <param name="global_heartbeat" value="10" />
                <param name="lowbal_amt" value="0" />
                <param name="lowbal_action" value="play ding" />
                <param name="nobal_amt" value="0" />
                <param name="nobal_action" value="hangup" />
                <param name="percall_max_amt" value="100" />
                <param name="percall_action" value="hangup" />
            </settings>
        </configuration>
    </section>

Here's the dialplan:

    <section name="dialplan">
        <context name="route_call">
            <extension name="routeCall">
                <condition field="destination_number" expression="^.*">
                    <action application="set" data="continue_on_fail=NO_ROUTE_DESTINATION,UNALLOCATED_NUMBER,407" />
                    <action application="set" data="sip_from_user=1002" />
                    <action application="set" data="sip_auth_username=1002" />
                    <action application="set" data="sip_req_user=1002" />
                    <action application="set" data="hangup_after_bridge=true" />
                    <action application="set" data="nibble_rate=0.0500" />
                    <action application="nibblebill" data="heartbeat 10" />
                    <action application="set" data="card_db_table=cards_table" />
                    <action application="set" data="card_db_column_cash=balance" />
                    <action application="set" data="card_db_column_account=pin" />
                    <action application="set" data="nibble_account=12345" />
                    <action application="set" data="gw=${distributor(TEST_ROUTE)}" />
                    <action application="limit" data="hash $${domain} $${domain} ${sip_auth_username} 1 !NORMAL_TEMPORARY_FAILURE" />
                    <action application="export" data="execute_on_answer=nibblebill adjust -0.1000" />
                    <action application="bridge" data="{enable_heartbeat_events=10,nibble_rate=0.0500,nibble_account=12345}sofia/gateway/${gw}/0013058883456" />
                </condition>
            </extension>
        </context>
    </section>


Thanks for your help!


David



On Wed, Feb 20, 2013 at 2:23 PM, Muhammad Shahzad <shaheryarkh@gmail.com> wrote:
Did you set nibble_increment variable? e.g.

<variable name="nibble_increment" value="30" />

Here is its details,

http://wiki.freeswitch.org/wiki/Mod_nibblebill#Nibble_Method_.28Default.29

Thank you.


On Wed, Feb 20, 2013 at 2:10 PM, David Villasmil <david.villasmil.work@gmail.com> wrote:
Anyone about this?

Thanks


On Mon, Feb 18, 2013 at 2:07 PM, David Villasmil <david.villasmil.work@gmail.com> wrote:
Hello guys,

I have the following config for nibbebill:

                <param name="custom_sql_lookup" value="SELECT ${card_db_column_cash} AS nibble_balance FROM ${card_db_table} WHERE ${card_db_column_account}=${nibble_account};" />
                <param name="custom_sql_save" value="UPDATE ${card_db_table} SET ${card_db_column_cash}=${card_db_column_cash}-${nibble_increment} WHERE ${card_db_column_account}=${nibble_account};" />

I see this on the log, which is obviously failing:


 [UPDATE cards_table SET balance=balance- WHERE pin=12345;]

is ${nibble_increment} not the correct variable to use? It looks like it is empty!

Thanks!

David


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

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com

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

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org




--
Muhammad Shahzad
-----------------------------------
CISCO Rich Media Communication Specialist (CRMCS)
CISCO Certified Network Associate (CCNA)
Cell: +49 176 99 83 10 85
MSN: shari_786pk@hotmail.com
Email: shaheryarkh@googlemail.com

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

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com

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

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org