report caller's file,line in trans_cc_filter_run()

When we get the codec filter result logged, it is most interesting to
know the caller. So wrap a file-line macro around trans_cc_filter_run().

Change-Id: I243404487c1871e921b08098086ef2fc78a5561d
This commit is contained in:
Neels Hofmeyr 2024-02-05 05:14:35 +01:00
parent fb18315bdc
commit 100f8f9027
2 changed files with 10 additions and 8 deletions

View File

@ -33,6 +33,7 @@
void trans_cc_filter_init(struct gsm_trans *trans);
void trans_cc_filter_set_ran(struct gsm_trans *trans, enum osmo_rat_type ran_type);
void trans_cc_filter_set_bss(struct gsm_trans *trans, struct msc_a *msc_a);
void trans_cc_filter_run(struct gsm_trans *trans);
#define trans_cc_filter_run(TRANS_CC) _trans_cc_filter_run(__FILE__, __LINE__, TRANS_CC)
void _trans_cc_filter_run(const char *file, int line, struct gsm_trans *trans);
void trans_cc_filter_set_ms_from_bc(struct gsm_trans *trans, const struct gsm_mncc_bearer_cap *bcap);
void trans_cc_set_remote_from_bc(struct gsm_trans *trans, const struct gsm_mncc_bearer_cap *bcap);

View File

@ -46,24 +46,25 @@ void trans_cc_filter_set_bss(struct gsm_trans *trans, struct msc_a *msc_a)
* Complete Layer 3. TODO: make it configurable? */
}
void trans_cc_filter_run(struct gsm_trans *trans)
void _trans_cc_filter_run(const char *file, int line, struct gsm_trans *trans)
{
switch (trans->bearer_cap.transfer) {
case GSM48_BCAP_ITCAP_SPEECH:
codec_filter_run(&trans->cc.codecs, &trans->cc.local, &trans->cc.remote);
LOG_TRANS(trans, LOGL_DEBUG, "codecs: %s\n",
codec_filter_to_str(&trans->cc.codecs, &trans->cc.local, &trans->cc.remote));
LOG_TRANS_CAT_SRC(trans, DCC, LOGL_DEBUG, file, line, "codecs: %s\n",
codec_filter_to_str(&trans->cc.codecs, &trans->cc.local, &trans->cc.remote));
break;
case GSM48_BCAP_ITCAP_3k1_AUDIO:
case GSM48_BCAP_ITCAP_FAX_G3:
case GSM48_BCAP_ITCAP_UNR_DIG_INF:
csd_filter_run(&trans->cc.csd, &trans->cc.local, &trans->cc.remote);
LOG_TRANS(trans, LOGL_DEBUG, "codec/BS: %s\n",
csd_filter_to_str(&trans->cc.csd, &trans->cc.local, &trans->cc.remote));
LOG_TRANS_CAT_SRC(trans, DCC, LOGL_DEBUG, file, line, "codec/BS: %s\n",
csd_filter_to_str(&trans->cc.csd, &trans->cc.local, &trans->cc.remote));
break;
default:
LOG_TRANS(trans, LOGL_ERROR, "Handling of information transfer capability %d not implemented\n",
trans->bearer_cap.transfer);
LOG_TRANS_CAT_SRC(trans, DCC, LOGL_ERROR, file, line,
"Handling of information transfer capability %d not implemented\n",
trans->bearer_cap.transfer);
break;
}
}