aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2024-02-05 05:14:35 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2024-02-08 23:42:17 +0100
commit100f8f9027eb0f0bc074eab44260e02446ef1b1b (patch)
treed0f3f93f3705121ba3af21ee293875ada810efa7
parentfb18315bdcea2a93a36f5c24da6d8f3862ac5b16 (diff)
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
-rw-r--r--include/osmocom/msc/transaction_cc.h3
-rw-r--r--src/libmsc/transaction_cc.c15
2 files changed, 10 insertions, 8 deletions
diff --git a/include/osmocom/msc/transaction_cc.h b/include/osmocom/msc/transaction_cc.h
index c16d9c1d6..963cb457a 100644
--- a/include/osmocom/msc/transaction_cc.h
+++ b/include/osmocom/msc/transaction_cc.h
@@ -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);
diff --git a/src/libmsc/transaction_cc.c b/src/libmsc/transaction_cc.c
index 1ea66330e..2a540bfa5 100644
--- a/src/libmsc/transaction_cc.c
+++ b/src/libmsc/transaction_cc.c
@@ -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;
}
}