write different channel variables per realm_id

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11608 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Mathieu Rene 2009-02-03 03:46:53 +00:00
parent d0490570ad
commit f8d0521b65
1 changed files with 11 additions and 3 deletions

View File

@ -938,8 +938,16 @@ SWITCH_STANDARD_APP(limit_hash_function)
} }
/* Save current usage & rate into channel variables so it can be used later in the dialplan, or added to CDR records */ /* Save current usage & rate into channel variables so it can be used later in the dialplan, or added to CDR records */
switch_channel_set_variable(channel, "limit_usage", switch_core_session_sprintf(session, "%d", item->total_usage)); {
switch_channel_set_variable(channel, "limit_rate", switch_core_session_sprintf(session, "%d", item->rate_usage)); const char *susage = switch_core_session_sprintf(session, "%d", item->total_usage);
const char *srate = switch_core_session_sprintf(session, "%d", item->rate_usage);
switch_channel_set_variable(channel, "limit_usage", susage);
switch_channel_set_variable(channel, switch_core_session_sprintf(session, "limit_usage_%s", hashkey), susage);
switch_channel_set_variable(channel, "limit_rate", srate);
switch_channel_set_variable(channel, switch_core_session_sprintf(session, "limit_rate_%s", hashkey), srate);
}
if (!pvt->have_state_handler) { if (!pvt->have_state_handler) {
switch_core_event_hook_add_state_change(session, hash_state_handler); switch_core_event_hook_add_state_change(session, hash_state_handler);