hi ,<div>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 ! </div><div><br></div><div>here are my conf :</div>
<div><br></div><div>nibblebill.conf</div><div>------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</div>
<div><div><div><br></div></div></div><div><br></div><div><div>&lt;configuration name=&quot;nibblebill.conf&quot; description=&quot;Nibble Billing&quot;&gt;</div><div>  &lt;settings&gt;</div><div>    &lt;!-- See <a href="http://wiki.freeswitch.org/wiki/Mod_nibblebill">http://wiki.freeswitch.org/wiki/Mod_nibblebill</a> for help with these options --&gt;</div>
<div><br></div><div>    &lt;!-- Information for connecting to your database --&gt;</div><div>    &lt;param name=&quot;db_username&quot; value=&quot;root&quot;/&gt;</div><div>    &lt;param name=&quot;db_password&quot; value=&quot;fusionpbx&quot;/&gt;</div>
<div>    &lt;param name=&quot;db_dsn&quot; value=&quot;freeswitch_odbc&quot;/&gt;</div><div><br></div><div>    &lt;!-- The database table where your CASH column is located --&gt;</div><div>    &lt;param name=&quot;db_table&quot; value=&quot;v_extensions&quot;/&gt;</div>
<div><br></div><div>    &lt;!-- The column name where we store the value of the account --&gt;</div><div>    &lt;param name=&quot;db_column_cash&quot; value=&quot;Cash&quot;/&gt;</div><div><br></div><div>    &lt;!-- The column name for the unique ID identifying the account --&gt;</div>
<div>    &lt;param name=&quot;db_column_account&quot; value=&quot;extension&quot;/&gt;</div><div><br></div><div>    &lt;!-- Custom SQL for loading current balance - overrides column names</div><div>         channel vars are interpreted.</div>
<div>         field nibble_balance is used for balance info</div><div><br></div><div>    &lt;param name=&quot;custom_sql_lookup&quot; value=&quot;SELECT cash AS nibble_balance FROM accounts WHERE account_code=&#39;${nibble_account}&#39;&quot;/&gt;</div>
<div>    --&gt;</div><div><br></div><div>    &lt;!-- Custom SQL for loading current balance - overrides column names</div><div>         channel vars are interpreted.</div><div>         nibble_increment is the amount to update</div>
<div><br></div><div>    &lt;param name=&quot;custom_sql_save&quot; value=&quot;UPDATE accounts SET cash=cash-${nibble_increment} WHERE account_code=&#39;${nibble_account}&#39;&quot;/&gt;</div><div>    --&gt;</div><div><br>
</div><div><br></div><div>    &lt;!-- Default heartbeat interval. Set to &#39;off&#39; for no heartbeat (i.e. bill only at end of call) --&gt;</div><div>    &lt;param name=&quot;global_heartbeat&quot; value=&quot;30&quot;/&gt;</div>
<div><br></div><div>    &lt;!-- By default, warn a caller when their balance is at $5.00. You can set this to a negative number. --&gt;</div><div>    &lt;param name=&quot;lowbal_amt&quot; value=&quot;5&quot;/&gt;</div><div>
    &lt;param name=&quot;lowbal_action&quot; value=&quot;play ding&quot;/&gt;</div><div><br></div><div>    &lt;!-- By default, terminate a caller when their balance hits $0.00. You can set this to a negative number. --&gt;</div>
<div>   <font class="Apple-style-span" color="#FF0000"> &lt;param name=&quot;nobal_amt&quot; value=&quot;0.00&quot;/&gt;</font></div><div><font class="Apple-style-span" color="#FF0000">    &lt;param name=&quot;nobal_action&quot; value=&quot;hangup&quot;/&gt;</font></div>
<div><br></div><div>    &lt;!-- If a call goes beyond a certain dollar amount, flag or terminate it --&gt;</div><div>    &lt;param name=&quot;percall_max_amt&quot; value=&quot;100&quot;/&gt;</div><div>    &lt;param name=&quot;percall_action&quot; value=&quot;hangup&quot;/&gt;</div>
<div><br></div><div>  &lt;/settings&gt;</div><div>&lt;/configuration&gt;</div><div>------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</div>
<div><br></div><div>an extension called 5400</div><div><br></div><div><div>&lt;include&gt;</div><div>  &lt;user id=&quot;5400&quot;&gt;</div><div>    &lt;params&gt;</div><div>      &lt;param name=&quot;password&quot; value=&quot;5400&quot;/&gt;</div>
<div>      &lt;param name=&quot;vm-password&quot; value=&quot;8975&quot;/&gt;</div><div>    &lt;/params&gt;</div><div>    &lt;variables&gt;</div><div>      &lt;variable name=&quot;toll_allow&quot; value=&quot;domestic,international,local&quot;/&gt;</div>
<div>      &lt;variable name=&quot;accountcode&quot; value=&quot;5400&quot;/&gt;</div><div>      &lt;variable name=&quot;user_context&quot; value=&quot;default&quot;/&gt;</div><div>      <font class="Apple-style-span" color="#FF0000">&lt;variable name=&quot;nibble_account&quot; value=&quot;5400&quot;/&gt;</font></div>
<div>    &lt;/variables&gt;</div><div>  &lt;/user&gt;</div><div>&lt;/include&gt;</div><div><br></div><div>------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</div>
</div></div><div><br></div><div><br></div><div>finally in the dial plan :</div><div><br></div><div><div>&lt;extension name=&quot;ToIcelandPBX.58d2&quot; &gt;</div><div>  &lt;condition field=&quot;destination_number&quot; expression=&quot;^(58.*)&quot;&gt;</div>
<div>    <font class="Apple-style-span" color="#FF0000">&lt;action application=&quot;set&quot; data=&quot;$${nibble_account}&quot;/&gt;</font></div><div>  &lt;/condition&gt;</div><div> <font class="Apple-style-span" color="#FF0000"> &lt;condition field=&quot;destination_number&quot; expression=&quot;^(5807)$&quot;&gt;</font></div>
<div><font class="Apple-style-span" color="#FF0000">    &lt;action application=&quot;set&quot; data=&quot;nibble_rate=30&quot;/&gt;</font></div><div><font class="Apple-style-span" color="#FF0000">    &lt;action application=&quot;bridge&quot; data=&quot;sofia/gateway/ToIcelandPBX/$1&quot;/&gt;</font></div>
<div><font class="Apple-style-span" color="#FF0000">  &lt;/condition&gt;</font></div><div><br></div><div>  <font class="Apple-style-span" color="#FF6600">&lt;condition field=&quot;destination_number&quot; expression=&quot;^(5812)$&quot;&gt;</font></div>
<div><font class="Apple-style-span" color="#FF6600">    &lt;action application=&quot;set&quot; data=&quot;nibble_rate=15&quot;/&gt;</font></div><div><font class="Apple-style-span" color="#FF6600">    &lt;action application=&quot;bridge&quot; data=&quot;sofia/gateway/ToIcelandPBX/$1&quot;/&gt;</font></div>
<div><font class="Apple-style-span" color="#FF6600">  &lt;/condition&gt;</font></div><div><font class="Apple-style-span" color="#FF6600"><br></font></div><div>&lt;/extension&gt;</div><div><br></div><div><br></div><div>right now the Cash balance for the extension is -192.00 and the extension can still make calls jsut fine. </div>
<div>Am I missing something here ?</div><div><br></div>-- <br>Regards<br><br>Shrouk Khan (Khan)<br><br><br>
</div>