diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-12-17 10:15:59 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2013-02-24 15:10:49 +0100 |
commit | 6808407dcf22dd55fc764f4658585495c6bdc96c (patch) | |
tree | ff7170ccfadee911b7371f486364c0112d26eff6 /src | |
parent | 5d04481455205b781278db00825426177823b331 (diff) |
isup_filter: Add debug and log messages for the filtering
This way one can check the logs if this code path is hit. The
logging normally only occurs for the two messages we are interested
in. It doesn't make sense to reset with a range of 0 so the code
has been re-ordered.
Diffstat (limited to 'src')
-rw-r--r-- | src/isup_filter.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/isup_filter.c b/src/isup_filter.c index db023b6..0e9a10c 100644 --- a/src/isup_filter.c +++ b/src/isup_filter.c @@ -23,6 +23,7 @@ #include <mgcp_callagent.h> #include <ss7_application.h> #include <bsc_data.h> +#include <cellmgr_debug.h> #include <osmocom/core/msgb.h> @@ -62,22 +63,38 @@ int isup_scan_for_reset(struct ss7_application *app, struct msgb *msg) int range; /* too small for an isup message? */ - if (msgb_l3len(msg) < sizeof(*hdr)) + if (msgb_l3len(msg) < sizeof(*hdr)) { + LOGP(DISUP, LOGL_ERROR, "Message too small for the header\n"); return -1; + } /* no trunk name, don't bother forwarding */ - if (!app->trunk_name) + if (!app->trunk_name) { + LOGP(DISUP, LOGL_DEBUG, + "No trunk name defined for: %s\n", app->name); return 0; + } hdr = (struct isup_msg_hdr *) msg->l3h; switch (hdr->msg_type) { case ISUP_MSG_GRS: range = isup_parse_status(&hdr->data[0], msgb_l3len(msg) - sizeof(*hdr)); - if (range >= 0) - reset_cics(app, hdr->cic, range); + if (range <= 0) { + LOGP(DISUP, LOGL_ERROR, + "Failed to parse range on app %s\n", app->name); + return -1; + } + + LOGP(DISUP, LOGL_DEBUG, + "Going to reset ISUP for app %s, cic %d range %d\n", + app->name, hdr->cic, range); + reset_cics(app, hdr->cic, range); break; case ISUP_MSG_RSC: + LOGP(DISUP, LOGL_DEBUG, + "Going to reset single CIC %d on app %s\n", + hdr->cic, app->name); reset_cic(app, hdr->cic); break; } |