]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
more cleanup polishing things along
authorBrian West <brian@freeswitch.org>
Sat, 11 Oct 2008 05:44:11 +0000 (05:44 +0000)
committerBrian West <brian@freeswitch.org>
Sat, 11 Oct 2008 05:44:11 +0000 (05:44 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9958 d0543943-73ff-0310-b7d9-9358b9ac24b2

12 files changed:
src/switch_console.c
src/switch_core_asr.c
src/switch_core_codec.c
src/switch_core_directory.c
src/switch_core_file.c
src/switch_core_io.c
src/switch_core_session.c
src/switch_core_speech.c
src/switch_ivr_play_say.c
src/switch_rtp.c
src/switch_utils.c
src/switch_xml.c

index 1fdbbecf5cb655316aa86d981b6803f3b0899ccd..ca26ff52a9fb00e2b80261b05c91022e001beb8b 100644 (file)
@@ -61,7 +61,7 @@ static switch_status_t console_xml_config(void)
        }
 
        if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) {
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", cf);
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of %s failed\n", cf);
                return SWITCH_STATUS_TERM;
        }
 
@@ -71,7 +71,7 @@ static switch_status_t console_xml_config(void)
                        char *val = (char *) switch_xml_attr_soft(param, "value");
                        int i = atoi(var);
                        if ((i < 1) || (i > 12)) {
-                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "keybind %s is invalid, range is from 1 to 12\n", var);
+                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Keybind %s is invalid, range is from 1 to 12\n", var);
                        } else {
                                /* Add the command to the fnkey array */
                                console_fnkeys[i - 1] = switch_core_permanent_strdup(val);
index 5cb94de3113414e39cf3588b763a26d1dc4f6937..fbe13d0801a45aa426ce96e8ef34f83a91630455 100644 (file)
@@ -54,7 +54,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_asr_open(switch_asr_handle_t *ah,
        switch_assert(ah != NULL);
 
        if ((ah->asr_interface = switch_loadable_module_get_asr_interface(module_name)) == 0) {
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "invalid asr module [%s]!\n", module_name);
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid ASR module [%s]!\n", module_name);
                return SWITCH_STATUS_GENERR;
        }
 
index 176d1613773ccc33a90b83d7f68bdff53d2286c8..d727d2526ffca0412bf95106fecbafe9551120d0 100644 (file)
@@ -297,7 +297,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_init(switch_codec_t *codec, co
        }
 
        if ((codec_interface = switch_loadable_module_get_codec_interface(codec_name)) == 0) {
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "invalid codec %s!\n", codec_name);
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid codec %s!\n", codec_name);
                return SWITCH_STATUS_GENERR;
        }
 
index 0f06ce4f7d80f83c35c758e0a922cb88e21c55d8..3eedf4b2313ef75e435fc851253e228a0c9b4d98 100644 (file)
@@ -41,7 +41,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_directory_open(switch_directory_hand
        switch_status_t status;
 
        if ((dh->directory_interface = switch_loadable_module_get_directory_interface(module_name)) == 0) {
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "invalid directory module [%s]!\n", module_name);
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid directory module [%s]!\n", module_name);
                return SWITCH_STATUS_GENERR;
        }
 
index f7543b3a517354b4ab93d6a379c4f36c9372878d..7afb01099c46f084f92d2b1ea1bad6cc498bcfa3 100644 (file)
@@ -63,7 +63,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_file_open(const char *file,
        }
 
        if ((fh->file_interface = switch_loadable_module_get_file_interface(ext)) == 0) {
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "invalid file format [%s] for [%s]!\n", ext, file_path);
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid file format [%s] for [%s]!\n", ext, file_path);
                return SWITCH_STATUS_GENERR;
        }
 
