static const struct misdn_cfg_spec gen_spec[] = {
{ "debug", MISDN_GEN_DEBUG, MISDN_CTYPE_INT, "0", NONE },
+#ifndef MISDN_1_2
{ "misdn_init", MISDN_GEN_MISDN_INIT, MISDN_CTYPE_STR, "/etc/misdn-init.conf", NONE },
+#endif
{ "tracefile", MISDN_GEN_TRACEFILE, MISDN_CTYPE_STR, "/var/log/asterisk/misdn.log", NONE },
{ "bridging", MISDN_GEN_BRIDGING, MISDN_CTYPE_BOOL, "yes", NONE },
{ "stop_tone_after_first_digit", MISDN_GEN_STOP_TONE, MISDN_CTYPE_BOOL, "yes", NONE },
void misdn_cfg_update_ptp (void)
{
+#ifndef MISDN_1_2
char misdn_init[BUFFERSIZE];
char line[BUFFERSIZE];
FILE *fp;
ast_log(LOG_WARNING,"Couldn't open %s: %s\n", misdn_init, strerror(errno));
}
}
+#else
+ int i;
+ int proto;
+ char filename[128];
+ FILE *fp;
+
+ for (i = 1; i <= max_ports; ++i) {
+ snprintf(filename, sizeof(filename), "/sys/class/mISDN-stacks/st-%08x/protocol", i << 8);
+ fp = fopen(filename, "r");
+ if (!fp) {
+ ast_log(LOG_WARNING, "Could not open %s: %s\n", filename, strerror(errno));
+ continue;
+ }
+ if (fscanf(fp, "0x%08x", &proto) != 1)
+ ast_log(LOG_WARNING, "Could not parse contents of %s!\n", filename);
+ else
+ ptp[i] = proto & 1<<4 ? 1 : 0;
+ fclose(fp);
+ }
+#endif
}
static void _fill_defaults (void)