[Freeswitch-users] nibblebill never hangs up

Shrouk Khan shroukkhan at softverk.is
Thu May 20 03:53:10 PDT 2010


hi ,
i have successfully installed the nibble bill and trying to test billing
depending on the destination , but even though the Cash goes to negetive the
call never hangs up !

here are my conf :

nibblebill.conf
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


<configuration name="nibblebill.conf" description="Nibble Billing">
  <settings>
    <!-- See http://wiki.freeswitch.org/wiki/Mod_nibblebill for help with
these options -->

    <!-- Information for connecting to your database -->
    <param name="db_username" value="root"/>
    <param name="db_password" value="fusionpbx"/>
    <param name="db_dsn" value="freeswitch_odbc"/>

    <!-- The database table where your CASH column is located -->
    <param name="db_table" value="v_extensions"/>

    <!-- The column name where we store the value of the account -->
    <param name="db_column_cash" value="Cash"/>

    <!-- The column name for the unique ID identifying the account -->
    <param name="db_column_account" value="extension"/>

    <!-- Custom SQL for loading current balance - overrides column names
         channel vars are interpreted.
         field nibble_balance is used for balance info

    <param name="custom_sql_lookup" value="SELECT cash AS nibble_balance
FROM accounts WHERE account_code='${nibble_account}'"/>
    -->

    <!-- Custom SQL for loading current balance - overrides column names
         channel vars are interpreted.
         nibble_increment is the amount to update

    <param name="custom_sql_save" value="UPDATE accounts SET
cash=cash-${nibble_increment} WHERE account_code='${nibble_account}'"/>
    -->


    <!-- Default heartbeat interval. Set to 'off' for no heartbeat (i.e.
bill only at end of call) -->
    <param name="global_heartbeat" value="30"/>

    <!-- By default, warn a caller when their balance is at $5.00. You can
set this to a negative number. -->
    <param name="lowbal_amt" value="5"/>
    <param name="lowbal_action" value="play ding"/>

    <!-- By default, terminate a caller when their balance hits $0.00. You
can set this to a negative number. -->
    <param name="nobal_amt" value="0.00"/>
    <param name="nobal_action" value="hangup"/>

    <!-- If a call goes beyond a certain dollar amount, flag or terminate it
-->
    <param name="percall_max_amt" value="100"/>
    <param name="percall_action" value="hangup"/>

  </settings>
</configuration>
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

an extension called 5400

<include>
  <user id="5400">
    <params>
      <param name="password" value="5400"/>
      <param name="vm-password" value="8975"/>
    </params>
    <variables>
      <variable name="toll_allow" value="domestic,international,local"/>
      <variable name="accountcode" value="5400"/>
      <variable name="user_context" value="default"/>
      <variable name="nibble_account" value="5400"/>
    </variables>
  </user>
</include>

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


finally in the dial plan :

<extension name="ToIcelandPBX.58d2" >
  <condition field="destination_number" expression="^(58.*)">
    <action application="set" data="$${nibble_account}"/>
  </condition>
  <condition field="destination_number" expression="^(5807)$">
    <action application="set" data="nibble_rate=30"/>
    <action application="bridge" data="sofia/gateway/ToIcelandPBX/$1"/>
  </condition>

  <condition field="destination_number" expression="^(5812)$">
    <action application="set" data="nibble_rate=15"/>
    <action application="bridge" data="sofia/gateway/ToIcelandPBX/$1"/>
  </condition>

</extension>


right now the Cash balance for the extension is -192.00 and the extension
can still make calls jsut fine.
Am I missing something here ?

-- 
Regards

Shrouk Khan (Khan)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20100520/005fa655/attachment.html 


More information about the FreeSWITCH-users mailing list