提交 2377367d authored 作者: Rupa Schomaker's avatar Rupa Schomaker

FSMOD-40 - handle CS_REPORTING like CS_HANGUP


git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16954 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 f31e90a6
...@@ -484,22 +484,25 @@ static switch_status_t do_billing(switch_core_session_t *session) ...@@ -484,22 +484,25 @@ static switch_status_t do_billing(switch_core_session_t *session)
/* Update the last time we billed */ /* Update the last time we billed */
nibble_data->lastts = ts; nibble_data->lastts = ts;
/* Save this location, but only if the channel/session are not hungup (otherwise, we're done) */ /* Save this location */
if (channel && switch_channel_get_state(channel) != CS_HANGUP) { if (channel) {
switch_channel_set_private(channel, "_nibble_data_", nibble_data); switch_channel_set_private(channel, "_nibble_data_", nibble_data);
/* See if this person has enough money left to continue the call */ /* don't verify ballance and transfer to nobal if we're done with call */
balance = get_balance(billaccount); if (switch_channel_get_state(channel) != CS_REPORTING && switch_channel_get_state(channel) != CS_HANGUP) {
if (balance <= nobal_amt) { /* See if this person has enough money left to continue the call */
/* Not enough money - reroute call to nobal location */ balance = get_balance(billaccount);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Balance of %f fell below allowed amount of %f! (Account %s)\n", if (balance <= nobal_amt) {
balance, nobal_amt, billaccount); /* Not enough money - reroute call to nobal location */
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "Balance of %f fell below allowed amount of %f! (Account %s)\n",
/* IMPORTANT: Billing must be paused before the transfer occurs! This prevents infinite loops, since the transfer will result */ balance, nobal_amt, billaccount);
/* in nibblebill checking the call again in the routing process for an allowed balance! */
/* If you intend to give the user the option to re-up their balance, you must clear & resume billing once the balance is updated! */ /* IMPORTANT: Billing must be paused before the transfer occurs! This prevents infinite loops, since the transfer will result */
nibblebill_pause(session); /* in nibblebill checking the call again in the routing process for an allowed balance! */
transfer_call(session, globals.nobal_action); /* If you intend to give the user the option to re-up their balance, you must clear & resume billing once the balance is updated! */
nibblebill_pause(session);
transfer_call(session, globals.nobal_action);
}
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论