]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
more rate stuff
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 13 Dec 2007 00:43:59 +0000 (00:43 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 13 Dec 2007 00:43:59 +0000 (00:43 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6721 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/formats/mod_local_stream/mod_local_stream.c
src/switch_core_io.c
src/switch_core_session.c
src/switch_core_state_machine.c

index 848e1dcd6af4e13985d2dc17c969bc07af3ebc21..23339b458bb7c4ecd66ccafd57c0f1a04beb0325 100644 (file)
@@ -832,7 +832,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
                        char *reason = NULL;
                        
                        if (switch_channel_test_flag(channel, CF_ANSWERED)) {
-                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Call is already answered, Rejecting with hangup\n");
+                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Call is already answered, Rejecting with hangup\n");
                                switch_channel_hangup(channel, SWITCH_CAUSE_CALL_REJECTED);
                        } else {
 
@@ -858,11 +858,11 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
                                        if (switch_strlen_zero(to_host)) {
                                                to_host = switch_channel_get_variable(channel, "sip_to_host");
                                        }
-                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Challanging call %s\n", to_uri);
+                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Challanging call %s\n", to_uri);
                                        sofia_reg_auth_challange(NULL, tech_pvt->profile, tech_pvt->nh, REG_INVITE, to_host, 0); 
                                        switch_channel_hangup(channel, SWITCH_CAUSE_USER_CHALLENGE);
                                } else {
-                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Rejecting with %d %s\n", code, reason);
+                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Rejecting with %d %s\n", code, reason);
                                        nua_respond(tech_pvt->nh, code, reason, TAG_END());
                                }
                        }
index 6a7f577ce97a515ca6e282451347d650308b4870..3ff169b863051df9a2183240b9517875bee9589c 100644 (file)
@@ -224,7 +224,7 @@ static switch_status_t local_stream_file_open(switch_file_handle_t *handle, cons
        handle->speed = 0;
        handle->private_info = context;
        handle->interval = source->interval;
-       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Opening Stream [%s] %dhz\n", path, handle->samplerate);
+       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Opening Stream [%s] %dhz\n", path, handle->samplerate);
        
        switch_mutex_init(&context->audio_mutex, SWITCH_MUTEX_NESTED, handle->memory_pool);
        if (switch_buffer_create_dynamic(&context->audio_buffer, 512, 1024, 0) != SWITCH_STATUS_SUCCESS) {
index e2ee2b26cab0c87cb2854b09ccdeb563490935bb..bb4a8d9a7e07eb1814f07c874f22e277d7f9b046 100644 (file)
@@ -200,6 +200,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
                                read_frame = &session->raw_read_frame;
                                break;
                        case SWITCH_STATUS_NOOP:
+                               if (session->read_resampler) {
+                                       switch_resample_destroy(&session->read_resampler);
+                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Deactivating read resampler\n");
+                               }
+
                                status = SWITCH_STATUS_SUCCESS;
                                break;
                        case SWITCH_STATUS_BREAK:
@@ -220,7 +225,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
                                goto done;
                        }
                }
-               if (session->read_resampler) {
+               if (session->read_resampler && 0) {
                        short *data = read_frame->data;
 
                        session->read_resampler->from_len = switch_short_to_float(data, session->read_resampler->from, (int) read_frame->datalen / 2);
@@ -518,6 +523,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
                        case SWITCH_STATUS_BREAK:
                                return SWITCH_STATUS_SUCCESS;
                        case SWITCH_STATUS_NOOP:
+                               if (session->write_resampler) {
+                                       switch_resample_destroy(&session->write_resampler);
+                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Deactivating write resampler\n");
+                               }
                                write_frame = frame;
                                status = SWITCH_STATUS_SUCCESS;
                                break;
@@ -742,6 +751,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
                                                                write_frame = &session->enc_write_frame;
                                                                break;
                                                        case SWITCH_STATUS_NOOP:
+                                                               if (session->read_resampler) {
+                                                                       switch_resample_destroy(&session->read_resampler);
+                                                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Deactivating read resampler\n");
+                                                               }
                                                                enc_frame->codec = session->write_codec;
                                                                enc_frame->samples = enc_frame->datalen / sizeof(int16_t);
                                                                enc_frame->timestamp = frame->timestamp;
index f472a157b38a7d5de135c7727151d45a4d1194db..b2c8495612c4b7e24072fdcea76c5dead62913b8 100644 (file)
@@ -684,7 +684,7 @@ static void *SWITCH_THREAD_FUNC switch_core_session_thread(switch_thread_t * thr
        switch_set_flag(session, SSF_DESTROYED);
        switch_core_session_rwunlock(session);
 
-       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Session %"SWITCH_SIZE_T_FMT" (%s) Ended\n",
+       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Session %"SWITCH_SIZE_T_FMT" (%s) Ended\n",
                                          session->id, switch_channel_get_name(session->channel));
        switch_core_session_destroy(&session);
        return NULL;
index d7291fb7e6de2e6746b9cdc8808b790bde945417..d608f78699be3b1ee8ea67114e0fab91519a1412 100644 (file)
@@ -132,7 +132,7 @@ static void switch_core_standard_on_execute(switch_core_session_t *session)
                char *expanded = NULL;
                int nomedia = 0;
                
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Execute %s(%s)\n",
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Execute %s(%s)\n",
                                                  extension->current_application->application_name, switch_str_nil(extension->current_application->application_data));
                if ((application_interface = switch_loadable_module_get_application_interface(extension->current_application->application_name)) == 0) {
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Application %s\n", extension->current_application->application_name);