summaryrefslogtreecommitdiffstats
path: root/route.c
diff options
context:
space:
mode:
authorSuper User2007-07-29 11:46:49 +0200
committerSuper User2007-07-29 11:46:49 +0200
commitfb872d7e65ffc0563789f92e9e6f10d855f13207 (patch)
tree6c06696f6346db2afe5ad7d40e61a251471db522 /route.c
parentbeta phase is reached (diff)
downloadlcr-fb872d7e65ffc0563789f92e9e6f10d855f13207.tar.gz
lcr-fb872d7e65ffc0563789f92e9e6f10d855f13207.tar.xz
lcr-fb872d7e65ffc0563789f92e9e6f10d855f13207.zip
fixed routing: only parameters that are allowed may be present in the routing file.
fixed pick-up of a call that rings on a different extension/phone
Diffstat (limited to 'route.c')
-rw-r--r--route.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/route.c b/route.c
index a7b1416..8c158bf 100644
--- a/route.c
+++ b/route.c
@@ -848,6 +848,7 @@ struct route_ruleset *ruleset_parse(void)
struct route_param *param;
struct route_param **param_pointer = NULL;
char failure[256];
+ unsigned long long allowed_params;
/* check the integrity of IDs for ACTION_* and PARAM_* */
i = 0;
@@ -1461,6 +1462,7 @@ struct route_ruleset *ruleset_parse(void)
SPRINT(failure, "Unknown action name '%s'.", key);
goto parse_error;
}
+ allowed_params = action_defs[index].params;
/* alloc memory for action */
action = (struct route_action *)MALLOC(sizeof(struct route_action));
@@ -1510,6 +1512,13 @@ struct route_ruleset *ruleset_parse(void)
goto parse_error;
}
+ /* check if item is allowed for the action */
+ if (!(param_defs[index].id & allowed_params))
+ {
+ SPRINT(failure, "Param name '%s' exists, but not for this action.", key);
+ goto parse_error;
+ }
+
/* params without values must not have any parameter */
if (param_defs[index].type == PARAM_TYPE_NULL)
{