Logging: Add debug logging for status/causes

Adds some DEBUG level logging for SIP status and MNCC causes.

Change-Id: Ib56e34ba079c7927e932c1b29d3e8341b8099ae0
This commit is contained in:
Keith Whyte 2018-08-31 16:01:12 +02:00
parent 5a7a957536
commit 741c51bb61
2 changed files with 9 additions and 3 deletions

View File

@ -264,7 +264,7 @@ static void mncc_call_leg_release(struct call_leg *_leg)
case MNCC_CC_PROCEEDING: case MNCC_CC_PROCEEDING:
case MNCC_CC_CONNECTED: case MNCC_CC_CONNECTED:
LOGP(DMNCC, LOGL_DEBUG, LOGP(DMNCC, LOGL_DEBUG,
"Releasing call in non-initial leg(%u)\n", leg->callref); "Releasing call in non-initial leg(%u) cause(%d)\n", leg->callref, leg->base.cause);
leg->base.in_release = true; leg->base.in_release = true;
start_cmd_timer(leg, MNCC_REL_IND); start_cmd_timer(leg, MNCC_REL_IND);
mncc_send(leg->conn, MNCC_DISC_REQ, leg->callref); mncc_send(leg->conn, MNCC_DISC_REQ, leg->callref);
@ -507,6 +507,8 @@ static void check_disc_ind(struct mncc_connection *conn, const char *buf, int rc
if (!leg) if (!leg)
return; return;
LOGP(DMNCC,
LOGL_DEBUG, "Rcvd MNCC_DISC_IND, Cause: %d\n", data->cause.value);
LOGP(DMNCC, LOGP(DMNCC,
LOGL_DEBUG, "leg(%u) was disconnected. Releasing\n", data->callref); LOGL_DEBUG, "leg(%u) was disconnected. Releasing\n", data->callref);
leg->base.in_release = true; leg->base.in_release = true;
@ -529,6 +531,8 @@ static void check_rel_ind(struct mncc_connection *conn, const char *buf, int rc)
if (!leg) if (!leg)
return; return;
LOGP(DMNCC, LOGL_DEBUG, "Rcvd MNCC_REL_IND, Cause: %d\n", data->cause.value);
if (leg->base.in_release) if (leg->base.in_release)
stop_cmd_timer(leg, MNCC_REL_IND); stop_cmd_timer(leg, MNCC_REL_IND);
else { else {
@ -587,7 +591,7 @@ static void check_rej_ind(struct mncc_connection *conn, const char *buf, int rc)
other_leg->cause = data->cause.value; other_leg->cause = data->cause.value;
other_leg->release_call(other_leg); other_leg->release_call(other_leg);
} }
LOGP(DMNCC, LOGL_DEBUG, "leg(%u) was rejected.\n", data->callref); LOGP(DMNCC, LOGL_DEBUG, "leg(%u) was rejected with cause(%d).\n", data->callref, leg->cause);
mncc_leg_release(leg); mncc_leg_release(leg);
} }

View File

@ -239,12 +239,13 @@ void nua_callback(nua_event_t event, int status, char const *phrase, nua_t *nua,
else if (status >= 300) { else if (status >= 300) {
struct call_leg *other = call_leg_other(&leg->base); struct call_leg *other = call_leg_other(&leg->base);
LOGP(DSIP, LOGL_ERROR, "leg(%p) unknown err, releasing.\n", leg); LOGP(DSIP, LOGL_ERROR, "leg(%p) unknown SIP status(%d), releasing.\n", leg, status);
nua_cancel(leg->nua_handle, TAG_END()); nua_cancel(leg->nua_handle, TAG_END());
nua_handle_destroy(leg->nua_handle); nua_handle_destroy(leg->nua_handle);
call_leg_release(&leg->base); call_leg_release(&leg->base);
if (other) { if (other) {
LOGP(DSIP, LOGL_DEBUG, "Releasing other leg (%p) with status(%d)\n", other, status);
other->cause = status2cause(status); other->cause = status2cause(status);
other->release_call(other); other->release_call(other);
} }
@ -326,6 +327,7 @@ static void sip_release_call(struct call_leg *_leg)
* to help us here. * to help us here.
*/ */
LOGP(DSIP, LOGL_DEBUG, "%s(): Release with MNCC cause(%d)\n", __func__, _leg->cause);
cause2status(_leg->cause, &sip_cause, &sip_phrase, &reason_text); cause2status(_leg->cause, &sip_cause, &sip_phrase, &reason_text);
snprintf(reason, sizeof reason, "Q.850;cause=%u;text=\"%s\"", _leg->cause, reason_text); snprintf(reason, sizeof reason, "Q.850;cause=%u;text=\"%s\"", _leg->cause, reason_text);