<div dir="ltr">Hi Team,<br clear="all"><br>I have installed and configure Freeswitch. I want to used Mod_nibblebill
 for realtime billing with freeswitch. I have configure and installed 
freeswtich with Mod_nibblebill but balance is not deducted still. Any 
help will be appreciated....<br>
<br>
/******************************************************************/<br>
&lt;configuration name=&quot;nibblebill.conf&quot; description=&quot;Nibble Billing&quot;&gt;<br>
  &lt;settings&gt;<br>
    &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;<br>
<br>
    &lt;!-- Information for connecting to your database --&gt;<br>
    &lt;param name=&quot;db_username&quot; value=&quot;root&quot;/&gt;<br>
    &lt;param name=&quot;db_password&quot; value=&quot;ViR39dra&quot;/&gt;<br>
    &lt;param name=&quot;db_dsn&quot; value=&quot;newfies&quot;/&gt;<br>
    &lt;variable name=&quot;nibble_rate&quot; value=&quot;11&quot;/&gt;<br>
    &lt;variable name=&quot;nibble_increment&quot; value=&quot;33&quot; /&gt;<br>
<br>
    &lt;!-- The database table where your CASH column is located --&gt;<br>
    &lt;param name=&quot;db_table&quot; value=&quot;accounts&quot;/&gt;<br>
<br>
    &lt;!-- The column name where we store the value of the account --&gt;<br>
    &lt;param name=&quot;db_column_cash&quot; value=&quot;cash&quot;/&gt;<br>
<br>
    &lt;!-- The column name for the unique ID identifying the account --&gt;<br>
    &lt;param name=&quot;db_column_account&quot; value=&quot;id&quot;/&gt;<br>
<br>
    &lt;!--  field nibble_balance is used for balance info --&gt;<br>
    &lt;param name=&quot;custom_sql_lookup&quot; value=&quot;SELECT cash AS nibble_balance FROM accounts WHERE id=&#39;${nibble_account}&#39;&quot;/&gt;<br>
    <br>
    &lt;!-- nibble_increment is the amount to update --&gt;<br>
         <br>
    &lt;param name=&quot;custom_sql_save&quot; value=&quot;UPDATE accounts SET cash=cash-${nibble_increment} WHERE id=&#39;${nibble_account}&#39;&quot;/&gt;<br>
   <br>
    &lt;!-- Default heartbeat interval. Set to &#39;off&#39; for no heartbeat (i.e. bill only at end of call) --&gt;<br>
    &lt;param name=&quot;global_heartbeat&quot; value=&quot;30&quot;/&gt;<br>
<br>
    &lt;!-- By default, warn a caller when their balance is at $5.00. You can set this to a negative number. --&gt;<br>
    &lt;param name=&quot;lowbal_amt&quot; value=&quot;5&quot;/&gt;<br>
    &lt;param name=&quot;lowbal_action&quot; value=&quot;play ding&quot;/&gt;<br>
<br>
    &lt;!-- By default, terminate a caller when their balance hits $0.00. You can set this to a negative number. --&gt;<br>
    &lt;param name=&quot;nobal_amt&quot; value=&quot;0&quot;/&gt;<br>
    &lt;param name=&quot;nobal_action&quot; value=&quot;hangup&quot;/&gt;<br>
<br>
    &lt;!-- If a call goes beyond a certain dollar amount, flag or terminate it --&gt;<br>
    &lt;param name=&quot;percall_max_amt&quot; value=&quot;100&quot;/&gt;<br>
    &lt;param name=&quot;percall_action&quot; value=&quot;hangup&quot;/&gt;<br>
<br>
  &lt;/settings&gt;<br>
