neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sip-connector/+/35308?usp=email )
Change subject: verbosely log MNCC and SDP ...................................................................... verbosely log MNCC and SDP Change-Id: Ie923117929c6b79b1eb61e5a9f02a169edabc599 --- M src/mncc.c M src/sdp.c M src/sip.c 3 files changed, 52 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector refs/changes/08/35308/1 diff --git a/src/mncc.c b/src/mncc.c index ed36085..e97b42d 100644 --- a/src/mncc.c +++ b/src/mncc.c @@ -134,12 +134,14 @@ { int rc; + LOGP(DMNCC, LOGL_DEBUG, "tx MNCC %s with SDP=%s\n", osmo_mncc_name(mncc->msg_type), + osmo_quote_str(mncc->sdp, -1)); + /* * TODO: we need to put cause in here for release or such? shall we return a * static struct? */ rc = write(conn->fd.fd, mncc, sizeof(*mncc)); - LOGP(DMNCC, LOGL_DEBUG, "MNCC sent message type: %s\n", osmo_mncc_name(mncc->msg_type)); if (rc != sizeof(*mncc)) { LOGP(DMNCC, LOGL_ERROR, "Failed to send message for call(%u)\n", mncc->callref); close_connection(conn); @@ -160,8 +162,10 @@ { int rc; + LOGP(DMNCC, LOGL_DEBUG, "tx MNCC %s with SDP=%s\n", osmo_mncc_name(rtp->msg_type), + osmo_quote_str(rtp->sdp, -1)); + rc = write(conn->fd.fd, rtp, sizeof(*rtp)); - LOGP(DMNCC, LOGL_DEBUG, "MNCC sent message type: %s\n", osmo_mncc_name(rtp->msg_type)); if (rc != sizeof(*rtp)) { LOGP(DMNCC, LOGL_ERROR, "Failed to send message for call(%u): %d\n", rtp->callref, rc); close_connection(conn); @@ -1035,6 +1039,9 @@ uint32_t msg_type; int rc; struct mncc_connection *conn = fd->data; + const struct gsm_mncc *gsm_mncc; + const struct gsm_mncc_rtp *gsm_mncc_rtp; + const char *sdp = NULL; rc = read(fd->fd, buf, sizeof(buf)); if (rc <= 0) { @@ -1049,8 +1056,38 @@ memcpy(&msg_type, buf, 4); - LOGP(DMNCC, LOGL_DEBUG, "MNCC rcvd message type: %s\n", osmo_mncc_name(msg_type)); + /* Log about the received MNCC message */ + switch (msg_type) { + case MNCC_SETUP_IND: + case MNCC_DISC_IND: + case MNCC_REL_IND: + case MNCC_REJ_IND: + case MNCC_REL_CNF: + case MNCC_SETUP_COMPL_IND: + case MNCC_SETUP_CNF: + case MNCC_CALL_CONF_IND: + case MNCC_ALERT_IND: + case MNCC_HOLD_IND: + case MNCC_RETRIEVE_IND: + gsm_mncc = (void*)buf; + sdp = gsm_mncc->sdp; + break; + case MNCC_RTP_CREATE: + case MNCC_RTP_CONNECT: + gsm_mncc_rtp = (void*)buf; + sdp = gsm_mncc_rtp->sdp; + break; + default: + break; + } + if (sdp) + LOGP(DMNCC, LOGL_DEBUG, "rx MNCC %s with SDP=%s\n", osmo_mncc_name(msg_type), + osmo_quote_str(sdp, -1)); + else + LOGP(DMNCC, LOGL_DEBUG, "rx MNCC %s\n", osmo_mncc_name(msg_type)); + + /* Handle the received MNCC message */ switch (msg_type) { case MNCC_SOCKET_HELLO: check_hello(conn, buf, rc); diff --git a/src/sdp.c b/src/sdp.c index 7e632c3..ed57031 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -322,7 +322,7 @@ sdp = sdp_session(parser); if (!sdp) { - LOGP(DSIP, LOGL_ERROR, "leg(%p) no sdp session\n", other); + LOGP(DSIP, LOGL_INFO, "leg(%p) no SDP session in %s, returning SDP unchanged\n", other, osmo_quote_str(sdp_data, -1)); sdp_parser_free(parser); return talloc_strdup(leg, sdp_data); } diff --git a/src/sip.c b/src/sip.c index 0c8130f..99bab9f 100644 --- a/src/sip.c +++ b/src/sip.c @@ -358,8 +358,8 @@ void nua_callback(nua_event_t event, int status, char const *phrase, nua_t *nua, nua_magic_t *magic, nua_handle_t *nh, nua_hmagic_t *hmagic, sip_t const *sip, tagi_t tags[]) { - LOGP(DSIP, LOGL_DEBUG, "SIP event[%s] status(%d) phrase(%s) %p\n", - nua_event_name(event), status, phrase, hmagic); + LOGP(DSIP, LOGL_DEBUG, "SIP event[%s] status(%d) phrase(%s) SDP(%s) %p\n", + nua_event_name(event), status, phrase, sip_get_sdp(sip), hmagic); if (event == nua_r_invite) { struct sip_call_leg *leg; -- To view, visit https://gerrit.osmocom.org/c/osmo-sip-connector/+/35308?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Change-Id: Ie923117929c6b79b1eb61e5a9f02a169edabc599 Gerrit-Change-Number: 35308 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofm...@sysmocom.de> Gerrit-MessageType: newchange