index c72e8636f58f60e9afefae2c156b8dfd0adb418d..75f6bd6ddd21d4a5a140c88dae6b33f0b98e923d 100644 (file)
@@ -415,7 +415,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
 
                                switch (status) {
                                case SWITCH_STATUS_RESAMPLE:
-                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "fixme 1\n");
+                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Fixme 1\n");
                                case SWITCH_STATUS_SUCCESS:
                                        session->enc_read_frame.samples = session->read_codec->implementation->bytes_per_frame / sizeof(int16_t);
                                        if (perfect) {
@@ -777,7 +777,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
 
                                switch (status) {
                                case SWITCH_STATUS_RESAMPLE:
-                                       /* switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "fixme 2\n"); */
+                                       /* switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Fixme 2\n"); */
                                case SWITCH_STATUS_SUCCESS:
                                        session->enc_write_frame.codec = session->write_codec;
                                        session->enc_write_frame.samples = enc_frame->datalen / sizeof(int16_t);
index fd757e966b15cf60784652edaa2256438e3b6ebd..389a4fe7423c096464f43ae75d4d27dd3b327b9b 100644 (file)
@@ -309,7 +309,7 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
        }
 
        if (!*new_session) {
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "outgoing method for endpoint: [%s] returned: [%s] but there is no new session!\n",
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Outgoing method for endpoint: [%s] returned: [%s] but there is no new session!\n",
                                                  endpoint_name, switch_channel_cause2str(cause));
                return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
        } else {
index 3d4f58c077ff83ef5409ee4f9c8fa24d18248121..d533182e63b6816b843b4d5136fb230d54f413ef 100644 (file)
@@ -57,7 +57,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_speech_open(switch_speech_handle_t *
        }
 
        if ((sh->speech_interface = switch_loadable_module_get_speech_interface(module_name)) == 0) {
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "invalid speech module [%s]!\n", module_name);
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid speech module [%s]!\n", module_name);
                return SWITCH_STATUS_GENERR;
        }
 
index 4ac4f05b8acc72fe0a5d4b7c611c77edfde38c7c..6ed81811520582fb5db201165fbe21a4ed8ef131 100644 (file)
@@ -134,17 +134,17 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
        switch_channel_event_set_data(channel, hint_data);
 
        if (switch_xml_locate("phrases", NULL, NULL, NULL, &xml, &cfg, hint_data) != SWITCH_STATUS_SUCCESS) {
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of phrases failed.\n");
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of phrases failed.\n");
                goto done;
        }
 
        if (!(macros = switch_xml_child(cfg, "macros"))) {
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "can't find macros tag.\n");
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't find macros tag.\n");
                goto done;
        }
 
        if (!(language = switch_xml_child(macros, "language"))) {
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "can't find language tag.\n");
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't find language tag.\n");
                goto done;
        }
 
@@ -161,7 +161,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
        }
 
        if (!language) {
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "can't find language %s.\n", chan_lang);
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't find language %s.\n", chan_lang);
                goto done;
        }
 
@@ -186,7 +186,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
        }
        
        if (!(macro = switch_xml_child(language, "macro"))) {
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "can't find any macro tags.\n");
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't find any macro tags.\n");
                goto done;
        }
 
@@ -198,7 +198,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
        }
 
        if (!macro) {
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "can't find macro %s.\n", macro_name);
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't find macro %s.\n", macro_name);
                goto done;
        }
 
@@ -210,7 +210,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
        }
 
        if (!(input = switch_xml_child(macro, "input"))) {
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "can't find any input tags.\n");
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't find any input tags.\n");
                goto done;
        }
 
@@ -356,7 +356,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
        }
 
        if (!matches) {
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "macro [%s] did not match any patterns\n", macro_name);
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Macro [%s] did not match any patterns\n", macro_name);
        }
 
        if (old_sound_prefix) {
@@ -907,7 +907,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
        if (!fh->audio_buffer) {
                switch_buffer_create_dynamic(&fh->audio_buffer, FILE_BLOCKSIZE, FILE_BUFSIZE, 0);
                if (!fh->audio_buffer) {
-                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "setup buffer failed\n");
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Setup buffer failed\n");
 
                        switch_core_file_close(fh);
                        switch_core_session_reset(session, SWITCH_TRUE);
@@ -950,14 +950,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
 
                len = samples * 2;
                if (switch_core_timer_init(&timer, timer_name, interval, samples, pool) != SWITCH_STATUS_SUCCESS) {
-                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "setup timer failed!\n");
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Setup timer failed!\n");
                        switch_core_codec_destroy(&codec);
                        switch_core_file_close(fh);
                        switch_core_session_reset(session, SWITCH_TRUE);
                        status = SWITCH_STATUS_GENERR;
                        goto end;
                }
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "setup timer success %u bytes per %d ms!\n", len, interval);
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Setup timer success %u bytes per %d ms!\n", len, interval);
        }
        write_frame.rate = fh->samplerate;
 
