[E1 input] make sure config file with new E1 input config saves correctly

This commit is contained in:
Harald Welte 2011-02-05 15:57:42 +01:00
parent 889f16eac3
commit 07bb0daaff
3 changed files with 12 additions and 4 deletions

View File

@ -341,12 +341,18 @@ struct e1inp_line *e1inp_line_create(u_int8_t e1_nr, const char *driver_name)
int i;
line = e1inp_line_get(e1_nr);
if (line)
if (line) {
LOGP(DINP, LOGL_ERROR, "E1 Line %u already exists\n",
e1_nr);
return NULL;
}
driver = e1inp_driver_find(driver_name);
if (!driver)
if (!driver) {
LOGP(DINP, LOGL_ERROR, "No such E1 driver '%s'\n",
driver_name);
return NULL;
}
line = talloc_zero(tall_bsc_ctx, struct e1inp_line);
if (!line)

View File

@ -38,7 +38,7 @@
#include "../bscconfig.h"
#define E1_DRIVER_NAMES "(misdn)"
#define E1_DRIVER_NAMES "(misdn|misdn)"
#define E1_DRIVER_HELP "mISDN supported E1 Card\n"
DEFUN(cfg_e1line_driver, cfg_e1_line_driver_cmd,
@ -76,6 +76,8 @@ static int e1inp_config_write(struct vty *vty)
{
struct e1inp_line *line;
vty_out(vty, "e1_input%s", VTY_NEWLINE);
llist_for_each_entry(line, &e1inp_line_list, list) {
vty_out(vty, " e1_line %u driver %s%s", line->num,
line->driver->name, VTY_NEWLINE);

View File

@ -386,7 +386,7 @@ static int activate_bchan(struct e1inp_line *line, int ts, int act)
static int mi_e1_line_update(struct e1inp_line *line);
struct e1inp_driver misdn_driver = {
.name = "mISDN",
.name = "misdn",
.want_write = ts_want_write,
.default_delay = 50000,
.line_update = &mi_e1_line_update,