Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13593
Change subject: gsm_04_08_cc: improve logging for CC trans ...................................................................... gsm_04_08_cc: improve logging for CC trans Pass trans around more functions as log context. Add missing "rx" logging for two cases. Change-Id: If79f724a2faca70023271398c618cfe490fb294e --- M src/libmsc/gsm_04_08_cc.c 1 file changed, 12 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/93/13593/1 diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c index 4475d05..62b5d12 100644 --- a/src/libmsc/gsm_04_08_cc.c +++ b/src/libmsc/gsm_04_08_cc.c @@ -1601,7 +1601,7 @@ return mncc_recvmsg(trans->net, trans, MNCC_USERINFO_IND, &user); } -static void mncc_recv_rtp(struct gsm_network *net, uint32_t callref, +static void mncc_recv_rtp(struct gsm_network *net, struct gsm_trans *trans, uint32_t callref, int cmd, uint32_t addr, uint16_t port, uint32_t payload_type, uint32_t payload_msg_type) { @@ -1617,7 +1617,7 @@ rtp->port = port; rtp->payload_type = payload_type; rtp->payload_msg_type = payload_msg_type; - mncc_recvmsg(net, NULL, cmd, (struct gsm_mncc *)data); + mncc_recvmsg(net, trans, cmd, (struct gsm_mncc *)data); } static void mncc_recv_rtp_sock(struct gsm_network *net, struct gsm_trans *trans, int cmd) @@ -1652,16 +1652,16 @@ * lchan->abis_ip.rtp_payload */ uint32_t payload_type = 0; - return mncc_recv_rtp(net, trans->callref, cmd, + return mncc_recv_rtp(net, trans, trans->callref, cmd, addr, port, payload_type, msg_type); } -static void mncc_recv_rtp_err(struct gsm_network *net, uint32_t callref, int cmd) +static void mncc_recv_rtp_err(struct gsm_network *net, struct gsm_trans *trans, uint32_t callref, int cmd) { - return mncc_recv_rtp(net, callref, cmd, 0, 0, 0, 0); + return mncc_recv_rtp(net, trans, callref, cmd, 0, 0, 0, 0); } static int tch_rtp_create(struct gsm_network *net, uint32_t callref) @@ -1672,15 +1672,16 @@ trans = trans_find_by_callref(net, callref); if (!trans) { LOG_TRANS_CAT(trans, DMNCC, LOGL_ERROR, "RTP create for non-existing trans\n"); - mncc_recv_rtp_err(net, callref, MNCC_RTP_CREATE); + mncc_recv_rtp_err(net, trans, callref, MNCC_RTP_CREATE); return -EIO; } log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); if (!trans->conn) { LOG_TRANS_CAT(trans, DMNCC, LOGL_NOTICE, "RTP create for trans without conn\n"); - mncc_recv_rtp_err(net, callref, MNCC_RTP_CREATE); + mncc_recv_rtp_err(net, trans, callref, MNCC_RTP_CREATE); return 0; } + LOG_TRANS_CAT(trans, DMNCC, LOGL_DEBUG, "rx %s\n", get_mncc_name(MNCC_RTP_CREATE)); /* When we call msc_mgcp_call_assignment() we will trigger, depending * on the RAN type the call assignment on the A or Iu interface. @@ -1733,16 +1734,18 @@ trans = trans_find_by_callref(net, rtp->callref); if (!trans) { LOG_TRANS_CAT(trans, DMNCC, LOGL_ERROR, "RTP connect for non-existing trans\n"); - mncc_recv_rtp_err(net, rtp->callref, MNCC_RTP_CONNECT); + mncc_recv_rtp_err(net, trans, rtp->callref, MNCC_RTP_CONNECT); return -EIO; } log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); if (!trans->conn) { LOG_TRANS_CAT(trans, DMNCC, LOGL_ERROR, "RTP connect for trans without conn\n"); - mncc_recv_rtp_err(net, rtp->callref, MNCC_RTP_CONNECT); + mncc_recv_rtp_err(net, trans, rtp->callref, MNCC_RTP_CONNECT); return 0; } + LOG_TRANS_CAT(trans, DMNCC, LOGL_DEBUG, "rx %s\n", get_mncc_name(MNCC_RTP_CONNECT)); + addr.s_addr = osmo_htonl(rtp->ip); return msc_mgcp_call_complete(trans, rtp->port, inet_ntoa(addr)); } -- To view, visit https://gerrit.osmocom.org/13593 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If79f724a2faca70023271398c618cfe490fb294e Gerrit-Change-Number: 13593 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr <nhofm...@sysmocom.de>