+}
+
+static struct ast_channel_tech misdn_tech = {
+ .type="lcr",
+ .description="Channel driver for connecting to Linux-Call-Router",
+ .capabilities= je nach option?AST_FORMAT_ALAW:AST_FORMAT_ULAW ,
+ .requester=lcr_request,
+ .send_digit=lcr_digit,
+ .call=lcr_call,
+ .bridge=lcr_bridge,
+ .hangup=lcr_hangup,
+ .answer=lcr_answer,
+ .read=lcr_read,
+ .write=lcr_write,
+ .indicate=lcr_indication,
+ .fixup=lcr_fixup,
+ .send_text=lcr_send_text,
+ .properties=0
+};
+
+
+/*
+ * module loading and destruction
+ */
+int load_module(void)
+{
+// ast_mutex_init(&release_lock);
+
+// lcr_cfg_update_ptp();
+
+ if (!(lcr_sock = open_socket())) {
+ ast_log(LOG_ERROR, "Unable to connect %s\n", misdn_type);
+ lcr_sock = -1;
+ /* continue with closed socket */
+ }
+
+ if (!bchannel_initialize()) {
+ ast_log(LOG_ERROR, "Unable to open mISDN device\n");
+ unload_module();
+ return -1;
+ }
+ mISDN_created = 1;
+
+ if (ast_channel_register(&lcr_tech)) {
+ ast_log(LOG_ERROR, "Unable to register channel class %s\n", misdn_type);
+ unload_module();
+ return -1;
+ }
+
+ ast_cli_register(&cli_show_cls);
+ ast_cli_register(&cli_show_cl);
+ ast_cli_register(&cli_show_config);
+
+ ast_cli_register(&cli_reload);
+
+
+ ast_register_application("misdn_set_opt", misdn_set_opt_exec, "misdn_set_opt",
+ "misdn_set_opt(:<opt><optarg>:<opt><optarg>..):\n"
+ "Sets mISDN opts. and optargs\n"
+ "\n"
+ "The available options are:\n"
+ " d - Send display text on called phone, text is the optparam\n"
+ " n - don't detect dtmf tones on called channel\n"
+ " h - make digital outgoing call\n"
+ " c - make crypted outgoing call, param is keyindex\n"
+ " e - perform echo cancelation on this channel,\n"
+ " takes taps as arguments (32,64,128,256)\n"
+ " s - send Non Inband DTMF as inband\n"
+ " vr - rxgain control\n"
+ " vt - txgain control\n"
+ );