]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Attempt to fix limit counter bug
authorMathieu Rene <mrene@avgs.ca>
Wed, 1 Apr 2009 23:28:29 +0000 (23:28 +0000)
committerMathieu Rene <mrene@avgs.ca>
Wed, 1 Apr 2009 23:28:29 +0000 (23:28 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12879 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_limit/mod_limit.c

index fd03ff768982852f55a1c60cdf41e4dd65724873..bde6e7c713ff40ee797a9d761ec930cc6ec93f53 100644 (file)
@@ -315,7 +315,7 @@ static switch_status_t db_state_handler(switch_core_session_t *session)
        switch_channel_state_t state = switch_channel_get_state(channel);
        char *sql = NULL;
 
-       if (state == CS_HANGUP || state == CS_ROUTING) {
+       if (state >= CS_HANGUP || state == CS_ROUTING) {
                sql = switch_mprintf("delete from limit_data where uuid='%q';",
                                                         switch_core_session_get_uuid(session));
                limit_execute_sql(sql, globals.mutex);
@@ -334,7 +334,7 @@ static switch_status_t hash_state_handler(switch_core_session_t *session)
        limit_hash_private_t *pvt = switch_channel_get_private(channel, "limit_hash");
        
        /* The call is either hung up, or is going back into the dialplan, decrement appropriate couters */
-       if (state == CS_HANGUP || state == CS_ROUTING) {        
+       if (state >= CS_HANGUP || state == CS_ROUTING) {        
                switch_hash_index_t *hi;
                switch_mutex_lock(globals.limit_hash_mutex);