mgcp_e1: make E1 ts initalization more debugable

The E1 timeslot initalization may fail silently in the last steps. There
is an error code returned, but no log lines are printed. This can make
debugging difficult.

Change-Id: I9aab17fc1ba6666c81b14035a8f1f17e5a55adaf
This commit is contained in:
Philipp Maier 2020-08-18 17:02:02 +02:00
parent 9e494e67c7
commit ad79f9eb99
1 changed files with 6 additions and 2 deletions

View File

@ -400,11 +400,15 @@ int mgcp_e1_init(struct mgcp_trunk *trunk, uint8_t ts_nr)
/* Configure E1 timeslot */
rc = e1inp_ts_config_raw(&e1_line->ts[ts_nr - 1], e1_line, e1_recv_cb);
if (rc < 0)
if (rc < 0) {
LOGPTRUNK(trunk, DE1, LOGL_ERROR, "failed to put E1 timeslot %u in raw mode.\n", ts_nr);
return -EINVAL;
}
rc = e1inp_line_update(e1_line);
if (rc < 0)
if (rc < 0) {
LOGPTRUNK(trunk, DE1, LOGL_ERROR, "failed to update E1 timeslot %u.\n", ts_nr);
return -EINVAL;
}
LOGPTRUNK(trunk, DE1, LOGL_DEBUG, "E1 timeslot %u set up successfully.\n", ts_nr);
trunk->e1.ts_in_use[ts_nr - 1] = true;