&lt;/configuration&gt;<br>
/******************************************************************/  <br>
<br>
<b>FS CLI </b><br><br>
2012-07-31 02:30:02.268212 [DEBUG] switch_ivr_originate.c:1947 Parsing global variables<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_event.c:1519 Parsing variable 
[plivo_request_uuid]=[28a9ae1a-dad9-11e1-b432-00163e908c9f]<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_event.c:1519 Parsing variable 
[plivo_answer_url]=[<a href="http://46.252.152.160:8008/api/v1/answercall/">http://46.252.152.160:8008/api/v1/answercall/</a>]<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_event.c:1519 Parsing variable 
[plivo_hangup_url]=[<a href="http://46.252.152.160:8008/api/v1/hangupcall/">http://46.252.152.160:8008/api/v1/hangupcall/</a>]<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_event.c:1519 Parsing variable [origination_caller_id_number]=[0498722120]<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_event.c:1519 Parsing variable [bridge_early_media]=[true]<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_event.c:1519 Parsing variable [hangup_after_bridge]=[true]<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_event.c:1519 Parsing variable [hangup_after_bridge]=[true]<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_event.c:1519 Parsing variable [nibble_account]=[97183008]<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_event.c:1519 Parsing variable [plivo_from]=[0498722120]<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_event.c:1519 Parsing variable [plivo_to]=[919718300881]<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_event.c:1519 Parsing variable [plivo_app]=[true]<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_event.c:1519 Parsing variable [absolute_codec_string]=[PCMA]<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_event.c:1519 Parsing variable [originate_timeout]=[60]<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_event.c:1519 Parsing variable [ignore_early_media]=[true]<br>
2012-07-31 02:30:02.268212 [NOTICE] switch_channel.c:926 New Channel 
sofia/external/919718300881 [28aa5810-dad9-11e1-b60b-1782e99edc0a]<br>
2012-07-31 02:30:02.268212 [DEBUG] mod_sofia.c:4705 (sofia/external/919718300881) State Change CS_NEW -&gt; CS_INIT<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_core_session.c:1224 Send signal sofia/external/919718300881 [BREAK]<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_core_state_machine.c:385 (sofia/external/919718300881) Running State Change CS_INIT<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_core_state_machine.c:424 (sofia/external/919718300881) State INIT<br>
2012-07-31 02:30:02.268212 [DEBUG] mod_sofia.c:85 sofia/external/919718300881 SOFIA INIT<br>
2012-07-31 02:30:02.268212 [DEBUG] mod_sofia.c:125 (sofia/external/919718300881) State Change CS_INIT -&gt; CS_ROUTING<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_core_session.c:1224 Send signal sofia/external/919718300881 [BREAK]<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_core_state_machine.c:424 (sofia/external/919718300881) State INIT going to sleep<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_core_state_machine.c:385 (sofia/external/919718300881) Running State Change CS_ROUTING<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_channel.c:1919 (sofia/external/919718300881) Callstate Change DOWN -&gt; RINGING<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_core_state_machine.c:433 (sofia/external/919718300881) State ROUTING<br>
2012-07-31 02:30:02.268212 [DEBUG] mod_sofia.c:148 sofia/external/919718300881 SOFIA ROUTING<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_ivr_originate.c:67 
(sofia/external/919718300881) State Change CS_ROUTING -&gt; 
CS_CONSUME_MEDIA<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_core_session.c:1224 Send signal sofia/external/919718300881 [BREAK]<br>
2012-07-31 02:30:02.268212 [DEBUG] mod_nibblebill.c:383 Doing lookup query<br>
[SELECT cash AS nibble_balance FROM accounts WHERE id=&#39;97183008&#39;]<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_core_session.c:919 Send signal sofia/external/919718300881 [BREAK]<br>
2012-07-31 02:30:02.268212 [DEBUG] mod_nibblebill.c:393 Retrieved current balance for account 97183008 (balance = 500.500000)<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_core_state_machine.c:433 (sofia/external/919718300881) State ROUTING going to sleep<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_core_state_machine.c:385 
(sofia/external/919718300881) Running State Change CS_CONSUME_MEDIA<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_core_state_machine.c:452 (sofia/external/919718300881) State CONSUME_MEDIA<br>
2012-07-31 02:30:02.268212 [DEBUG] mod_nibblebill.c:383 Doing lookup query<br>
[SELECT cash AS nibble_balance FROM accounts WHERE id=&#39;97183008&#39;]<br>
2012-07-31 02:30:02.268212 [DEBUG] mod_nibblebill.c:393 Retrieved current balance for account 97183008 (balance = 500.500000)<br>
2012-07-31 02:30:02.268212 [DEBUG] switch_core_state_machine.c:452 
(sofia/external/919718300881) State CONSUME_MEDIA going to sleep<br>
2012-07-31 02:30:02.268212 [DEBUG] sofia.c:5745 Channel sofia/external/919718300881 entering state [calling][0]<br>
2012-07-31 02:30:02.308197 [DEBUG] switch_core_session.c:919 Send signal sofia/external/919718300881 [BREAK]<br>
2012-07-31 02:30:02.308197 [DEBUG] switch_core_session.c:919 Send signal sofia/external/919718300881 [BREAK]<br>
2012-07-31 02:30:02.308197 [DEBUG] sofia.c:5745 Channel sofia/external/919718300881 entering state [calling][0]<br>
2012-07-31 02:30:05.488328 [DEBUG] switch_core_session.c:919 Send signal sofia/external/919718300881 [BREAK]<br>
2012-07-31 02:30:05.488328 [DEBUG] switch_core_session.c:919 Send signal sofia/external/919718300881 [BREAK]<br>
2012-07-31 02:30:05.488328 [DEBUG] sofia.c:5745 Channel sofia/external/919718300881 entering state [proceeding][183]<br>
2012-07-31 02:30:05.488328 [DEBUG] sofia.c:5756 Remote SDP:<br>
v=0<br>
o=root 3607 3607 IN IP4 31.216.132.13<br>
s=session<br>
c=IN IP4 31.216.132.13<br>
t=0 0<br>
m=audio 14460 RTP/AVP 8 101<br>
a=rtpmap:8 PCMA/8000<br>
a=rtpmap:101 telephone-event/8000<br>
a=fmtp:101 0-16<br>
a=silenceSupp:off - - - -<br>
a=ptime:20<br>
<br>
2012-07-31 02:30:05.488328 [DEBUG] sofia_glue.c:4915 Audio Codec Compare [PCMA:8:8000:20:64000]/[PCMA:8:8000:20:64000]<br>
2012-07-31 02:30:05.488328 [DEBUG] sofia_glue.c:2995 Set Codec 
sofia/external/919718300881 PCMA/8000 20 ms 160 samples 64000 bits<br>
2012-07-31 02:30:05.488328 [DEBUG] switch_core_codec.c:111 sofia/external/919718300881 Original read codec set to PCMA:8<br>
2012-07-31 02:30:05.488328 [DEBUG] sofia_glue.c:5029 Set 2833 dtmf send payload to 101<br>
2012-07-31 02:30:05.488328 [DEBUG] sofia_glue.c:3244 AUDIO RTP 
[sofia/external/919718300881] 46.252.152.160 port 20512 -&gt; 
31.216.132.13 port 14460 codec: 8 ms: 20<br>
2012-07-31 02:30:05.488328 [DEBUG] switch_rtp.c:1676 Starting timer [soft] 160 bytes per 20ms<br>
2012-07-31 02:30:05.508186 [DEBUG] sofia_glue.c:3508 Set 2833 dtmf send payload to 101<br>
2012-07-31 02:30:05.508186 [DEBUG] sofia_glue.c:3514 Set 2833 dtmf receive payload to 101<br>
2012-07-31 02:30:05.508186 [DEBUG] sofia_glue.c:3541 sofia/external/919718300881 Set rtp dtmf delay to 40<br>
2012-07-31 02:30:05.508186 [NOTICE] sofia_glue.c:4052 Pre-Answer sofia/external/919718300881!<br>
2012-07-31 02:30:05.508186 [DEBUG] switch_channel.c:3019 (sofia/external/919718300881) Callstate Change RINGING -&gt; EARLY<br>
2012-07-31 02:31:02.008196 [DEBUG] switch_channel.c:2882 (sofia/external/919718300881) Callstate Change EARLY -&gt; HANGUP<br>
2012-07-31 02:31:02.008196 [NOTICE] switch_ivr_originate.c:3246 Hangup 
sofia/external/919718300881 [CS_CONSUME_MEDIA] [NO_ANSWER]<br>
2012-07-31 02:31:02.008196 [DEBUG] switch_channel.c:2905 Send signal sofia/external/919718300881 [KILL]<br>
2012-07-31 02:31:02.008196 [DEBUG] switch_core_session.c:1224 Send signal sofia/external/919718300881 [BREAK]<br>
2012-07-31 02:31:02.008196 [DEBUG] switch_core_state_machine.c:385 (sofia/external/919718300881) Running State Change CS_HANGUP<br>
2012-07-31 02:31:02.008196 [DEBUG] switch_core_state_machine.c:625 (sofia/external/919718300881) State HANGUP<br>
2012-07-31 02:31:02.008196 [DEBUG] mod_sofia.c:469 Channel sofia/external/919718300881 hanging up, cause: NO_ANSWER<br>
2012-07-31 02:31:02.008196 [DEBUG] mod_sofia.c:527 Sending CANCEL to sofia/external/919718300881<br>
2012-07-31 02:31:02.008196 [DEBUG] mod_nibblebill.c:383 Doing lookup query<br>
[SELECT cash AS nibble_balance FROM accounts WHERE id=&#39;97183008&#39;]<br>
2012-07-31 02:31:02.008196 [DEBUG] mod_nibblebill.c:393 Retrieved current balance for account 97183008 (balance = 500.500000)<br>
2012-07-31 02:31:02.008196 [DEBUG] switch_core_state_machine.c:47 sofia/external/919718300881 Standard HANGUP, cause: NO_ANSWER<br>
2012-07-31 02:31:02.008196 [DEBUG] switch_core_state_machine.c:625 (sofia/external/919718300881) State HANGUP going to sleep<br>
2012-07-31 02:31:02.008196 [DEBUG] switch_core_state_machine.c:416 
(sofia/external/919718300881) State Change CS_HANGUP -&gt; CS_REPORTING<br>
2012-07-31 02:31:02.008196 [DEBUG] switch_core_session.c:1224 Send signal sofia/external/919718300881 [BREAK]<br>
2012-07-31 02:31:02.008196 [DEBUG] switch_core_state_machine.c:385 
(sofia/external/919718300881) Running State Change CS_REPORTING<br>
2012-07-31 02:31:02.008196 [DEBUG] switch_core_state_machine.c:685 (sofia/external/919718300881) State REPORTING<br>
2012-07-31 02:31:02.008196 [DEBUG] switch_core_state_machine.c:79 
sofia/external/919718300881 Standard REPORTING, cause: NO_ANSWER<br>
2012-07-31 02:31:02.008196 [DEBUG] switch_core_state_machine.c:685 (sofia/external/919718300881) State REPORTING going to sleep<br>
2012-07-31 02:31:02.008196 [DEBUG] switch_core_state_machine.c:410 
(sofia/external/919718300881) State Change CS_REPORTING -&gt; CS_DESTROY<br>
2012-07-31 02:31:02.008196 [DEBUG] switch_core_session.c:1224 Send signal sofia/external/919718300881 [BREAK]<br>
2012-07-31 02:31:02.008196 [DEBUG] switch_core_session.c:1424 Session 
104 (sofia/external/919718300881) Locked, Waiting on external entities<br>
2012-07-31 02:31:02.008196 [NOTICE] switch_core_session.c:1442 Session 104 (sofia/external/919718300881) Ended<br>
2012-07-31 02:31:02.008196 [NOTICE] switch_core_session.c:1444 Close Channel sofia/external/919718300881 [CS_DESTROY]<br>
2012-07-31 02:31:02.008196 [DEBUG] switch_core_state_machine.c:514 
(sofia/external/919718300881) Callstate Change HANGUP -&gt; DOWN<br>
2012-07-31 02:31:02.008196 [DEBUG] switch_core_state_machine.c:517 (sofia/external/919718300881) Running State Change CS_DESTROY<br>
2012-07-31 02:31:02.008196 [DEBUG] switch_core_state_machine.c:527 (sofia/external/919718300881) State DESTROY<br>
2012-07-31 02:31:02.008196 [DEBUG] mod_sofia.c:374 sofia/external/919718300881 SOFIA DESTROY<br>
2012-07-31 02:31:02.008196 [DEBUG] switch_core_state_machine.c:86 sofia/external/919718300881 Standard DESTROY<br>
2012-07-31 02:31:02.008196 [DEBUG] switch_core_state_machine.c:527 (sofia/external/919718300881) State DESTROY going to sleep<br>
freeswitch@internal&gt;<br>
<br>
-- <br><div dir="ltr"><br>Thanks and regards<br><br> Virendra Bhati<br><span><font color="#888888"><a value="+919718300881">+91-9718300881</a></font></span><br>Asterisk Developer<br>E-mail-: <a href="mailto:virbhati@gmail.com" target="_blank">virbhati@gmail.com</a><br>
Skype id:- virbhati2<br>New Delhi(India)<br></div><br>
</div>