diff options
author | Harald Welte <laforge@gnumonks.org> | 2010-12-22 21:45:05 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2010-12-26 10:01:41 +0100 |
commit | b7f8b35afdd5b4160dada99d1659db63578f158f (patch) | |
tree | 3383529beb57605b93e67f4a7b21447628fe6567 /openbsc/src | |
parent | baa953ba95e46df1ec449d2675ee9d1ed2b21164 (diff) |
GSM 04.08 / MNCC interface: verbuse logging of incoming MNCC primitives
Diffstat (limited to 'openbsc/src')
-rw-r--r-- | openbsc/src/gsm_04_08.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/openbsc/src/gsm_04_08.c b/openbsc/src/gsm_04_08.c index 3c65a5bf7..23fa9163e 100644 --- a/openbsc/src/gsm_04_08.c +++ b/openbsc/src/gsm_04_08.c @@ -1321,6 +1321,7 @@ static int mncc_recvmsg(struct gsm_network *net, struct gsm_trans *trans, int msg_type, struct gsm_mncc *mncc) { struct msgb *msg; + unsigned char *data; if (trans) if (trans->conn) @@ -1345,7 +1346,10 @@ static int mncc_recvmsg(struct gsm_network *net, struct gsm_trans *trans, msg = msgb_alloc(sizeof(struct gsm_mncc), "MNCC"); if (!msg) return -ENOMEM; - memcpy(msg->data, mncc, sizeof(struct gsm_mncc)); + + data = msgb_put(msg, sizeof(struct gsm_mncc)); + memcpy(data, mncc, sizeof(struct gsm_mncc)); + cc_tx_to_mncc(net, msg); return 0; @@ -2831,6 +2835,8 @@ int mncc_tx_to_cc(struct gsm_network *net, int msg_type, void *arg) struct gsm_bts *bts = NULL; struct gsm_mncc *data = arg, rel; + DEBUGP(DMNCC, "receive message %s\n", get_mncc_name(msg_type)); + /* handle special messages */ switch(msg_type) { case MNCC_BRIDGE: @@ -2842,17 +2848,28 @@ int mncc_tx_to_cc(struct gsm_network *net, int msg_type, void *arg) case GSM_TCHF_FRAME: /* Find callref */ trans = trans_find_by_callref(net, data->callref); - if (!trans) + if (!trans) { + LOGP(DMNCC, LOGL_ERROR, "TCH frame for non-existing trans\n"); return -EIO; - if (!trans->conn) + } + if (!trans->conn) { + LOGP(DMNCC, LOGL_NOTICE, "TCH frame for trans without conn\n"); return 0; - if (trans->conn->lchan->type != GSM_LCHAN_TCH_F) + } + if (trans->conn->lchan->type != GSM_LCHAN_TCH_F) { + /* This should be LOGL_ERROR or NOTICE, but + * unfortuantely it happens for a couple of frames at + * the beginning of every RTP connection */ + LOGP(DMNCC, LOGL_DEBUG, "TCH frame for lchan != TCH_F\n"); return 0; + } bts = trans->conn->lchan->ts->trx->bts; switch (bts->type) { case GSM_BTS_TYPE_NANOBTS: - if (!trans->conn->lchan->abis_ip.rtp_socket) + if (!trans->conn->lchan->abis_ip.rtp_socket) { + LOGP(DMNCC, LOGL_ERROR, "TCH frame for lchan != TCH_F\n"); return 0; + } return rtp_send_frame(trans->conn->lchan->abis_ip.rtp_socket, arg); case GSM_BTS_TYPE_BS11: return trau_send_frame(trans->conn->lchan, arg); |