fixed routing: only parameters that are allowed may be present in the routing file.
authorSuper User <root@isdn.jolly.ten>
Sun, 29 Jul 2007 09:46:49 +0000 (11:46 +0200)
committerSuper User <root@isdn.jolly.ten>
Sun, 29 Jul 2007 09:46:49 +0000 (11:46 +0200)
fixed pick-up of a call that rings on a different extension/phone

apppbx.cpp
default/routing.conf
route.c

index 1aeba78..05d755e 100644 (file)
@@ -3725,7 +3725,7 @@ reject:
                PERROR("EPOINT(%d) ringing endpoint's join not found.\n", ea_endpoint->ep_serial);
                goto reject;
        }
-       if (joinpbx->j_type != JOIN_TYPE_PBX)
+       if (join->j_type != JOIN_TYPE_PBX)
        {
                PDEBUG(DEBUG_EPOINT, "EPOINT(%d) ringing endpoint's join is not a PBX join, so we must reject.\n", ea_endpoint->ep_serial);
                goto reject;
index 38e739a..4fbd4ab 100644 (file)
@@ -30,11 +30,11 @@ dialing=0                           : extern
 dialing=1                              : extern capability=digital-unrestricted
 dialing=200-299                                : intern
 dialing=3                              : pick
-dialing=5                              : reply
+dialing=5 enblock                      : reply
+dialing=5                              : reply select
 dialing=6 enblock                      : redial
 dialing=6                              : redial select
-dialing=7 enblock                      : abbrev
-dialing=7                              : abbrev select
+dialing=7                              : abbrev
 dialing=80                             : vbox-play
 dialing=81                             : partyline room=42
 dialing=90                             : powerdial
diff --git a/route.c b/route.c
index a7b1416..8c158bf 100644 (file)
--- 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)
                        {