]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add processing of codec event to pick up on codec changes properly in channels table
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 27 Feb 2013 20:15:44 +0000 (14:15 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 27 Feb 2013 20:15:44 +0000 (14:15 -0600)
src/switch_core_sqldb.c

index c2a1f5cbcf1269a7c67233dfa2861c0ffe2754e0..cdea61ab256896e82cfb8a262a1a58ed2029d887 100644 (file)
@@ -2037,7 +2037,7 @@ static void core_event_handler(switch_event_t *event)
                break;
        case SWITCH_EVENT_CHANNEL_ANSWER:
        case SWITCH_EVENT_CHANNEL_PROGRESS_MEDIA:
-
+       case SWITCH_EVENT_CODEC:
                new_sql() =
                        switch_mprintf
                        ("update channels set read_codec='%q',read_rate='%q',read_bit_rate='%q',write_codec='%q',write_rate='%q',write_bit_rate='%q' where uuid='%q'",
@@ -3280,6 +3280,7 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_
                switch_event_bind("core_db", SWITCH_EVENT_MODULE_UNLOAD, SWITCH_EVENT_SUBCLASS_ANY, core_event_handler, NULL);
                switch_event_bind("core_db", SWITCH_EVENT_CALL_SECURE, SWITCH_EVENT_SUBCLASS_ANY, core_event_handler, NULL);
                switch_event_bind("core_db", SWITCH_EVENT_NAT, SWITCH_EVENT_SUBCLASS_ANY, core_event_handler, NULL);
+               switch_event_bind("core_db", SWITCH_EVENT_CODEC, SWITCH_EVENT_SUBCLASS_ANY, core_event_handler, NULL);
 #endif 
 
                switch_threadattr_create(&thd_attr, sql_manager.memory_pool);