@@ -1935,7 +1935,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text(switch_core_session_t *ses
        if (timer_name) {
                if (need_create) {
                        if (switch_core_timer_init(timer, timer_name, interval, (int) sh->samples, pool) != SWITCH_STATUS_SUCCESS) {
-                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "setup timer failed!\n");
+                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Setup timer failed!\n");
                                switch_core_codec_destroy(write_frame.codec);
                                flags = 0;
                                switch_core_speech_close(sh, &flags);
@@ -1945,7 +1945,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text(switch_core_session_t *ses
                                }
                                return SWITCH_STATUS_GENERR;
                        }
-                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "setup timer success %u bytes per %d ms!\n", sh->samples * 2, interval);
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Setup timer success %u bytes per %d ms!\n", sh->samples * 2, interval);
                }
                /* start a thread to absorb incoming audio */
                switch_core_service_session(session, &thread_session, 0);
index 9833dda7a6fda2107067b08adbba6974ead0c695..673816fa1c793cb9023d5a1fccad03cda00b61da 100644 (file)
@@ -740,7 +740,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_sess
                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Activating Secure RTP SEND\n");
                                switch_set_flag(rtp_session, SWITCH_RTP_FLAG_SECURE_SEND);
                        } else {
-                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error allocating srtp [%d]\n", stat);
+                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error allocating SRTP [%d]\n", stat);
                                return status;
                        }
                }
@@ -1426,7 +1426,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
                        if (stat && rtp_session->recv_msg.header.pt != rtp_session->te && rtp_session->recv_msg.header.pt != rtp_session->cng_pt) {
                                if (++rtp_session->srtp_errs >= MAX_SRTP_ERRS) {
                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
-                                                                         "error: srtp unprotect failed with code %d%s\n", stat,
+                                                                         "Error: SRTP unprotect failed with code %d%s\n", stat,
                                                                          stat == err_status_replay_fail ? " (replay check failed)" : stat ==
                                                                          err_status_auth_fail ? " (auth check failed)" : "");
                                        ret = -1;
@@ -1948,7 +1948,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
 
                        stat = srtp_protect(rtp_session->send_ctx, &send_msg->header, &sbytes);
                        if (stat) {
-                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error: srtp protection failed with code %d\n", stat);
+                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error: SRTP protection failed with code %d\n", stat);
                        }
 
                        bytes = sbytes;
@@ -2141,7 +2141,7 @@ SWITCH_DECLARE(int) switch_rtp_write_manual(switch_rtp_t *rtp_session,
 
                stat = srtp_protect(rtp_session->send_ctx, &rtp_session->write_msg.header, &sbytes);
                if (stat) {
-                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error: srtp protection failed with code %d\n", stat);
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error: SRTP protection failed with code %d\n", stat);
                }
                bytes = sbytes;
        }
index 4d4f5d821de1108815b64945c86e28140648b584..dfced8df5becf6aee0aaf5b2b1673b4773f7c9e1 100644 (file)
@@ -484,7 +484,7 @@ SWITCH_DECLARE(switch_bool_t) switch_simple_email(const char *to, const char *fr
        }
 
        if (unlink(filename) != 0) {
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "failed to delete file [%s]\n", filename);
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Failed to delete file [%s]\n", filename);
        }
 
        if (file) {
index 6de65d1ff5c7cda5da107007fb497b0000c70f2e..523b2e3f05c8a0fe7fa3af3bdf0512631c6f7666 100644 (file)
@@ -1945,7 +1945,7 @@ SWITCH_DECLARE(void) switch_xml_free(switch_xml_t xml)
        if (xml->free_path) {
                if (!switch_stristr("freeswitch.xml.fsxml", xml->free_path)) {
                        if (unlink(xml->free_path) != 0) {
-                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "failed to delete file [%s]\n", xml->free_path);
+                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Failed to delete file [%s]\n", xml->free_path);
                        }
                }
                switch_safe_free(xml->free_path);