printf("Usage: %s\n", cond_defs[i].doc);
printf("%s\n\n", cond_defs[i].help);
i++;
printf("Usage: %s\n", cond_defs[i].doc);
printf("%s\n\n", cond_defs[i].help);
i++;
printf("Available actions with their parameters:\n");
printf("----------------------------------------\n\n");
printf("Available actions with their parameters:\n");
printf("----------------------------------------\n\n");
printf("Detailes parameter description of action:\n");
printf("-----------------------------------------\n\n");
}
i = 0;
printf("Detailes parameter description of action:\n");
printf("-----------------------------------------\n\n");
}
i = 0;
- while(action_defs[i].name)
- {
- if (name && !!strcmp(action_defs[i].name,name)) /* not selected */
- {
+ while(action_defs[i].name) {
+ if (name && !!strcmp(action_defs[i].name,name)) { /* not selected */
if ((1LL<<j) & action_defs[i].params)
printf(" [%s]", param_defs[j].doc);
j++;
}
printf("\n%s\n\n", action_defs[i].help);
if ((1LL<<j) & action_defs[i].params)
printf(" [%s]", param_defs[j].doc);
j++;
}
printf("\n%s\n\n", action_defs[i].help);
if ((1LL<<j) & action_defs[i].params)
printf("%s:\n\t%s\n", param_defs[j].doc, param_defs[j].help);
j++;
if ((1LL<<j) & action_defs[i].params)
printf("%s:\n\t%s\n", param_defs[j].doc, param_defs[j].help);
j++;
printf("Ruleset: '%s'\n", ruleset->name);
rule = ruleset->rule_first;
printf("Ruleset: '%s'\n", ruleset->name);
rule = ruleset->rule_first;
default:
printf("Software error: VALUE_TYPE_* %d not known in function '%s' line=%d", cond->value_type, __FUNCTION__, __LINE__);
}
default:
printf("Software error: VALUE_TYPE_* %d not known in function '%s' line=%d", cond->value_type, __FUNCTION__, __LINE__);
}
printf(" Action: %s\n", action_defs[action->index].name);
/* PARAM */
first = 1;
param = action->param_first;
printf(" Action: %s\n", action_defs[action->index].name);
/* PARAM */
first = 1;
param = action->param_first;
printf(" %s", param_defs[param->index].name);
if (param->value_type != VALUE_TYPE_NULL)
printf(" = ");
printf(" %s", param_defs[param->index].name);
if (param->value_type != VALUE_TYPE_NULL)
printf(" = ");
PERROR("Software Error action '%s' must have id of %d, but has %d.\n",
action_defs[i].name, i, action_defs[i].id);
goto openerror;
PERROR("Software Error action '%s' must have id of %d, but has %d.\n",
action_defs[i].name, i, action_defs[i].id);
goto openerror;
PERROR("Software Error param '%s' must have id of 0x%llx, but has 0x%llx.\n",
param_defs[i].name, j, param_defs[i].id);
goto openerror;
PERROR("Software Error param '%s' must have id of 0x%llx, but has 0x%llx.\n",
param_defs[i].name, j, param_defs[i].id);
goto openerror;
p++;
/* don't skip "define" */
if (!!strncmp(p, "define", 6))
p++;
/* don't skip "define" */
if (!!strncmp(p, "define", 6))
if (*p == 0)
break;
p++;
}
p++;
p = read_string(p, key, sizeof(key), " ");
if (*p == 0)
break;
p++;
}
p++;
p = read_string(p, key, sizeof(key), " ");
SCPY(filename[nesting+1], key);
else
SPRINT(filename[nesting+1], "%s/%s", CONFIG_DATA, key);
SCPY(filename[nesting+1], key);
else
SPRINT(filename[nesting+1], "%s/%s", CONFIG_DATA, key);
SPRINT(failure, "Duplicate ruleset '%s', already defined in file '%s' line %d.", key, ruleset->file, ruleset->line);
goto parse_error;
}
SPRINT(failure, "Duplicate ruleset '%s', already defined in file '%s' line %d.", key, ruleset->file, ruleset->line);
goto parse_error;
}
SPRINT(failure, "Illegal character '%c' after condition name '%s'. Expecting '=' for equation or ' ' to seperate condition items.", *p, key);
goto parse_error;
}
/* check if condition exists */
index = 0;
SPRINT(failure, "Illegal character '%c' after condition name '%s'. Expecting '=' for equation or ' ' to seperate condition items.", *p, key);
goto parse_error;
}
/* check if condition exists */
index = 0;
SPRINT(failure, "Unknown condition item name '%s'.", key);
goto parse_error;
}
/* items without values must not have any parameter */
SPRINT(failure, "Unknown condition item name '%s'.", key);
goto parse_error;
}
/* items without values must not have any parameter */
SPRINT(failure, "Condition item '%s' must not have any value. Don't use '=' for this type of condition.", key);
goto parse_error;
}
SPRINT(failure, "Condition item '%s' must not have any value. Don't use '=' for this type of condition.", key);
goto parse_error;
}
SPRINT(failure, "Condition item '%s' must not have any value. Expecting ' ' or tab after item name.", key);
goto parse_error;
}
// p++;
SPRINT(failure, "Condition item '%s' must not have any value. Expecting ' ' or tab after item name.", key);
goto parse_error;
}
// p++;
SPRINT(failure, "Condition item '%s' must have at least one value, '=' expected, and not a space.", key);
goto parse_error;
}
SPRINT(failure, "Condition item '%s' must have at least one value, '=' expected, and not a space.", key);
goto parse_error;
}
SPRINT(failure, "Condition item '%s' must have at least one value, '=' expected.", key);
goto parse_error;
}
SPRINT(failure, "Condition item '%s' must have at least one value, '=' expected.", key);
goto parse_error;
}
SPRINT(failure, "Duplicate condition '%s', use ',' to give multiple values.", key);
goto parse_error;
}
SPRINT(failure, "Duplicate condition '%s', use ',' to give multiple values.", key);
goto parse_error;
}
SPRINT(failure, "Given day-of-month '%d' not in range 1..31", integer);
goto parse_error;
}
if (value_type == VALUE_TYPE_INTEGER)
goto integer_done;
SPRINT(failure, "Given day-of-month '%d' not in range 1..31", integer);
goto parse_error;
}
if (value_type == VALUE_TYPE_INTEGER)
goto integer_done;
SPRINT(failure, "Given day-of-week '%d' not in range 1..7", integer);
goto parse_error;
}
if (value_type == VALUE_TYPE_INTEGER)
goto integer_done;
SPRINT(failure, "Given day-of-week '%d' not in range 1..7", integer);
goto parse_error;
}
if (value_type == VALUE_TYPE_INTEGER)
goto integer_done;
SPRINT(failure, "Given month '%d' not in range 1..12", integer);
goto parse_error;
}
if (value_type == VALUE_TYPE_INTEGER)
goto integer_done;
SPRINT(failure, "Given month '%d' not in range 1..12", integer);
goto parse_error;
}
if (value_type == VALUE_TYPE_INTEGER)
goto integer_done;
SPRINT(failure, "Given year '%d' not in range 1970..2106", integer);
goto parse_error;
}
if (value_type == VALUE_TYPE_INTEGER)
goto integer_done;
SPRINT(failure, "Given year '%d' not in range 1970..2106", integer);
goto parse_error;
}
if (value_type == VALUE_TYPE_INTEGER)
goto integer_done;
SPRINT(failure, "Missing string value, use \"\" for empty string.");
goto parse_error;
}
p = read_string(p, key, sizeof(key), "-, ");
SPRINT(failure, "Missing string value, use \"\" for empty string.");
goto parse_error;
}
p = read_string(p, key, sizeof(key), "-, ");
SPRINT(failure, "Parsing String failed: %s", key+1);
goto parse_error;
}
value_type = VALUE_TYPE_STRING;
SPRINT(failure, "Parsing String failed: %s", key+1);
goto parse_error;
}
value_type = VALUE_TYPE_STRING;
SPRINT(failure, "Missing string value, use \"\" for empty string.");
goto parse_error;
}
p = read_string(p, key_to, sizeof(key_to), "-, ");
SPRINT(failure, "Missing string value, use \"\" for empty string.");
goto parse_error;
}
p = read_string(p, key_to, sizeof(key_to), "-, ");
SPRINT(failure, "Parsing string failed: %s", key_to+1);
goto parse_error;
}
value_type = VALUE_TYPE_STRING_RANGE;
SPRINT(failure, "Parsing string failed: %s", key_to+1);
goto parse_error;
}
value_type = VALUE_TYPE_STRING_RANGE;
SPRINT(failure, "Given range of strings \"%s\"-\"%s\" have unequal length.", key, key_to);
goto parse_error;
}
SPRINT(failure, "Given range of strings \"%s\"-\"%s\" have unequal length.", key, key_to);
goto parse_error;
}
cond->string_value = (char *)MALLOC(strlen(key)+1);
rmemuse++;
UCPY(cond->string_value, key);
cond->string_value = (char *)MALLOC(strlen(key)+1);
rmemuse++;
UCPY(cond->string_value, key);
cond->string_value_to = (char *)MALLOC(strlen(key_to)+1);
rmemuse++;
UCPY(cond->string_value_to, key_to);
cond->string_value_to = (char *)MALLOC(strlen(key_to)+1);
rmemuse++;
UCPY(cond->string_value_to, key_to);
cond->integer_value = INFO_BC_DATAUNRESTRICTED;
else if (!strncasecmp("digital-unrestricted-tones", p, 26))
cond->integer_value = INFO_BC_DATAUNRESTRICTED_TONES;
cond->integer_value = INFO_BC_DATAUNRESTRICTED;
else if (!strncasecmp("digital-unrestricted-tones", p, 26))
cond->integer_value = INFO_BC_DATAUNRESTRICTED_TONES;
cond->integer_value = INFO_BMODE_CIRCUIT;
else if (!strncasecmp("hdlc", p, 4))
cond->integer_value = INFO_BMODE_PACKET;
cond->integer_value = INFO_BMODE_CIRCUIT;
else if (!strncasecmp("hdlc", p, 4))
cond->integer_value = INFO_BMODE_PACKET;
SPRINT(failure, "Missing interface name.");
goto parse_error;
}
p = read_string(p, key, sizeof(key), ":-, ");
SPRINT(failure, "Missing interface name.");
goto parse_error;
}
p = read_string(p, key, sizeof(key), ":-, ");
p++;
/* next item */
cond->value_extension = 1;
goto nextcondvalue;
}
/* to seperate the items, a space is required */
p++;
/* next item */
cond->value_extension = 1;
goto nextcondvalue;
}
/* to seperate the items, a space is required */
SPRINT(failure, "Character '%c' not expected here. Use ',' to seperate multiple possible values.", *p);
goto parse_error;
}
SPRINT(failure, "Character '%c' not expected here. Use ',' to seperate multiple possible values.", *p);
goto parse_error;
}
SPRINT(failure, "Unknown param name '%s'.", key);
goto parse_error;
}
/* check if item is allowed for the action */
SPRINT(failure, "Unknown param name '%s'.", key);
goto parse_error;
}
/* check if item is allowed for the action */
SPRINT(failure, "Param name '%s' exists, but not for this action.", key);
goto parse_error;
}
/* params without values must not have any parameter */
SPRINT(failure, "Param name '%s' exists, but not for this action.", key);
goto parse_error;
}
/* params without values must not have any parameter */
SPRINT(failure, "Parameter '%s' must have at least one value, '=' expected and not a space.", key);
goto parse_error;
}
SPRINT(failure, "Parameter '%s' must have at least one value, '=' expected and not a space.", key);
goto parse_error;
}
SPRINT(failure, "Parameter '%s' must have at least one value, '=' expected.", key);
goto parse_error;
}
SPRINT(failure, "Parameter '%s' must have at least one value, '=' expected.", key);
goto parse_error;
}
SPRINT(failure, "Duplicate parameter '%s', use ',' to give multiple values.", key);
goto parse_error;
}
SPRINT(failure, "Duplicate parameter '%s', use ',' to give multiple values.", key);
goto parse_error;
}
SPRINT(failure, "Missing string value, use \"\" for empty string.");
goto parse_error;
}
p = read_string(p, key, sizeof(key), " ");
SPRINT(failure, "Missing string value, use \"\" for empty string.");
goto parse_error;
}
p = read_string(p, key, sizeof(key), " ");
param->integer_value = INFO_NTYPE_INTERNATIONAL;
break;
}
SPRINT(failure, "Caller ID type '%s' unknown.", key);
goto parse_error;
}
param->integer_value = INFO_NTYPE_INTERNATIONAL;
break;
}
SPRINT(failure, "Caller ID type '%s' unknown.", key);
goto parse_error;
}
param->integer_value = INFO_ON_HANGUP;
break;
}
SPRINT(failure, "Execute on '%s' unknown.", key);
goto parse_error;
}
param->integer_value = INFO_ON_HANGUP;
break;
}
SPRINT(failure, "Execute on '%s' unknown.", key);
goto parse_error;
}
param->integer_value = INFO_BC_DATAUNRESTRICTED_TONES;
break;
}
SPRINT(failure, "Service type '%s' unknown.", key);
goto parse_error;
}
param->integer_value = INFO_BC_DATAUNRESTRICTED_TONES;
break;
}
SPRINT(failure, "Service type '%s' unknown.", key);
goto parse_error;
}
param->integer_value = INFO_BMODE_PACKET;
break;
}
SPRINT(failure, "Bchannel mode '%s' unknown.", key);
goto parse_error;
}
param->integer_value = INFO_BMODE_PACKET;
break;
}
SPRINT(failure, "Bchannel mode '%s' unknown.", key);
goto parse_error;
}
param->integer_value = INFO_DIVERSION_CFP;
break;
}
SPRINT(failure, "Diversion type '%s' unknown.", key);
goto parse_error;
}
param->integer_value = INFO_DIVERSION_CFP;
break;
}
SPRINT(failure, "Diversion type '%s' unknown.", key);
goto parse_error;
}
param->integer_value = INFO_NTYPE_INTERNATIONAL;
break;
}
SPRINT(failure, "Number type '%s' unknown.", key);
goto parse_error;
}
param->integer_value = INFO_NTYPE_INTERNATIONAL;
break;
}
SPRINT(failure, "Number type '%s' unknown.", key);
goto parse_error;
}
SPRINT(failure, "Character '%c' not expected here. Use ' ' to seperate parameters, or ',' for multiple values.", *p);
goto parse_error;
}
SPRINT(failure, "Character '%c' not expected here. Use ' ' to seperate parameters, or ',' for multiple values.", *p);
goto parse_error;
}
SPRINT(ruleset_error, "Error in file %s, line %d: %s", filename[nesting], line[nesting], failure);
openerror:
SPRINT(ruleset_error, "Error in file %s, line %d: %s", filename[nesting], line[nesting], failure);
openerror:
SCPY(redirid, numberrize_callerinfo(e_redirinfo.id, e_redirinfo.ntype, options.national, options.international));
PDEBUG(DEBUG_ROUTE, "parsing ruleset '%s'\n", ruleset->name);
SCPY(redirid, numberrize_callerinfo(e_redirinfo.id, e_redirinfo.ntype, options.national, options.international));
PDEBUG(DEBUG_ROUTE, "parsing ruleset '%s'\n", ruleset->name);
PDEBUG(DEBUG_ROUTE, "checking rule in line %d\n", rule->line);
match = 1; /* this rule matches */
dialing_required = 0;
timeout = 0; /* timeout time */
cond = rule->cond_first;
PDEBUG(DEBUG_ROUTE, "checking rule in line %d\n", rule->line);
match = 1; /* this rule matches */
dialing_required = 0;
timeout = 0; /* timeout time */
cond = rule->cond_first;
condition = 0; /* any condition element is true (1) or could be true (2) */
checkextension:
istrue = 0; /* this condition-element is true */
couldbetrue = 0; /* this conditions-element could be true */
condition = 0; /* any condition element is true (1) or could be true (2) */
checkextension:
istrue = 0; /* this condition-element is true */
couldbetrue = 0; /* this conditions-element could be true */
if (mISDNport->ifport)
if (strlen(mISDNport->ifport->interface->name) == comp_len)
if (!strncasecmp(mISDNport->ifport->interface->name, cond->string_value, comp_len))
if (mISDNport->ifport)
if (strlen(mISDNport->ifport->interface->name) == comp_len)
if (!strncasecmp(mISDNport->ifport->interface->name, cond->string_value, comp_len))
if (mISDNport->ifport)
if (!strcasecmp(mISDNport->ifport->interface->name, cond->string_value))
if (!mISDNport->l2hold || mISDNport->l2link>0)
if (mISDNport->ifport)
if (!strcasecmp(mISDNport->ifport->interface->name, cond->string_value))
if (!mISDNport->l2hold || mISDNport->l2link>0)
if (mISDNport->ifport)
if (!strcasecmp(mISDNport->ifport->interface->name, cond->string_value))
if (!mISDNport->l2hold || mISDNport->l2link>0)
if (mISDNport->ifport)
if (!strcasecmp(mISDNport->ifport->interface->name, cond->string_value))
if (!mISDNport->l2hold || mISDNport->l2link>0)
if (mISDNport->ifport)
if (!strcasecmp(mISDNport->ifport->interface->name, cond->string_value))
if (mISDNport->use) /* break if in use */
if (mISDNport->ifport)
if (!strcasecmp(mISDNport->ifport->interface->name, cond->string_value))
if (mISDNport->use) /* break if in use */
match_string_prefix:
comp_len = strlen(cond->string_value); /* because we must reach value's length */
/* we must have greater or equal length to values */
match_string_prefix:
comp_len = strlen(cond->string_value); /* because we must reach value's length */
/* we must have greater or equal length to values */
- if (cond->value_type == VALUE_TYPE_STRING)
- {
- if (!strncmp(string, cond->string_value, comp_len))
- {
+ if (cond->value_type == VALUE_TYPE_STRING) {
+ if (!strncmp(string, cond->string_value, comp_len)) {
- if (cond->comp_string > 0)
- {
- if (strncmp(string, cond->string_value, comp_len) >= 0)
- {
+ if (cond->comp_string > 0) {
+ if (strncmp(string, cond->string_value, comp_len) >= 0) {
istrue = 1;
/* must be set for changing 'e_extdialing' */
if (cond->match == MATCH_DIALING)
dialing_required = comp_len;
break;
}
istrue = 1;
/* must be set for changing 'e_extdialing' */
if (cond->match == MATCH_DIALING)
dialing_required = comp_len;
break;
}
condition = 2; /* element could match and other elements don't match, so condition could match */
/* if not matching or could match */
condition = 2; /* element could match and other elements don't match, so condition could match */
/* if not matching or could match */
/* set timeout in the furture */
e_match_timeout = timeout;
e_match_to_action = rule->action_first;
e_match_to_extdialing = e_dialinginfo.id + dialing_required;
match = 0; /* matches in the future */
}
/* set timeout in the furture */
e_match_timeout = timeout;
e_match_to_action = rule->action_first;
e_match_to_extdialing = e_dialinginfo.id + dialing_required;
match = 0; /* matches in the future */
}
/* matching, we return first action */
action = rule->action_first;
e_match_timeout = 0; /* no timeout */
/* matching, we return first action */
action = rule->action_first;
e_match_timeout = 0; /* no timeout */