aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-08-06 08:19:05 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-08-06 08:19:05 +0800
commit9c31cfc3a23bf1218800da6ddebd083817ef20d4 (patch)
tree52c500699962e54e9185b92a5eb9dc7f2cb1d81c
parent52ccf6a480f15a32d2fa79ed4ffcb6f334d1550f (diff)
nat: Provide information of when a msg does not contain a CI
When we fail to find a CI in a message that should contain it then print the message so we can analyze the issue and improve the code later on.
-rw-r--r--openbsc/src/nat/bsc_mgcp_utils.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/openbsc/src/nat/bsc_mgcp_utils.c b/openbsc/src/nat/bsc_mgcp_utils.c
index f03834264..05963d3df 100644
--- a/openbsc/src/nat/bsc_mgcp_utils.c
+++ b/openbsc/src/nat/bsc_mgcp_utils.c
@@ -348,11 +348,16 @@ int bsc_mgcp_extract_ci(const char *str)
{
int ci;
char *res = strstr(str, "I: ");
- if (!res)
+ if (!res) {
+ LOGP(DMGCP, LOGL_ERROR, "No CI in msg '%s'\n", str);
return CI_UNUSED;
+ }
- if (sscanf(res, "I: %d", &ci) != 1)
+ if (sscanf(res, "I: %d", &ci) != 1) {
+ LOGP(DMGCP, LOGL_ERROR, "Failed to parse CI in msg '%s'\n", str);
return CI_UNUSED;
+ }
+
return ci;
}