<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>
<configuration name="nibblebill.conf" description="Nibble Billing"><br>
<settings><br>
<!-- See <a href="http://wiki.freeswitch.org/wiki/Mod_nibblebill">http://wiki.freeswitch.org/wiki/Mod_nibblebill</a> for help with these options --><br>
<br>
<!-- Information for connecting to your database --><br>
<param name="db_username" value="root"/><br>
<param name="db_password" value="ViR39dra"/><br>
<param name="db_dsn" value="newfies"/><br>
<variable name="nibble_rate" value="11"/><br>
<variable name="nibble_increment" value="33" /><br>
<br>
<!-- The database table where your CASH column is located --><br>
<param name="db_table" value="accounts"/><br>
<br>
<!-- The column name where we store the value of the account --><br>
<param name="db_column_cash" value="cash"/><br>
<br>
<!-- The column name for the unique ID identifying the account --><br>
<param name="db_column_account" value="id"/><br>
<br>
<!-- field nibble_balance is used for balance info --><br>
<param name="custom_sql_lookup" value="SELECT cash AS nibble_balance FROM accounts WHERE id='${nibble_account}'"/><br>
<br>
<!-- nibble_increment is the amount to update --><br>
<br>
<param name="custom_sql_save" value="UPDATE accounts SET cash=cash-${nibble_increment} WHERE id='${nibble_account}'"/><br>
<br>
<!-- Default heartbeat interval. Set to 'off' for no heartbeat (i.e. bill only at end of call) --><br>
<param name="global_heartbeat" value="30"/><br>
<br>
<!-- By default, warn a caller when their balance is at $5.00. You can set this to a negative number. --><br>
<param name="lowbal_amt" value="5"/><br>
<param name="lowbal_action" value="play ding"/><br>
<br>
<!-- By default, terminate a caller when their balance hits $0.00. You can set this to a negative number. --><br>
<param name="nobal_amt" value="0"/><br>
<param name="nobal_action" value="hangup"/><br>
<br>
<!-- If a call goes beyond a certain dollar amount, flag or terminate it --><br>
<param name="percall_max_amt" value="100"/><br>
<param name="percall_action" value="hangup"/><br>
<br>
</settings><br>
</configuration><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 -> 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 -> 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 -> 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 ->
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='97183008']<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='97183008']<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 ->
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 -> EARLY<br>
2012-07-31 02:31:02.008196 [DEBUG] switch_channel.c:2882 (sofia/external/919718300881) Callstate Change EARLY -> 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='97183008']<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 -> 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 -> 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 -> 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><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>