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.
This commit is contained in:
parent
52ccf6a480
commit
9c31cfc3a2
|
@ -348,11 +348,16 @@ int bsc_mgcp_extract_ci(const char *str)
|
||||||
{
|
{
|
||||||
int ci;
|
int ci;
|
||||||
char *res = strstr(str, "I: ");
|
char *res = strstr(str, "I: ");
|
||||||
if (!res)
|
if (!res) {
|
||||||
|
LOGP(DMGCP, LOGL_ERROR, "No CI in msg '%s'\n", str);
|
||||||
return CI_UNUSED;
|
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_UNUSED;
|
||||||
|
}
|
||||||
|
|
||||||
return ci;
|
return ci;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue