From ade490584600be4715ea7a6fd93ba9fbcdce5be8 Mon Sep 17 00:00:00 2001 From: Henning Westerholt Date: Wed, 10 Jun 2020 11:50:51 +0000 Subject: [PATCH] ims_charging: fix missing line-breaks for log messages (cherry picked from commit 508786fcdbbc120215b3e7dd90d92ab40c3b1e4e) --- src/modules/ims_charging/ccr.c | 2 +- src/modules/ims_charging/dialog.c | 6 +++--- src/modules/ims_charging/diameter_ro.c | 2 +- src/modules/ims_charging/ims_charging_mod.c | 8 ++++---- src/modules/ims_charging/ims_ro.c | 22 ++++++++++----------- src/modules/ims_charging/ro_db_handler.c | 2 +- src/modules/ims_charging/ro_session_hash.c | 4 ++-- src/modules/ims_charging/ro_session_hash.h | 4 ++-- src/modules/ims_charging/ro_timer.c | 22 ++++++++++----------- 9 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/modules/ims_charging/ccr.c b/src/modules/ims_charging/ccr.c index d15d0a43a13..0c1d069b14f 100644 --- a/src/modules/ims_charging/ccr.c +++ b/src/modules/ims_charging/ccr.c @@ -300,7 +300,7 @@ Ro_CCA_t *Ro_parse_CCA_avps(AAAMessage *cca) { mscc_avp_list_ptr = &mscc_avp_list; AAA_AVP *mscc_avp = mscc_avp_list_ptr->head; while (mscc_avp != NULL) { - LM_DBG("MSCC AVP code is [%i] and data length is [%i]", mscc_avp->code, mscc_avp->data.len); + LM_DBG("MSCC AVP code is [%i] and data length is [%i]\n", mscc_avp->code, mscc_avp->data.len); switch (mscc_avp->code) { AAA_AVP_LIST y; AAA_AVP *z; diff --git a/src/modules/ims_charging/dialog.c b/src/modules/ims_charging/dialog.c index fdbaafe663b..a91ebdbe99d 100644 --- a/src/modules/ims_charging/dialog.c +++ b/src/modules/ims_charging/dialog.c @@ -58,7 +58,7 @@ void dlg_answered(struct dlg_cell *dlg, int type, struct dlg_cb_params *_params) ro_session_lock(ro_session_table, ro_session_entry); if (session->active) { - LM_CRIT("Why the heck am i receiving a double confirmation of the dialog? Ignoring... "); + LM_CRIT("Why the heck am i receiving a double confirmation of the dialog? Ignoring...\n"); ro_session_unlock(ro_session_table, ro_session_entry); return; } else if (session->active < 0) { //session has already been terminated - we can't reactivate... @@ -152,7 +152,7 @@ void dlg_terminated(struct dlg_cell *dlg, int type, unsigned int termcode, char* s_reason = h->body; } } else if (_params->rpl) { - LM_DBG("Reply is [%d - %.*s]", _params->rpl->first_line.u.reply.statuscode, _params->rpl->first_line.u.reply.reason.len, _params->rpl->first_line.u.reply.reason.s); + LM_DBG("Reply is [%d - %.*s]\n", _params->rpl->first_line.u.reply.statuscode, _params->rpl->first_line.u.reply.reason.len, _params->rpl->first_line.u.reply.reason.s); } ro_session = (struct ro_session*)*_params->param; @@ -182,7 +182,7 @@ void dlg_terminated(struct dlg_cell *dlg, int type, unsigned int termcode, char* //If however, the call was never answered, then we can continue as normal ro_session_lock(ro_session_table, ro_session_entry); - LM_DBG("processing dlg_terminated in Ro and session [%.*s] has active = %d", ro_session->ro_session_id.len, ro_session->ro_session_id.s, ro_session->active); + LM_DBG("processing dlg_terminated in Ro and session [%.*s] has active = %d\n", ro_session->ro_session_id.len, ro_session->ro_session_id.s, ro_session->active); if ((!ro_session->active && (ro_session->start_time != 0)) || (ro_session->ccr_sent == 1)) { unref_ro_session(ro_session,1,0); LM_DBG("CCR already sent or Ro Session is not active, but may have been answered [%d]\n", (int)ro_session->start_time); diff --git a/src/modules/ims_charging/diameter_ro.c b/src/modules/ims_charging/diameter_ro.c index 52a3e1d1ede..2be575a4712 100644 --- a/src/modules/ims_charging/diameter_ro.c +++ b/src/modules/ims_charging/diameter_ro.c @@ -31,7 +31,7 @@ void RoChargingResponseHandler(AAAMessage *response, void *param) { LM_ERR("DBG:"M_NAME":RoChargingResponseHandler(): - Received unknown response for app %d command %d\n", response->applicationId, response->commandCode); - LM_ERR("Response is [%s]", response->buf.s); + LM_ERR("Response is [%s]\n", response->buf.s); return; } diff --git a/src/modules/ims_charging/ims_charging_mod.c b/src/modules/ims_charging/ims_charging_mod.c index 5fabde67144..fd65f986835 100644 --- a/src/modules/ims_charging/ims_charging_mod.c +++ b/src/modules/ims_charging/ims_charging_mod.c @@ -502,7 +502,7 @@ static int w_ro_ccr(struct sip_msg *msg, char* c_route_name, char* c_direction, if (msg->first_line.type != SIP_REQUEST) { - LM_ERR("Ro_CCR() called from SIP reply."); + LM_ERR("Ro_CCR() called from SIP reply.\n"); return RO_RETURN_ERROR;; } @@ -519,12 +519,12 @@ static int w_ro_ccr(struct sip_msg *msg, char* c_route_name, char* c_direction, if (dir == RO_ORIG_DIRECTION) { //get caller IMPU from asserted identity if ((identity = cscf_get_asserted_identity(msg, 0)).len == 0) { - LM_DBG("No P-Asserted-Identity hdr found. Using From hdr for asserted_identity"); + LM_DBG("No P-Asserted-Identity hdr found. Using From hdr for asserted_identity\n"); identity = dlg->from_uri; } //get caller contact from contact header - if not present then skip this if ((contact = cscf_get_contact(msg)).len == 0) { - LM_WARN("Can not get contact from message - will not get callbacks if this IMPU is removed to terminate call"); + LM_WARN("Can not get contact from message - will not get callbacks if this IMPU is removed to terminate call\n"); goto send_ccr; } @@ -532,7 +532,7 @@ static int w_ro_ccr(struct sip_msg *msg, char* c_route_name, char* c_direction, } else if (dir == RO_TERM_DIRECTION){ //get callee IMPU from called part id - if not present then skip this if ((identity = cscf_get_public_identity_from_called_party_id(msg, &h)).len == 0) { - LM_DBG("No P-Called-Identity hdr found - will not get callbacks if this IMPU is removed to terminate call"); + LM_DBG("No P-Called-Identity hdr found - will not get callbacks if this IMPU is removed to terminate call\n"); goto send_ccr; } //get callee contact from request URI diff --git a/src/modules/ims_charging/ims_ro.c b/src/modules/ims_charging/ims_ro.c index b78016b99a9..700178a0add 100644 --- a/src/modules/ims_charging/ims_ro.c +++ b/src/modules/ims_charging/ims_ro.c @@ -380,10 +380,10 @@ int get_sip_header_info(struct sip_msg * req, if (get_custom_user(req, asserted_id_uri) == -1) { if ((*asserted_id_uri = cscf_get_asserted_identity(req, 0)).len == 0) { - LM_DBG("No P-Asserted-Identity hdr found. Using From hdr"); + LM_DBG("No P-Asserted-Identity hdr found. Using From hdr\n"); if (!cscf_get_from_uri(req, asserted_id_uri)) { - LM_ERR("Error assigning P-Asserted-Identity using From hdr"); + LM_ERR("Error assigning P-Asserted-Identity using From hdr\n"); goto error; } } @@ -739,7 +739,7 @@ static void resume_on_interim_ccr(int is_timeout, void *param, AAAMessage *cca, } if (ro_cca_data->resultcode != 2001) { - LM_ERR("Got bad CCA result code [%d] - reservation failed", ro_cca_data->resultcode); + LM_ERR("Got bad CCA result code [%d] - reservation failed\n", ro_cca_data->resultcode); error_or_timeout = 1; goto error; } else { @@ -1073,7 +1073,7 @@ int Ro_Send_CCR(struct sip_msg *msg, struct dlg_cell *dlg, int dir, int reservat //getting asserted identity if (get_custom_user(msg, &asserted_identity) == -1) { if ((asserted_identity = cscf_get_asserted_identity(msg, 0)).len == 0) { - LM_DBG("No P-Asserted-Identity hdr found. Using From hdr for asserted_identity"); + LM_DBG("No P-Asserted-Identity hdr found. Using From hdr for asserted_identity\n"); asserted_identity = dlg->from_uri; if (asserted_identity.len > 0 && asserted_identity.s) { p=(char*)memchr(asserted_identity.s, ';',asserted_identity.len); @@ -1085,7 +1085,7 @@ int Ro_Send_CCR(struct sip_msg *msg, struct dlg_cell *dlg, int dir, int reservat //getting called asserted identity if ((called_asserted_identity = cscf_get_public_identity_from_called_party_id(msg, &h)).len == 0) { - LM_DBG("No P-Called-Identity hdr found. Using request URI for called_asserted_identity"); + LM_DBG("No P-Called-Identity hdr found. Using request URI for called_asserted_identity\n"); called_asserted_identity = cscf_get_public_identity_from_requri(msg); free_called_asserted_identity = 1; } @@ -1113,11 +1113,11 @@ int Ro_Send_CCR(struct sip_msg *msg, struct dlg_cell *dlg, int dir, int reservat str mac = {0, 0}; if (get_mac_avp_value(msg, &mac) != 0) - LM_DBG(RO_MAC_AVP_NAME" was not set. Using default."); + LM_DBG(RO_MAC_AVP_NAME" was not set. Using default.\n"); //by default we use voice service id and rate group //then we check SDP - if we find video then we use video service id and rate group - LM_DBG("Setting default SID to %d and RG to %d for voice", + LM_DBG("Setting default SID to %d and RG to %d for voice\n", voice_service_identifier, voice_rating_group); active_service_identifier = voice_service_identifier; active_rating_group = voice_rating_group; @@ -1141,7 +1141,7 @@ int Ro_Send_CCR(struct sip_msg *msg, struct dlg_cell *dlg, int dir, int reservat int intportA = atoi(msg_sdp_stream->port.s); if (intportA != 0 && strncasecmp(msg_sdp_stream->media.s, "video", 5) == 0) { - LM_DBG("This SDP has a video component and src ports not equal to 0 - so we set default SID to %d and RG to %d for video", + LM_DBG("This SDP has a video component and src ports not equal to 0 - so we set default SID to %d and RG to %d for video\n", video_service_identifier, video_rating_group); active_service_identifier = video_service_identifier; active_rating_group = video_rating_group; @@ -1342,7 +1342,7 @@ static void resume_on_initial_ccr(int is_timeout, void *param, AAAMessage *cca, if (fui_action == AVP_Final_Unit_Action_Redirect) { if (ro_cca_data->mscc->final_unit_action->redirect_server) { - LM_DBG("FUI with action: [%d]", ro_cca_data->mscc->final_unit_action->action); + LM_DBG("FUI with action: [%d]\n", ro_cca_data->mscc->final_unit_action->action); if (ro_cca_data->mscc->final_unit_action->action == AVP_Final_Unit_Action_Redirect) { LM_DBG("Have REDIRECT action with address type of [%d]\n", ro_cca_data->mscc->final_unit_action->redirect_server->address_type); @@ -1376,7 +1376,7 @@ static void resume_on_initial_ccr(int is_timeout, void *param, AAAMessage *cca, ro_cca_data->mscc->validity_time); if (ro_cca_data->mscc->granted_service_unit->cc_time <= 0) { - LM_DBG("got zero GSU.... reservation failed"); + LM_DBG("got zero GSU.... reservation failed\n"); error_code = RO_RETURN_FALSE; goto error1; } @@ -1482,7 +1482,7 @@ static int create_cca_return_code(int result) { if (result >= 0) break; - LM_ERR("Unknown result code: %d", result); + LM_ERR("Unknown result code: %d\n", result); avp_val.s.s = "??"; } diff --git a/src/modules/ims_charging/ro_db_handler.c b/src/modules/ims_charging/ro_db_handler.c index 4eac7228adc..ed5fdb7c3d2 100644 --- a/src/modules/ims_charging/ro_db_handler.c +++ b/src/modules/ims_charging/ro_db_handler.c @@ -120,7 +120,7 @@ int init_ro_db(const str *db_url, int dlg_hash_size, int db_update_period, int f } int load_ro_info_from_db(int hash_size, int fetch_num_rows) { - LM_WARN("not supported yet"); + LM_WARN("not supported yet\n"); return 0; } diff --git a/src/modules/ims_charging/ro_session_hash.c b/src/modules/ims_charging/ro_session_hash.c index e6ad04ac34f..0d5740d9406 100644 --- a/src/modules/ims_charging/ro_session_hash.c +++ b/src/modules/ims_charging/ro_session_hash.c @@ -22,7 +22,7 @@ struct ro_session_table *ro_session_table = 0; void link_ro_session(struct ro_session *ro_session, int n) { struct ro_session_entry *ro_session_entry; - LM_DBG("Linking Ro session [%.*s] into entries hash index [%d]", ro_session->ro_session_id.len, ro_session->ro_session_id.s, ro_session->h_entry); + LM_DBG("Linking Ro session [%.*s] into entries hash index [%d]\n", ro_session->ro_session_id.len, ro_session->ro_session_id.s, ro_session->h_entry); ro_session_entry = &(ro_session_table->entries[ro_session->h_entry]); @@ -197,7 +197,7 @@ void destroy_dlg_table(void) { struct ro_session* build_new_ro_session(int direction, int auth_appid, int auth_session_type, str *session_id, str *callid, str *asserted_identity, str* called_asserted_identity, str* mac, unsigned int dlg_h_entry, unsigned int dlg_h_id, unsigned int requested_secs, unsigned int validity_timeout, int active_rating_group, int active_service_identifier, str *incoming_trunk_id, str *outgoing_trunk_id, str *pani){ - LM_DBG("Building Ro Session **********"); + LM_DBG("Building Ro Session **********\n"); char *p; unsigned int len = /*session_id->len + */callid->len + asserted_identity->len + called_asserted_identity->len + mac->len + incoming_trunk_id->len + outgoing_trunk_id->len + pani->len + sizeof (struct ro_session); diff --git a/src/modules/ims_charging/ro_session_hash.h b/src/modules/ims_charging/ro_session_hash.h index 556d11d849b..f74496cb24a 100644 --- a/src/modules/ims_charging/ro_session_hash.h +++ b/src/modules/ims_charging/ro_session_hash.h @@ -109,7 +109,7 @@ extern struct ro_session_table *ro_session_table; * \param _entry locked entry */ #define ro_session_lock(_table, _entry) \ - { LM_DBG("LOCKING %d", (_entry)->lock_idx); lock_set_get( (_table)->locks, (_entry)->lock_idx); LM_DBG("LOCKED %d", (_entry)->lock_idx);} + { LM_DBG("LOCKING %d\n", (_entry)->lock_idx); lock_set_get( (_table)->locks, (_entry)->lock_idx); LM_DBG("LOCKED %d\n", (_entry)->lock_idx);} /*! @@ -118,7 +118,7 @@ extern struct ro_session_table *ro_session_table; * \param _entry locked entry */ #define ro_session_unlock(_table, _entry) \ - { LM_DBG("UNLOCKING %d", (_entry)->lock_idx); lock_set_release( (_table)->locks, (_entry)->lock_idx); LM_DBG("UNLOCKED %d", (_entry)->lock_idx); } + { LM_DBG("UNLOCKING %d\n", (_entry)->lock_idx); lock_set_release( (_table)->locks, (_entry)->lock_idx); LM_DBG("UNLOCKED %d\n", (_entry)->lock_idx); } /*! * \brief Reference an ro_session without locking diff --git a/src/modules/ims_charging/ro_timer.c b/src/modules/ims_charging/ro_timer.c index 38af8cbdca3..80e498422c6 100644 --- a/src/modules/ims_charging/ro_timer.c +++ b/src/modules/ims_charging/ro_timer.c @@ -98,12 +98,12 @@ static inline void insert_ro_timer_unsafe(struct ro_tl *tl) { } LM_DBG("inserting %p for %d\n", tl, tl->timeout); - LM_DBG("BEFORE ptr [%p], ptr->next [%p], ptr->next->prev [%p]", ptr, ptr->next, ptr->next->prev); + LM_DBG("BEFORE ptr [%p], ptr->next [%p], ptr->next->prev [%p]\n", ptr, ptr->next, ptr->next->prev); tl->prev = ptr; tl->next = ptr->next; tl->prev->next = tl; tl->next->prev = tl; - LM_DBG("AFTER tl->prev [%p], tl->next [%p]", tl->prev, tl->next); + LM_DBG("AFTER tl->prev [%p], tl->next [%p]\n", tl->prev, tl->next); } /*! @@ -126,7 +126,7 @@ int insert_ro_timer(struct ro_tl *tl, int interval) { insert_ro_timer_unsafe(tl); - LM_DBG("TIMER inserted"); + LM_DBG("TIMER inserted\n"); lock_release(roi_timer->lock); return 0; @@ -249,7 +249,7 @@ static inline struct ro_tl* get_expired_ro_sessions(unsigned int time) { void ro_timer_routine(unsigned int ticks, void * attr) { struct ro_tl *tl, *ctl; - LM_DBG("getting expired ro-sessions"); + LM_DBG("getting expired ro-sessions\n"); tl = get_expired_ro_sessions(ticks); @@ -275,7 +275,7 @@ void resume_ro_session_ontimeout(struct interim_ccr *i_req, int timeout_or_error ro_session_entry = &(ro_session_table->entries[i_req->ro_session->h_entry]); ro_session_lock(ro_session_table, ro_session_entry); - LM_DBG("credit=%d credit_valid_for=%d", i_req->new_credit, i_req->credit_valid_for); + LM_DBG("credit=%d credit_valid_for=%d\n", i_req->new_credit, i_req->credit_valid_for); used_secs = rint((now - ((timeout_or_error==1 && i_req->ro_session->last_event_timestamp_backup>0)?i_req->ro_session->last_event_timestamp_backup : i_req->ro_session->last_event_timestamp)) / (float) 1000000); @@ -353,7 +353,7 @@ void resume_ro_session_ontimeout(struct interim_ccr *i_req, int timeout_or_error dlgb.lookup_terminate_dlg(i_req->ro_session->dlg_h_entry, i_req->ro_session->dlg_h_id, NULL); call_terminated = 1; } else { - LM_DBG("No more credit for user - letting call run out of money in [%i] seconds", whatsleft); + LM_DBG("No more credit for user - letting call run out of money in [%i] seconds\n", whatsleft); int ret = insert_ro_timer(&i_req->ro_session->ro_tl, whatsleft); if (ret != 0) { LM_CRIT("unable to insert timer for Ro Session [%.*s]\n", @@ -373,7 +373,7 @@ void resume_ro_session_ontimeout(struct interim_ccr *i_req, int timeout_or_error } shm_free(i_req); - LM_DBG("Exiting async ccr interim nicely"); + LM_DBG("Exiting async ccr interim nicely\n"); } /* this is the function called when a we need to request more funds/credit. We need to try and reserve more credit. @@ -392,14 +392,14 @@ void ro_session_ontimeout(struct ro_tl *tl) { LM_DBG("offset for ro_tl is [%lu] and ro_session id is [%.*s]\n", (unsigned long) (&((struct ro_session*) 0)->ro_tl), ro_session->ro_session_id.len, ro_session->ro_session_id.s); if (!ro_session) { - LM_ERR("Can't find a session. This is bad"); + LM_ERR("Can't find a session. This is bad\n"); return; } - LM_DBG("event-type=%d", ro_session->event_type); + LM_DBG("event-type=%d\n", ro_session->event_type); // if (!ro_session->active) { - // LM_ALERT("Looks like this session was terminated while requesting more units"); + // LM_ALERT("Looks like this session was terminated while requesting more units\n"); // goto exit; // return; // } @@ -438,7 +438,7 @@ void ro_session_ontimeout(struct ro_tl *tl) { ro_session->asserted_identity.len, ro_session->asserted_identity.s); - LM_DBG("Call session has been active for %i seconds. The last reserved secs was [%i] and the last event was [%i seconds] ago", + LM_DBG("Call session has been active for %i seconds. The last reserved secs was [%i] and the last event was [%i seconds] ago\n", (unsigned int) call_time, (unsigned int) ro_session->reserved_secs, (unsigned int) used_secs);