aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2023-03-04 21:25:17 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2023-03-05 07:03:05 +0100
commit7ee0850914dd4732468ca710045c32929b4f8cec (patch)
tree0b6f7d9a012d46f4f128b3a12fa11879d1ddca82
parent019b89631d70d4f5dd18ab2d1faa982661967e85 (diff)
rtp_stream_commit(): log caller file,line
-rw-r--r--include/osmocom/msc/rtp_stream.h3
-rw-r--r--src/libmsc/rtp_stream.c12
2 files changed, 8 insertions, 7 deletions
diff --git a/include/osmocom/msc/rtp_stream.h b/include/osmocom/msc/rtp_stream.h
index d9a85c2b4..933da0cf2 100644
--- a/include/osmocom/msc/rtp_stream.h
+++ b/include/osmocom/msc/rtp_stream.h
@@ -71,7 +71,8 @@ void rtp_stream_set_codecs(struct rtp_stream *rtps, const struct sdp_audio_codec
void rtp_stream_set_remote_addr(struct rtp_stream *rtps, const struct osmo_sockaddr_str *r);
void rtp_stream_set_remote_addr_and_codecs(struct rtp_stream *rtps, const struct sdp_msg *sdp);
void rtp_stream_set_remote_osmux_cid(struct rtp_stream *rtps, uint8_t osmux_cid);
-int rtp_stream_commit(struct rtp_stream *rtps);
+#define rtp_stream_commit(RTPS) _rtp_stream_commit(RTPS, __FILE__, __LINE__)
+int _rtp_stream_commit(struct rtp_stream *rtps, const char *file, int line);
void rtp_stream_release(struct rtp_stream *rtps);
diff --git a/src/libmsc/rtp_stream.c b/src/libmsc/rtp_stream.c
index 54c120324..0c11eb087 100644
--- a/src/libmsc/rtp_stream.c
+++ b/src/libmsc/rtp_stream.c
@@ -389,26 +389,26 @@ void rtp_stream_release(struct rtp_stream *rtps)
/* After setting up a remote RTP address or a new codec, call this to trigger an MDCX.
* The MDCX will only trigger if all data needed by an endpoint is available (both RTP address and codec) and if at
* least one of them has not yet been sent to the MGW in a previous CRCX or MDCX. */
-int rtp_stream_commit(struct rtp_stream *rtps)
+int _rtp_stream_commit(struct rtp_stream *rtps, const char *file, int line)
{
if (!osmo_sockaddr_str_is_nonzero(&rtps->remote)) {
- LOG_RTPS(rtps, LOGL_DEBUG, "Not committing: no remote RTP address known\n");
+ LOGPFSMLSRC(rtps->fi, LOGL_DEBUG, file, line, "Not committing: no remote RTP address known\n");
return 0;
}
if (!rtps->codecs_known) {
- LOG_RTPS(rtps, LOGL_DEBUG, "Not committing: no codecs known\n");
+ LOGPFSMLSRC(rtps->fi, LOGL_DEBUG, file, line, "Not committing: no codecs known\n");
return 0;
}
if (rtps->remote_sent_to_mgw && rtps->codecs_sent_to_mgw) {
- LOG_RTPS(rtps, LOGL_DEBUG, "Not committing: both remote RTP address and codecs already set up at MGW\n");
+ LOGPFSMLSRC(rtps->fi, LOGL_DEBUG, file, line, "Not committing: both remote RTP address and codecs already set up at MGW\n");
return 0;
}
if (!rtps->ci) {
- LOG_RTPS(rtps, LOGL_DEBUG, "Not committing: no MGW endpoint CI set up\n");
+ LOGPFSMLSRC(rtps->fi, LOGL_DEBUG, file, line, "Not committing: no MGW endpoint CI set up\n");
return -1;
}
- LOG_RTPS(rtps, LOGL_DEBUG, "Committing: Tx MDCX to update the MGW: updating%s%s%s\n",
+ LOGPFSMLSRC(rtps->fi, LOGL_DEBUG, file, line, "Committing: Tx MDCX to update the MGW: updating%s%s%s\n",
rtps->remote_sent_to_mgw ? "" : " remote-RTP-IP-port",
rtps->codecs_sent_to_mgw ? "" : " codecs",
(!rtps->use_osmux || rtps->remote_osmux_cid_sent_to_mgw) ? "" : " remote-Osmux-CID");