chan_dect: fix up for latest libdect changes
Specify the cluster to bind to. Signed-off-by: Patrick McHardy <kaber@trash.net>
This commit is contained in:
parent
1c68400dff
commit
1986d9de4d
|
@ -27,6 +27,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision")
|
|||
#include "asterisk/callerid.h"
|
||||
#include "asterisk/abstract_jb.h"
|
||||
|
||||
#include <linux/dect.h>
|
||||
#include <dect/libdect.h>
|
||||
#include <dect/terminal.h>
|
||||
#include <dect/debug.h>
|
||||
|
@ -45,6 +46,7 @@ static const struct ast_jb_conf dect_default_jbconf = {
|
|||
};
|
||||
|
||||
struct {
|
||||
char cluster[DECTNAMSIZ];
|
||||
struct ast_jb_conf jbconf;
|
||||
char context[AST_MAX_CONTEXT];
|
||||
char language[MAX_LANGUAGE];
|
||||
|
@ -1420,7 +1422,10 @@ static int dect_load_config(void)
|
|||
if (!ast_jb_read_conf(&dect_cfg.jbconf, v->name, v->value))
|
||||
continue;
|
||||
|
||||
if (!strcasecmp(v->name, "context")) {
|
||||
if (!strcasecmp(v->name, "cluster")) {
|
||||
ast_copy_string(dect_cfg.cluster, v->value,
|
||||
sizeof(dect_cfg.cluster));
|
||||
} else if (!strcasecmp(v->name, "context")) {
|
||||
ast_copy_string(dect_cfg.context, v->value,
|
||||
sizeof(dect_cfg.context));
|
||||
} else if (!strcasecmp(v->name, "language")) {
|
||||
|
@ -1735,6 +1740,8 @@ static void dect_io_thread_stop(void)
|
|||
|
||||
static int dect_load_module(void)
|
||||
{
|
||||
const char *cluster;
|
||||
|
||||
sched = sched_context_create();
|
||||
if (sched == NULL) {
|
||||
ast_log(LOG_ERROR, "Unable to create scheduler context\n");
|
||||
|
@ -1765,7 +1772,8 @@ static int dect_load_module(void)
|
|||
goto err5;
|
||||
}
|
||||
|
||||
if (dect_init(dh) < 0) {
|
||||
cluster = strlen(dect_cfg.cluster) ? dect_cfg.cluster : NULL;
|
||||
if (dect_init(dh, cluster) < 0) {
|
||||
ast_log(LOG_ERROR, "Unable to initialize DECT handle\n");
|
||||
goto err6;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
[general]
|
||||
cluster = cluster0
|
||||
|
||||
context = default
|
||||
language = de
|
||||
|
||||
|
|
Reference in New Issue