From ded09448aa4ff1c04ad70685c66541a0c953b2f2 Mon Sep 17 00:00:00 2001 From: Brian West Date: Sat, 11 Oct 2008 05:42:52 +0000 Subject: [PATCH] clean up log printfs, my pickyness again git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9957 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_sofia/sofia.c | 18 +++++++++--------- src/mod/endpoints/mod_sofia/sofia_glue.c | 14 +++++++------- src/mod/endpoints/mod_sofia/sofia_presence.c | 2 +- src/mod/endpoints/mod_sofia/sofia_reg.c | 12 ++++++------ 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index d823b54964..75fe1f6d3f 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -595,7 +595,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void SIPTAG_SUPPORTED_STR(supported), SIPTAG_USER_AGENT_STR(profile->user_agent), TAG_END()); } - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "activated db for %s\n", profile->name); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Activated db for %s\n", profile->name); switch_mutex_init(&profile->ireg_mutex, SWITCH_MUTEX_NESTED, profile->pool); switch_mutex_init(&profile->gateway_mutex, SWITCH_MUTEX_NESTED, profile->pool); @@ -642,7 +642,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void su_root_run(profile->s_root); sofia_clear_pflag_locked(profile, PFLAG_RUNNING); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "waiting for worker thread\n"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Waiting for worker thread\n"); while (sofia_test_pflag(profile, PFLAG_WORKER_RUNNING)) { switch_yield(100000); @@ -650,7 +650,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void while (profile->inuse) { switch_yield(5000000); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "waiting for %d session(s)\n", profile->inuse); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Waiting for %d session(s)\n", profile->inuse); if (!sanity--) { break; } @@ -892,7 +892,7 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag) gateway->retry_seconds = atoi(retry_seconds); if (gateway->retry_seconds < 10) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "invalid retry-seconds of %d on gateway %s, using the value of 30 instead.\n", + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid retry-seconds of %d on gateway %s, using the value of 30 instead.\n", gateway->retry_seconds, name); gateway->retry_seconds = 30; } @@ -986,7 +986,7 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile) switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "reconfig", "true"); if (!(xml = switch_xml_open_cfg(cf, &cfg, params))) { - 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); status = SWITCH_STATUS_FALSE; goto done; } @@ -1330,7 +1330,7 @@ switch_status_t config_sofia(int reload, char *profile_name) switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "profile", profile_name); if (!(xml = switch_xml_open_cfg(cf, &cfg, params))) { - 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); status = SWITCH_STATUS_FALSE; goto done; } @@ -1972,10 +1972,10 @@ static void sofia_handle_sip_r_options(switch_core_session_t *session, int statu } gateway->status = SOFIA_GATEWAY_UP; } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "ping failed %s\n", gateway->name); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Ping failed %s\n", gateway->name); gateway->status = SOFIA_GATEWAY_DOWN; if (gateway->state == REG_STATE_REGED) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "unregister %s\n", gateway->name); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Unregister %s\n", gateway->name); gateway->state = REG_STATE_FAILED; } } @@ -2156,7 +2156,7 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status if (sip && sip->sip_call_id && sip->sip_call_id->i_id) callid = sip->sip_call_id->i_id; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "received response to invite with no matching session, destroying callid [%s]!\n", callid); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Received response to invite with no matching session, destroying callid [%s]!\n", callid); if (nh) { if (status == 200) { diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index 0d57bb22b7..91bba930ec 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -464,7 +464,7 @@ switch_status_t sofia_glue_ext_address_lookup(sofia_profile_t *profile, private_ } if (switch_strlen_zero(stun_ip)) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Stun Failed! NO STUN SERVER\n"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "STUN Failed! NO STUN SERVER\n"); goto out; } @@ -481,21 +481,21 @@ switch_status_t sofia_glue_ext_address_lookup(sofia_profile_t *profile, private_ } } if (status != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Stun Failed! %s:%d [%s]\n", stun_ip, stun_port, error); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "STUN Failed! %s:%d [%s]\n", stun_ip, stun_port, error); goto out; } if (!*ip) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Stun Failed! No IP returned\n"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "STUN Failed! No IP returned\n"); goto out; } - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Stun Success [%s]:[%d]\n", *ip, *port); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "STUN Success [%s]:[%d]\n", *ip, *port); status = SWITCH_STATUS_SUCCESS; if (tech_pvt) { if (myport == *port && !strcmp(*ip, tech_pvt->profile->rtpip)) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Stun Not Required ip and port match. [%s]:[%d]\n", *ip, *port); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "STUN Not Required ip and port match. [%s]:[%d]\n", *ip, *port); if (profile->pflags & PFLAG_STUN_AUTO_DISABLE) { profile->pflags &= ~PFLAG_STUN_ENABLED; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Stun completely disabled.\n"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "STUN completely disabled.\n"); } } else { tech_pvt->stun_ip = switch_core_session_strdup(tech_pvt->session, stun_ip); @@ -2203,7 +2203,7 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t * int crypto_tag; if (m->m_proto != sdp_proto_srtp) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "a=crypto in RTP/AVP\n"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "a=crypto in RTP/AVP, refer to rfc3711\n"); match = 0; goto done; } diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index 6180ac7175..386a21732f 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -250,7 +250,7 @@ static void actual_sofia_presence_mwi_event_handler(switch_event_t *event) if ((pname = switch_event_get_header(event, "sofia-profile"))) { if (!(profile = sofia_glue_find_profile(pname))) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "no profile %s\n", pname); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "No profile %s\n", pname); } } diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index c0fa655446..823259a61a 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -92,7 +92,7 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now) switch_core_hash_delete(mod_sofia_globals.gateway_hash, gateway_ptr->name); switch_core_hash_delete(mod_sofia_globals.gateway_hash, gateway_ptr->register_from); switch_core_hash_delete(mod_sofia_globals.gateway_hash, gateway_ptr->register_contact); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "deleted gateway %s\n", gateway_ptr->name); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Deleted gateway %s\n", gateway_ptr->name); } else { last = gateway_ptr; } @@ -127,7 +127,7 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now) gateway_ptr->status = SOFIA_GATEWAY_UP; break; case REG_STATE_REGISTER: - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "registered %s\n", gateway_ptr->name); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Registered %s\n", gateway_ptr->name); if (gateway_ptr->expires > 60) { gateway_ptr->expires = now + (gateway_ptr->freq - 15); } else { @@ -150,7 +150,7 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now) NUTAG_URL(gateway_ptr->register_proxy), SIPTAG_TO_STR(gateway_ptr->register_to), NUTAG_CALLSTATE_REF(ss_state), SIPTAG_FROM_STR(gateway_ptr->register_from), TAG_END()))) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "registering %s\n", gateway_ptr->name); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Registering %s\n", gateway_ptr->name); if (!gateway_ptr->sofia_private) { gateway_ptr->sofia_private = malloc(sizeof(*gateway_ptr->sofia_private)); @@ -732,7 +732,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand } if (auth_res != AUTH_OK && !stale) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "send %s for [%s@%s]\n", forbidden ? "forbidden" : "challenge", to_user, to_host); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Send %s for [%s@%s]\n", forbidden ? "forbidden" : "challenge", to_user, to_host); if (auth_res == AUTH_FORBIDDEN) { nua_respond(nh, SIP_403_FORBIDDEN, NUTAG_WITH_THIS(nua), TAG_END()); } else { @@ -1095,7 +1095,7 @@ void sofia_reg_handle_sip_r_challenge(int status, switch_channel_t *channel = switch_core_session_get_channel(session); if ((tech_pvt = switch_core_session_get_private(session)) && switch_test_flag(tech_pvt, TFLAG_REFER)) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "received reply from refer\n"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Received reply from REFER\n"); goto end; } @@ -1315,7 +1315,7 @@ auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile, sip_authorization_t co if (switch_xml_locate_user("id", switch_strlen_zero(username) ? "nobody" : username, domain_name, ip, &xml, &domain, &user, params) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "can't find user [%s@%s]\n" + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Can't find user [%s@%s]\n" "You must define a domain called '%s' in your directory and add a user with the id=\"%s\" attribute\n" "and you must configure your device to use the proper domain in it's authentication credentials.\n" , username, domain_name, domain_name, username);