nibblebill never hangs up
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)
This one is a bit tricky, I did some research to figure out whats up. Basically, you can't set the nibble_* vars in the same extension as the call to bridge due to the order in which the module is called. The set happens too late for mod_nibblebill to act on. You have two options: Use inline=true on the set -- this causes the var to be set early enough that mod_nibblebill can act on it or after setting transfer to an extension that does the bridge. Or you can export hte vars and use b-leg nibble billing. but that is another story. On Thu, May 20, 2010 at 5:53 AM, Shrouk Khan <shroukkhan@softverk.is> wrote:
finally in the dial plan :
<extension name="ToIcelandPBX.58d2" > <condition field="destination_number" expression="^(58.*)"> <action application="set" data="$${nibble_account}"/> </condition>
This set is uselss. but it is already set by the directory so... no biggie.
<condition field="destination_number" expression="^(5807)$"> <action application="set" data="nibble_rate=30"/>
This set is evaluated too late for nibblebill to hook the session. Change to: <action application="set" data="nibble_rate=30" inline="true"/>
<action application="bridge" data="sofia/gateway/ToIcelandPBX/$1"/> </condition>
<condition field="destination_number" expression="^(5812)$"> <action application="set" data="nibble_rate=15"/>
same
<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)
-- -Rupa
participants (2)
-
Rupa Schomaker
-
Shrouk Khan